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

Unified Diff: chrome/browser/extensions/extension_preference_api.cc

Issue 6990054: Disable setting incognito prefs for extensions for now. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: 'Effective' is gone Created 9 years, 7 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_preference_api.cc
diff --git a/chrome/browser/extensions/extension_preference_api.cc b/chrome/browser/extensions/extension_preference_api.cc
index 48b40e6df6725ca87a3aa417759719ee3a2825e2..a45e5b691feafd4252651d79912d71f3ebf5a634 100644
--- a/chrome/browser/extensions/extension_preference_api.cc
+++ b/chrome/browser/extensions/extension_preference_api.cc
@@ -38,7 +38,8 @@ const char kIncognitoSpecific[] = "incognitoSpecific";
const char kLevelOfControl[] = "levelOfControl";
const char kValue[] = "value";
-const char kOnPrefChangeFormat[] = "experimental.preferences.%s.onChange";
+const char kOnPrefChangeFormat[] =
+ "experimental.preferences.%s.onChange";
const char kIncognitoErrorMessage[] =
"You do not have permission to access incognito preferences.";
@@ -346,8 +347,10 @@ bool SetPreferenceFunction::RunImpl() {
EXTENSION_FUNCTION_VALIDATE(details->Get(kValue, &value));
bool incognito = false;
- if (details->HasKey(kIncognito))
- EXTENSION_FUNCTION_VALIDATE(details->GetBoolean(kIncognito, &incognito));
+
+ // TODO(battre): enable incognito preferences again.
+ // if (details->HasKey(kIncognito))
+ // EXTENSION_FUNCTION_VALIDATE(details->GetBoolean(kIncognito, &incognito));
if (incognito && !include_incognito()) {
error_ = kIncognitoErrorMessage;
@@ -395,8 +398,10 @@ bool ClearPreferenceFunction::RunImpl() {
EXTENSION_FUNCTION_VALIDATE(args_->GetDictionary(1, &details));
bool incognito = false;
- if (details->HasKey(kIncognito))
- EXTENSION_FUNCTION_VALIDATE(details->GetBoolean(kIncognito, &incognito));
+
+ // TODO(battre): enable incognito preferences again.
+ // if (details->HasKey(kIncognito))
+ // EXTENSION_FUNCTION_VALIDATE(details->GetBoolean(kIncognito, &incognito));
// We don't check incognito permissions here, as an extension should be always
// allowed to clear its own settings.

Powered by Google App Engine
This is Rietveld 408576698