1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef EXTENSIONS_BROWSER_EXTENSION_PREFS_H_
6 #define EXTENSIONS_BROWSER_EXTENSION_PREFS_H_
12 #include "base/memory/linked_ptr.h"
13 #include "base/memory/scoped_ptr.h"
14 #include "base/prefs/scoped_user_pref_update.h"
15 #include "base/time/time.h"
16 #include "base/values.h"
17 #include "components/browser_context_keyed_service/browser_context_keyed_service.h"
18 #include "extensions/browser/app_sorting.h"
19 #include "extensions/browser/blacklist_state.h"
20 #include "extensions/browser/extension_scoped_prefs.h"
21 #include "extensions/common/constants.h"
22 #include "extensions/common/extension.h"
23 #include "extensions/common/url_pattern_set.h"
24 #include "sync/api/string_ordinal.h"
26 class ExtensionPrefValueMap
;
33 namespace user_prefs
{
34 class PrefRegistrySyncable
;
37 namespace extensions
{
40 class ContentSettingsStore
;
41 class ExtensionPrefsUninstallExtension
;
44 // Class for managing global and per-extension preferences.
46 // This class distinguishes the following kinds of preferences:
47 // - global preferences:
48 // internal state for the extension system in general, not associated
49 // with an individual extension, such as lastUpdateTime.
50 // - per-extension preferences:
51 // meta-preferences describing properties of the extension like
52 // installation time, whether the extension is enabled, etc.
53 // - extension controlled preferences:
54 // browser preferences that an extension controls. For example, an
55 // extension could use the proxy API to specify the browser's proxy
56 // preference. Extension-controlled preferences are stored in
57 // PrefValueStore::extension_prefs(), which this class populates and
58 // maintains as the underlying extensions change.
59 class ExtensionPrefs
: public ExtensionScopedPrefs
,
60 public BrowserContextKeyedService
{
62 typedef std::vector
<linked_ptr
<ExtensionInfo
> > ExtensionsInfo
;
64 // Vector containing identifiers for preferences.
65 typedef std::set
<std::string
> PrefKeySet
;
67 // This enum is used to store the reason an extension's install has been
68 // delayed. Do not remove items or re-order this enum as it is used in
71 DELAY_REASON_NONE
= 0,
73 DELAY_REASON_WAIT_FOR_IDLE
= 2,
74 DELAY_REASON_WAIT_FOR_IMPORTS
= 3,
78 // Creates base::Time classes. The default implementation is just to return
79 // the current time, but tests can inject alternative implementations.
84 virtual ~TimeProvider();
86 // By default, returns the current time (base::Time::Now()).
87 virtual base::Time
GetCurrentTime() const;
90 DISALLOW_COPY_AND_ASSIGN(TimeProvider
);
93 // A wrapper around a ScopedUserPrefUpdate, which allows us to access the
94 // entry of a particular key for an extension. Use this if you need a mutable
95 // record of a dictionary or list in the current settings. Otherwise, prefer
96 // ReadPrefAsT() and UpdateExtensionPref() methods.
97 template <typename T
, base::Value::Type type_enum_value
>
100 ScopedUpdate(ExtensionPrefs
* prefs
,
101 const std::string
& extension_id
,
102 const std::string
& key
);
103 virtual ~ScopedUpdate();
105 // Returns a mutable value for the key (ownership remains with the prefs),
106 // if one exists. Otherwise, returns NULL.
109 // Creates and returns a mutable value for the key (the prefs own the new
110 // value), if one does not already exist. Otherwise, returns the current
115 DISALLOW_COPY_AND_ASSIGN(ScopedUpdate
);
117 DictionaryPrefUpdate update_
;
118 const std::string extension_id_
;
119 const std::string key_
;
121 typedef ScopedUpdate
<base::DictionaryValue
, base::Value::TYPE_DICTIONARY
>
122 ScopedDictionaryUpdate
;
123 typedef ScopedUpdate
<base::ListValue
, base::Value::TYPE_LIST
>
126 // Creates and initializes an ExtensionPrefs object.
127 // Does not take ownership of |prefs| and |extension_pref_value_map|.
128 // If |extensions_disabled| is true, extension controlled preferences and
129 // content settings do not become effective.
130 static ExtensionPrefs
* Create(
132 const base::FilePath
& root_dir
,
133 ExtensionPrefValueMap
* extension_pref_value_map
,
134 scoped_ptr
<AppSorting
> app_sorting
,
135 bool extensions_disabled
);
137 // A version of Create which allows injection of a custom base::Time provider.
138 // Use this as needed for testing.
139 static ExtensionPrefs
* Create(
141 const base::FilePath
& root_dir
,
142 ExtensionPrefValueMap
* extension_pref_value_map
,
143 scoped_ptr
<AppSorting
> app_sorting
,
144 bool extensions_disabled
,
145 scoped_ptr
<TimeProvider
> time_provider
);
147 virtual ~ExtensionPrefs();
149 // Convenience function to get the ExtensionPrefs for a BrowserContext.
150 static ExtensionPrefs
* Get(content::BrowserContext
* context
);
152 // Returns all installed extensions from extension preferences provided by
153 // |pref_service|. This is exposed for ProtectedPrefsWatcher because it needs
154 // access to the extension ID list before the ExtensionService is initialized.
155 static ExtensionIdList
GetExtensionsFrom(const PrefService
* pref_service
);
157 // Returns true if the specified external extension was uninstalled by the
159 bool IsExternalExtensionUninstalled(const std::string
& id
) const;
161 // Checks whether |extension_id| is disabled. If there's no state pref for
162 // the extension, this will return false. Generally you should use
163 // ExtensionService::IsExtensionEnabled instead.
164 bool IsExtensionDisabled(const std::string
& id
) const;
166 // Get/Set the order that the browser actions appear in the toolbar.
167 ExtensionIdList
GetToolbarOrder();
168 void SetToolbarOrder(const ExtensionIdList
& extension_ids
);
170 // Gets the set of known disabled extension IDs into |id_set_out|. Returns
171 // false iff the set of known disabled extension IDs hasn't been set yet.
172 bool GetKnownDisabled(ExtensionIdSet
* id_set_out
);
174 // Sets the set of known disabled extension IDs.
175 void SetKnownDisabled(const ExtensionIdSet
& extension_ids
);
177 // Called when an extension is installed, so that prefs get created.
178 // |blacklisted_for_malware| should be set if the extension was included in a
179 // blacklist due to being malware. If |page_ordinal| is an invalid ordinal,
180 // then a page will be found for the App.
181 void OnExtensionInstalled(const Extension
* extension
,
182 Extension::State initial_state
,
183 bool blacklisted_for_malware
,
184 const syncer::StringOrdinal
& page_ordinal
);
186 // Called when an extension is uninstalled, so that prefs get cleaned up.
187 void OnExtensionUninstalled(const std::string
& extension_id
,
188 const Manifest::Location
& location
,
189 bool external_uninstall
);
191 // Called to change the extension's state when it is enabled/disabled.
192 void SetExtensionState(const std::string
& extension_id
, Extension::State
);
194 // Called to change the extension's BlacklistState. Currently only used for
195 // non-malicious extensions.
196 // TODO(oleg): replace SetExtensionBlacklisted by this function.
197 void SetExtensionBlacklistState(const std::string
& extension_id
,
198 BlacklistState state
);
200 // Checks whether |extension_id| is marked as greylisted.
201 // TODO(oleg): Replace IsExtensionBlacklisted by this method.
202 BlacklistState
GetExtensionBlacklistState(const std::string
& extension_id
);
204 // Populates |out| with the ids of all installed extensions.
205 void GetExtensions(ExtensionIdList
* out
);
207 // ExtensionScopedPrefs methods:
208 virtual void UpdateExtensionPref(const std::string
& id
,
209 const std::string
& key
,
210 base::Value
* value
) OVERRIDE
;
212 virtual void DeleteExtensionPrefs(const std::string
& id
) OVERRIDE
;
214 virtual bool ReadPrefAsBoolean(const std::string
& extension_id
,
215 const std::string
& pref_key
,
216 bool* out_value
) const OVERRIDE
;
218 virtual bool ReadPrefAsInteger(const std::string
& extension_id
,
219 const std::string
& pref_key
,
220 int* out_value
) const OVERRIDE
;
222 virtual bool ReadPrefAsString(const std::string
& extension_id
,
223 const std::string
& pref_key
,
224 std::string
* out_value
) const OVERRIDE
;
226 virtual bool ReadPrefAsList(const std::string
& extension_id
,
227 const std::string
& pref_key
,
228 const base::ListValue
** out_value
) const OVERRIDE
;
230 virtual bool ReadPrefAsDictionary(
231 const std::string
& extension_id
,
232 const std::string
& pref_key
,
233 const base::DictionaryValue
** out_value
) const OVERRIDE
;
235 virtual bool HasPrefForExtension(const std::string
& extension_id
) const
238 // Did the extension ask to escalate its permission during an upgrade?
239 bool DidExtensionEscalatePermissions(const std::string
& id
);
241 // If |did_escalate| is true, the preferences for |extension| will be set to
242 // require the install warning when the user tries to enable.
243 void SetDidExtensionEscalatePermissions(
244 const Extension
* extension
,
247 // Getter and setters for disabled reason.
248 int GetDisableReasons(const std::string
& extension_id
) const;
249 void AddDisableReason(const std::string
& extension_id
,
250 Extension::DisableReason disable_reason
);
251 void RemoveDisableReason(const std::string
& extension_id
,
252 Extension::DisableReason disable_reason
);
253 void ClearDisableReasons(const std::string
& extension_id
);
255 // Gets the set of extensions that have been blacklisted in prefs. This will
256 // return only the blocked extensions, not the "greylist" extensions.
257 // TODO(oleg): Make method names consistent here, in extension service and in
259 std::set
<std::string
> GetBlacklistedExtensions();
261 // Sets whether the extension with |id| is blacklisted.
262 void SetExtensionBlacklisted(const std::string
& extension_id
,
263 bool is_blacklisted
);
265 // Returns the version string for the currently installed extension, or
266 // the empty string if not found.
267 std::string
GetVersionString(const std::string
& extension_id
);
269 // Re-writes the extension manifest into the prefs.
270 // Called to change the extension's manifest when it's re-localized.
271 void UpdateManifest(const Extension
* extension
);
273 // Returns extension path based on extension ID, or empty FilePath on error.
274 base::FilePath
GetExtensionPath(const std::string
& extension_id
);
276 // Returns base extensions install directory.
277 const base::FilePath
& install_directory() const { return install_directory_
; }
279 // Returns whether the extension with |id| has its blacklist bit set.
281 // WARNING: this only checks the extension's entry in prefs, so by definition
282 // can only check extensions that prefs knows about. There may be other
283 // sources of blacklist information, such as safebrowsing. You probably want
284 // to use Blacklist::GetBlacklistedIDs rather than this method.
285 bool IsExtensionBlacklisted(const std::string
& id
) const;
287 // Increment the count of how many times we prompted the user to acknowledge
288 // the given extension, and return the new count.
289 int IncrementAcknowledgePromptCount(const std::string
& extension_id
);
291 // Whether the user has acknowledged an external extension.
292 bool IsExternalExtensionAcknowledged(const std::string
& extension_id
);
293 void AcknowledgeExternalExtension(const std::string
& extension_id
);
295 // Whether the user has acknowledged a blacklisted extension.
296 bool IsBlacklistedExtensionAcknowledged(const std::string
& extension_id
);
297 void AcknowledgeBlacklistedExtension(const std::string
& extension_id
);
299 // Whether the external extension was installed during the first run
301 bool IsExternalInstallFirstRun(const std::string
& extension_id
);
302 void SetExternalInstallFirstRun(const std::string
& extension_id
);
304 // Whether the user has been notified about extension with |extension_id|
306 bool HasWipeoutBeenAcknowledged(const std::string
& extension_id
);
307 void SetWipeoutAcknowledged(const std::string
& extension_id
, bool value
);
309 // Returns true if the extension notification code has already run for the
310 // first time for this profile. Currently we use this flag to mean that any
311 // extensions that would trigger notifications should get silently
312 // acknowledged. This is a fuse. Calling it the first time returns false.
313 // Subsequent calls return true. It's not possible through an API to ever
314 // reset it. Don't call it unless you mean it!
315 bool SetAlertSystemFirstRun();
317 // Checks if extensions are blacklisted by default, by policy.
318 // The ManagementPolicy::Provider methods also take this into account, and
319 // should be used instead when the extension ID is known.
320 bool ExtensionsBlacklistedByDefault() const;
322 // Returns the last value set via SetLastPingDay. If there isn't such a
323 // pref, the returned Time will return true for is_null().
324 base::Time
LastPingDay(const std::string
& extension_id
) const;
326 // The time stored is based on the server's perspective of day start time, not
328 void SetLastPingDay(const std::string
& extension_id
, const base::Time
& time
);
330 // Similar to the 2 above, but for the extensions blacklist.
331 base::Time
BlacklistLastPingDay() const;
332 void SetBlacklistLastPingDay(const base::Time
& time
);
334 // Similar to LastPingDay/SetLastPingDay, but for sending "days since active"
336 base::Time
LastActivePingDay(const std::string
& extension_id
);
337 void SetLastActivePingDay(const std::string
& extension_id
,
338 const base::Time
& time
);
340 // A bit we use for determining if we should send the "days since active"
341 // ping. A value of true means the item has been active (launched) since the
342 // last update check.
343 bool GetActiveBit(const std::string
& extension_id
);
344 void SetActiveBit(const std::string
& extension_id
, bool active
);
346 // Returns the granted permission set for the extension with |extension_id|,
347 // and NULL if no preferences were found for |extension_id|.
348 // This passes ownership of the returned set to the caller.
349 PermissionSet
* GetGrantedPermissions(const std::string
& extension_id
);
351 // Adds |permissions| to the granted permissions set for the extension with
352 // |extension_id|. The new granted permissions set will be the union of
353 // |permissions| and the already granted permissions.
354 void AddGrantedPermissions(const std::string
& extension_id
,
355 const PermissionSet
* permissions
);
357 // As above, but subtracts the given |permissions| from the granted set.
358 void RemoveGrantedPermissions(const std::string
& extension_id
,
359 const PermissionSet
* permissions
);
361 // Gets the active permission set for the specified extension. This may
362 // differ from the permissions in the manifest due to the optional
363 // permissions API. This passes ownership of the set to the caller.
364 PermissionSet
* GetActivePermissions(const std::string
& extension_id
);
366 // Sets the active |permissions| for the extension with |extension_id|.
367 void SetActivePermissions(const std::string
& extension_id
,
368 const PermissionSet
* permissions
);
370 // Records whether or not this extension is currently running.
371 void SetExtensionRunning(const std::string
& extension_id
, bool is_running
);
373 // Returns whether or not this extension is marked as running. This is used to
374 // restart apps across browser restarts.
375 bool IsExtensionRunning(const std::string
& extension_id
);
377 // Set/Get whether or not the app is active. Used to force a launch of apps
378 // that don't handle onRestarted() on a restart. We can only safely do that if
379 // the app was active when it was last running.
380 void SetIsActive(const std::string
& extension_id
, bool is_active
);
381 bool IsActive(const std::string
& extension_id
);
383 // Returns true if the user enabled this extension to be loaded in incognito
386 // IMPORTANT: you probably want to use extension_utils::IsIncognitoEnabled
387 // instead of this method.
388 bool IsIncognitoEnabled(const std::string
& extension_id
) const;
389 void SetIsIncognitoEnabled(const std::string
& extension_id
, bool enabled
);
391 // Returns true if the user has chosen to allow this extension to inject
392 // scripts into pages with file URLs.
394 // IMPORTANT: you probably want to use extension_utils::AllowFileAccess
395 // instead of this method.
396 bool AllowFileAccess(const std::string
& extension_id
) const;
397 void SetAllowFileAccess(const std::string
& extension_id
, bool allow
);
398 bool HasAllowFileAccessSetting(const std::string
& extension_id
) const;
400 // Saves ExtensionInfo for each installed extension with the path to the
401 // version directory and the location. Blacklisted extensions won't be saved
402 // and neither will external extensions the user has explicitly uninstalled.
403 // Caller takes ownership of returned structure.
404 scoped_ptr
<ExtensionsInfo
> GetInstalledExtensionsInfo() const;
406 // Same as above, but only includes external extensions the user has
407 // explicitly uninstalled.
408 scoped_ptr
<ExtensionsInfo
> GetUninstalledExtensionsInfo() const;
410 // Returns the ExtensionInfo from the prefs for the given extension. If the
411 // extension is not present, NULL is returned.
412 scoped_ptr
<ExtensionInfo
> GetInstalledExtensionInfo(
413 const std::string
& extension_id
) const;
415 // We've downloaded an updated .crx file for the extension, but are waiting
417 void SetDelayedInstallInfo(const Extension
* extension
,
418 Extension::State initial_state
,
419 bool blacklisted_for_malware
,
420 DelayReason delay_reason
,
421 const syncer::StringOrdinal
& page_ordinal
);
423 // Removes any delayed install information we have for the given
424 // |extension_id|. Returns true if there was info to remove; false otherwise.
425 bool RemoveDelayedInstallInfo(const std::string
& extension_id
);
427 // Update the prefs to finish the update for an extension.
428 bool FinishDelayedInstallInfo(const std::string
& extension_id
);
430 // Returns the ExtensionInfo from the prefs for delayed install information
431 // for |extension_id|, if we have any. Otherwise returns NULL.
432 scoped_ptr
<ExtensionInfo
> GetDelayedInstallInfo(
433 const std::string
& extension_id
) const;
435 DelayReason
GetDelayedInstallReason(const std::string
& extension_id
) const;
437 // Returns information about all the extensions that have delayed install
439 scoped_ptr
<ExtensionsInfo
> GetAllDelayedInstallInfo() const;
441 // Returns true if the user repositioned the app on the app launcher via drag
443 bool WasAppDraggedByUser(const std::string
& extension_id
);
445 // Sets a flag indicating that the user repositioned the app on the app
446 // launcher by drag and dropping it.
447 void SetAppDraggedByUser(const std::string
& extension_id
);
449 // Returns true if there is an extension which controls the preference value
450 // for |pref_key| *and* it is specific to incognito mode.
451 bool HasIncognitoPrefValue(const std::string
& pref_key
);
453 // Returns the creation flags mask for the extension.
454 int GetCreationFlags(const std::string
& extension_id
) const;
456 // Returns the creation flags mask for a delayed install extension.
457 int GetDelayedInstallCreationFlags(const std::string
& extension_id
) const;
459 // Returns true if the extension was installed from the Chrome Web Store.
460 bool IsFromWebStore(const std::string
& extension_id
) const;
462 // Returns true if the extension was installed from an App generated from a
464 bool IsFromBookmark(const std::string
& extension_id
) const;
466 // Returns true if the extension was installed as a default app.
467 bool WasInstalledByDefault(const std::string
& extension_id
) const;
469 // Helper method to acquire the installation time of an extension.
470 // Returns base::Time() if the installation time could not be parsed or
472 base::Time
GetInstallTime(const std::string
& extension_id
) const;
474 // Gets/sets the last launch time of an extension.
475 base::Time
GetLastLaunchTime(const std::string
& extension_id
) const;
476 void SetLastLaunchTime(const std::string
& extension_id
,
477 const base::Time
& time
);
479 static void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable
* registry
);
481 bool extensions_disabled() { return extensions_disabled_
; }
483 ContentSettingsStore
* content_settings_store() {
484 return content_settings_store_
.get();
487 // The underlying PrefService.
488 PrefService
* pref_service() const { return prefs_
; }
490 // The underlying AppSorting.
491 AppSorting
* app_sorting() const { return app_sorting_
.get(); }
493 // Describes the URLs that are able to install extensions. See
494 // pref_names::kAllowedInstallSites for more information.
495 URLPatternSet
GetAllowedInstallSites();
497 // Schedules garbage collection of an extension's on-disk data on the next
498 // start of this ExtensionService. Applies only to extensions with isolated
500 void SetNeedsStorageGarbageCollection(bool value
);
501 bool NeedsStorageGarbageCollection();
503 // Used by ShellWindowGeometryCache to persist its cache. These methods
504 // should not be called directly.
505 const base::DictionaryValue
* GetGeometryCache(
506 const std::string
& extension_id
) const;
507 void SetGeometryCache(const std::string
& extension_id
,
508 scoped_ptr
<base::DictionaryValue
> cache
);
510 // Used for verification of installed extension ids. For the Set method, pass
511 // null to remove the preference.
512 const base::DictionaryValue
* GetInstallSignature();
513 void SetInstallSignature(const base::DictionaryValue
* signature
);
516 friend class ExtensionPrefsBlacklistedExtensions
; // Unit test.
517 friend class ExtensionPrefsUninstallExtension
; // Unit test.
519 // See the Create methods.
520 ExtensionPrefs(PrefService
* prefs
,
521 const base::FilePath
& root_dir
,
522 ExtensionPrefValueMap
* extension_pref_value_map
,
523 scoped_ptr
<AppSorting
> app_sorting
,
524 scoped_ptr
<TimeProvider
> time_provider
,
525 bool extensions_disabled
);
527 // Converts absolute paths in the pref to paths relative to the
528 // install_directory_.
529 void MakePathsRelative();
531 // Converts internal relative paths to be absolute. Used for export to
532 // consumers who expect full paths.
533 void MakePathsAbsolute(base::DictionaryValue
* dict
);
535 // Helper function used by GetInstalledExtensionInfo() and
536 // GetDelayedInstallInfo() to construct an ExtensionInfo from the provided
537 // |extension| dictionary.
538 scoped_ptr
<ExtensionInfo
> GetInstalledInfoHelper(
539 const std::string
& extension_id
,
540 const base::DictionaryValue
* extension
) const;
542 // Interprets the list pref, |pref_key| in |extension_id|'s preferences, as a
543 // URLPatternSet. The |valid_schemes| specify how to parse the URLPatterns.
544 bool ReadPrefAsURLPatternSet(const std::string
& extension_id
,
545 const std::string
& pref_key
,
546 URLPatternSet
* result
,
549 // Converts |new_value| to a list of strings and sets the |pref_key| pref
550 // belonging to |extension_id|.
551 void SetExtensionPrefURLPatternSet(const std::string
& extension_id
,
552 const std::string
& pref_key
,
553 const URLPatternSet
& new_value
);
555 // Read the boolean preference entry and return true if the preference exists
556 // and the preference's value is true; false otherwise.
557 bool ReadPrefAsBooleanAndReturn(const std::string
& extension_id
,
558 const std::string
& key
) const;
560 // Interprets |pref_key| in |extension_id|'s preferences as an
561 // PermissionSet, and passes ownership of the set to the caller.
562 PermissionSet
* ReadPrefAsPermissionSet(const std::string
& extension_id
,
563 const std::string
& pref_key
);
565 // Converts the |new_value| to its value and sets the |pref_key| pref
566 // belonging to |extension_id|.
567 void SetExtensionPrefPermissionSet(const std::string
& extension_id
,
568 const std::string
& pref_key
,
569 const PermissionSet
* new_value
);
571 // Returns an immutable dictionary for extension |id|'s prefs, or NULL if it
573 const base::DictionaryValue
* GetExtensionPref(const std::string
& id
) const;
575 // Fix missing preference entries in the extensions that are were introduced
576 // in a later Chrome version.
577 void FixMissingPrefs(const ExtensionIdList
& extension_ids
);
579 // Installs the persistent extension preferences into |prefs_|'s extension
580 // pref store. Does nothing if extensions_disabled_ is true.
581 void InitPrefStore();
583 // Migrates the permissions data in the pref store.
584 void MigratePermissions(const ExtensionIdList
& extension_ids
);
586 // Migrates the disable reasons from a single enum to a bit mask.
587 void MigrateDisableReasons(const ExtensionIdList
& extension_ids
);
589 // Checks whether there is a state pref for the extension and if so, whether
590 // it matches |check_state|.
591 bool DoesExtensionHaveState(const std::string
& id
,
592 Extension::State check_state
) const;
594 // Reads the list of strings for |pref| from user prefs into
595 // |id_container_out|. Returns false if the pref wasn't found in the user
597 template <class ExtensionIdContainer
>
598 bool GetUserExtensionPrefIntoContainer(
600 ExtensionIdContainer
* id_container_out
);
602 // Writes the list of strings contained in |strings| to |pref| in prefs.
603 template <class ExtensionIdContainer
>
604 void SetExtensionPrefFromContainer(const char* pref
,
605 const ExtensionIdContainer
& strings
);
607 // Helper function to populate |extension_dict| with the values needed
608 // by a newly installed extension. Work is broken up between this
609 // function and FinishExtensionInfoPrefs() to accomodate delayed
611 void PopulateExtensionInfoPrefs(const Extension
* extension
,
612 const base::Time install_time
,
613 Extension::State initial_state
,
614 bool blacklisted_for_malware
,
615 base::DictionaryValue
* extension_dict
);
617 // Helper function to complete initialization of the values in
618 // |extension_dict| for an extension install. Also see
619 // PopulateExtensionInfoPrefs().
620 void FinishExtensionInfoPrefs(
621 const std::string
& extension_id
,
622 const base::Time install_time
,
623 bool needs_sort_ordinal
,
624 const syncer::StringOrdinal
& suggested_page_ordinal
,
625 base::DictionaryValue
* extension_dict
);
627 // The pref service specific to this set of extension prefs. Owned by the
631 // Base extensions install directory.
632 base::FilePath install_directory_
;
634 // Weak pointer, owned by BrowserContext.
635 ExtensionPrefValueMap
* extension_pref_value_map_
;
637 // Contains all the logic for handling the order for various extension
639 scoped_ptr
<AppSorting
> app_sorting_
;
641 scoped_refptr
<ContentSettingsStore
> content_settings_store_
;
643 scoped_ptr
<TimeProvider
> time_provider_
;
645 bool extensions_disabled_
;
647 DISALLOW_COPY_AND_ASSIGN(ExtensionPrefs
);
650 } // namespace extensions
652 #endif // EXTENSIONS_BROWSER_EXTENSION_PREFS_H_