Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(118)

Unified Diff: chrome/browser/extensions/extension_prefs.h

Issue 10704023: Moved ExtensionPrefs and related into extensions namespace (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Latest-er master merged in Created 8 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/extensions/extension_prefs.h
diff --git a/chrome/browser/extensions/extension_prefs.h b/chrome/browser/extensions/extension_prefs.h
index bea4b2b0a4b7623d38ac3cf3fa5103556782bb74..b4e5fdb830fc4626b0fe98b98985827c8747a026 100644
--- a/chrome/browser/extensions/extension_prefs.h
+++ b/chrome/browser/extensions/extension_prefs.h
@@ -27,8 +27,8 @@ class PrefService;
class URLPatternSet;
namespace extensions {
+class ExtensionPrefsUninstallExtension;
struct ExtensionOmniboxSuggestion;
-}
// Class for managing global and per-extension preferences.
//
@@ -45,8 +45,8 @@ struct ExtensionOmniboxSuggestion;
// preference. Extension-controlled preferences are stored in
// PrefValueStore::extension_prefs(), which this class populates and
// maintains as the underlying extensions change.
-class ExtensionPrefs : public extensions::ContentSettingsStore::Observer,
- public extensions::ManagementPolicy::Provider,
+class ExtensionPrefs : public ContentSettingsStore::Observer,
+ public ManagementPolicy::Provider,
public ExtensionScopedPrefs {
public:
// Key name for a preference that keeps track of per-extension settings. This
@@ -54,7 +54,7 @@ class ExtensionPrefs : public extensions::ContentSettingsStore::Observer,
// extension ids.
static const char kExtensionsPref[];
- typedef std::vector<linked_ptr<extensions::ExtensionInfo> > ExtensionsInfo;
+ typedef std::vector<linked_ptr<ExtensionInfo> > ExtensionsInfo;
// Vector containing identifiers for preferences.
typedef std::set<std::string> PrefKeySet;
@@ -112,19 +112,18 @@ class ExtensionPrefs : public extensions::ContentSettingsStore::Observer,
// Called when an extension is installed, so that prefs get created.
// If |page_ordinal| is an invalid ordinal, then a page will be found
// for the App.
- void OnExtensionInstalled(const extensions::Extension* extension,
- extensions::Extension::State initial_state,
+ void OnExtensionInstalled(const Extension* extension,
+ Extension::State initial_state,
bool from_webstore,
const StringOrdinal& page_ordinal);
// Called when an extension is uninstalled, so that prefs get cleaned up.
void OnExtensionUninstalled(const std::string& extension_id,
- const extensions::Extension::Location& location,
+ const Extension::Location& location,
bool external_uninstall);
// Called to change the extension's state when it is enabled/disabled.
- void SetExtensionState(const std::string& extension_id,
- extensions::Extension::State);
+ void SetExtensionState(const std::string& extension_id, Extension::State);
// Returns all installed extensions
void GetExtensions(ExtensionIdSet* out);
@@ -136,8 +135,8 @@ class ExtensionPrefs : public extensions::ContentSettingsStore::Observer,
const base::DictionaryValue* extension_prefs);
// Getter and setter for browser action visibility.
- bool GetBrowserActionVisibility(const extensions::Extension* extension);
- void SetBrowserActionVisibility(const extensions::Extension* extension,
+ bool GetBrowserActionVisibility(const Extension* extension);
+ void SetBrowserActionVisibility(const Extension* extension,
bool visible);
// Did the extension ask to escalate its permission during an upgrade?
@@ -146,14 +145,14 @@ class ExtensionPrefs : public extensions::ContentSettingsStore::Observer,
// If |did_escalate| is true, the preferences for |extension| will be set to
// require the install warning when the user tries to enable.
void SetDidExtensionEscalatePermissions(
- const extensions::Extension* extension,
+ const Extension* extension,
bool did_escalate);
// Getter and setters for disabled reason.
- extensions::Extension::DisableReason GetDisableReason(
+ Extension::DisableReason GetDisableReason(
const std::string& extension_id);
void SetDisableReason(const std::string& extension_id,
- extensions::Extension::DisableReason disable_reason);
+ Extension::DisableReason disable_reason);
void RemoveDisableReason(const std::string& extension_id);
// Returns the version string for the currently installed extension, or
@@ -162,7 +161,7 @@ class ExtensionPrefs : public extensions::ContentSettingsStore::Observer,
// Re-writes the extension manifest into the prefs.
// Called to change the extension's manifest when it's re-localized.
- void UpdateManifest(const extensions::Extension* extension);
+ void UpdateManifest(const Extension* extension);
// Returns extension path based on extension ID, or empty FilePath on error.
FilePath GetExtensionPath(const std::string& extension_id);
@@ -211,11 +210,11 @@ class ExtensionPrefs : public extensions::ContentSettingsStore::Observer,
// ManagementPolicy::Provider
// These methods apply admin policy to extensions.
virtual std::string GetDebugPolicyProviderName() const OVERRIDE;
- virtual bool UserMayLoad(const extensions::Extension* extension,
+ virtual bool UserMayLoad(const Extension* extension,
string16* error) const OVERRIDE;
- virtual bool UserMayModifySettings(const extensions::Extension* extension,
+ virtual bool UserMayModifySettings(const Extension* extension,
string16* error) const OVERRIDE;
- virtual bool MustRemainEnabled(const extensions::Extension* extension,
+ virtual bool MustRemainEnabled(const Extension* extension,
string16* error) const OVERRIDE;
// Checks if extensions are blacklisted by default, by policy.
@@ -250,28 +249,26 @@ class ExtensionPrefs : public extensions::ContentSettingsStore::Observer,
// Returns the granted permission set for the extension with |extension_id|,
// and NULL if no preferences were found for |extension_id|.
// This passes ownership of the returned set to the caller.
- extensions::PermissionSet* GetGrantedPermissions(
- const std::string& extension_id);
+ PermissionSet* GetGrantedPermissions(const std::string& extension_id);
// Adds |permissions| to the granted permissions set for the extension with
// |extension_id|. The new granted permissions set will be the union of
// |permissions| and the already granted permissions.
void AddGrantedPermissions(const std::string& extension_id,
- const extensions::PermissionSet* permissions);
+ const PermissionSet* permissions);
// As above, but subtracts the given |permissions| from the granted set.
void RemoveGrantedPermissions(const std::string& extension_id,
- const extensions::PermissionSet* permissions);
+ const PermissionSet* permissions);
// Gets the active permission set for the specified extension. This may
// differ from the permissions in the manifest due to the optional
// permissions API. This passes ownership of the set to the caller.
- extensions::PermissionSet* GetActivePermissions(
- const std::string& extension_id);
+ PermissionSet* GetActivePermissions(const std::string& extension_id);
// Sets the active |permissions| for the extension with |extension_id|.
void SetActivePermissions(const std::string& extension_id,
- const extensions::PermissionSet* permissions);
+ const PermissionSet* permissions);
// Returns the list of events that the given extension has registered for.
std::set<std::string> GetRegisteredEvents(const std::string& extension_id);
@@ -294,11 +291,11 @@ class ExtensionPrefs : public extensions::ContentSettingsStore::Observer,
const std::string& extension_id) const;
// Controls the omnibox default suggestion as set by the extension.
- extensions::ExtensionOmniboxSuggestion GetOmniboxDefaultSuggestion(
+ ExtensionOmniboxSuggestion GetOmniboxDefaultSuggestion(
const std::string& extension_id);
void SetOmniboxDefaultSuggestion(
const std::string& extension_id,
- const extensions::ExtensionOmniboxSuggestion& suggestion);
+ const ExtensionOmniboxSuggestion& suggestion);
// Returns true if the user enabled this extension to be loaded in incognito
// mode.
@@ -322,7 +319,7 @@ class ExtensionPrefs : public extensions::ContentSettingsStore::Observer,
// If |extension|'s prefs do not have a launch type set, then
// use |default_pref_value|.
extension_misc::LaunchContainer GetLaunchContainer(
- const extensions::Extension* extension,
+ const Extension* extension,
LaunchType default_pref_value);
// Saves ExtensionInfo for each installed extension with the path to the
@@ -333,8 +330,7 @@ class ExtensionPrefs : public extensions::ContentSettingsStore::Observer,
// Returns the ExtensionInfo from the prefs for the given extension. If the
// extension is not present, NULL is returned.
- extensions::ExtensionInfo* GetInstalledExtensionInfo(
- const std::string& extension_id);
+ ExtensionInfo* GetInstalledExtensionInfo(const std::string& extension_id);
// We've downloaded an updated .crx file for the extension, but are waiting
// for idle time to install it.
@@ -429,7 +425,7 @@ class ExtensionPrefs : public extensions::ContentSettingsStore::Observer,
static void RegisterUserPrefs(PrefService* prefs);
- extensions::ContentSettingsStore* content_settings_store() {
+ ContentSettingsStore* content_settings_store() {
return content_settings_store_.get();
}
@@ -454,9 +450,8 @@ class ExtensionPrefs : public extensions::ContentSettingsStore::Observer,
friend class ExtensionPrefsUninstallExtension; // Unit test.
// extensions::ContentSettingsStore::Observer methods:
- virtual void OnContentSettingChanged(
- const std::string& extension_id,
- bool incognito) OVERRIDE;
+ virtual void OnContentSettingChanged(const std::string& extension_id,
+ bool incognito) OVERRIDE;
// ExtensionScopedPrefs methods:
virtual void UpdateExtensionPref(const std::string& id,
@@ -511,16 +506,14 @@ class ExtensionPrefs : public extensions::ContentSettingsStore::Observer,
// Interprets |pref_key| in |extension_id|'s preferences as an
// PermissionSet, and passes ownership of the set to the caller.
- extensions::PermissionSet* ReadExtensionPrefPermissionSet(
- const std::string& extension_id,
- const std::string& pref_key);
+ PermissionSet* ReadExtensionPrefPermissionSet(const std::string& extension_id,
+ const std::string& pref_key);
// Converts the |new_value| to its value and sets the |pref_key| pref
// belonging to |extension_id|.
- void SetExtensionPrefPermissionSet(
- const std::string& extension_id,
- const std::string& pref_key,
- const extensions::PermissionSet* new_value);
+ void SetExtensionPrefPermissionSet(const std::string& extension_id,
+ const std::string& pref_key,
+ const PermissionSet* new_value);
// Returns a dictionary for extension |id|'s prefs or NULL if it doesn't
// exist.
@@ -550,7 +543,7 @@ class ExtensionPrefs : public extensions::ContentSettingsStore::Observer,
// Checks whether there is a state pref for the extension and if so, whether
// it matches |check_state|.
bool DoesExtensionHaveState(const std::string& id,
- extensions::Extension::State check_state) const;
+ Extension::State check_state) const;
// The pref service specific to this set of extension prefs. Owned by profile.
PrefService* prefs_;
@@ -565,9 +558,11 @@ class ExtensionPrefs : public extensions::ContentSettingsStore::Observer,
// properties.
scoped_ptr<ExtensionSorting> extension_sorting_;
- scoped_refptr<extensions::ContentSettingsStore> content_settings_store_;
+ scoped_refptr<ContentSettingsStore> content_settings_store_;
DISALLOW_COPY_AND_ASSIGN(ExtensionPrefs);
};
+} // namespace extensions
+
#endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_PREFS_H_
« no previous file with comments | « chrome/browser/extensions/extension_preference_helpers.cc ('k') | chrome/browser/extensions/extension_prefs.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698