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

Unified Diff: extensions/browser/extension_pref_value_map.h

Issue 184043024: Limit scope of settings API configuration and proxy permission (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Addressed Bernhard's comment Created 6 years, 10 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: extensions/browser/extension_pref_value_map.h
diff --git a/extensions/browser/extension_pref_value_map.h b/extensions/browser/extension_pref_value_map.h
index 48f30d99186824e009af1fb7abbae115c9ee1866..c0e48cce10c001b03b6bacb99fa22cd6561f494f 100644
--- a/extensions/browser/extension_pref_value_map.h
+++ b/extensions/browser/extension_pref_value_map.h
@@ -95,8 +95,9 @@ class ExtensionPrefValueMap : public BrowserContextKeyedService {
extensions::ExtensionPrefsScope scope);
// Returns true if currently no extension with higher precedence controls the
- // preference.
- // Note that the this function does does not consider the existence of
+ // preference. If |incognito| is true and the extension does not have
+ // incognito permission, CanExtensionControlPref returns false.
+ // Note that this function does does not consider the existence of
// policies. An extension is only really able to control a preference if
// PrefService::Preference::IsExtensionModifiable() returns true as well.
bool CanExtensionControlPref(const std::string& extension_id,
@@ -119,7 +120,8 @@ class ExtensionPrefValueMap : public BrowserContextKeyedService {
const std::string& pref_key,
bool* from_incognito) const;
- // Returns the ID of the extension that currently controls this preference.
+ // Returns the ID of the extension that currently controls this preference
+ // for a regular profile. Incognito settings are ignored.
// Returns an empty string if this preference is not controlled by an
// extension.
std::string GetExtensionControllingPref(const std::string& pref_key) const;
@@ -130,7 +132,8 @@ class ExtensionPrefValueMap : public BrowserContextKeyedService {
// Registers the time when an extension |ext_id| is installed.
void RegisterExtension(const std::string& ext_id,
const base::Time& install_time,
- bool is_enabled);
+ bool is_enabled,
+ bool is_incognito_enabled);
// Deletes all entries related to extension |ext_id|.
void UnregisterExtension(const std::string& ext_id);
@@ -139,6 +142,10 @@ class ExtensionPrefValueMap : public BrowserContextKeyedService {
// visible.
void SetExtensionState(const std::string& ext_id, bool is_enabled);
+ // Sets whether the extension has permission to access incognito state.
+ void SetExtensionIncognitoState(const std::string& ext_id,
+ bool is_incognito_enabled);
+
// Adds an observer and notifies it about the currently stored keys.
void AddObserver(Observer* observer);

Powered by Google App Engine
This is Rietveld 408576698