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

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

Issue 567037: Initial work on making extensions work in incognito mode. (Closed)
Patch Set: added experimental requirement Created 10 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
« no previous file with comments | « chrome/browser/extensions/extension_prefs.h ('k') | chrome/browser/extensions/extension_toolbar_model.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/extensions/extension_prefs.cc
diff --git a/chrome/browser/extensions/extension_prefs.cc b/chrome/browser/extensions/extension_prefs.cc
index 6d92ad2a7eab1c25473fc406dcd561d83dbc45b5..3aeda241cc95acce0a7e56c8acdfdde850aea718 100644
--- a/chrome/browser/extensions/extension_prefs.cc
+++ b/chrome/browser/extensions/extension_prefs.cc
@@ -49,6 +49,10 @@ const wchar_t kExtensionToolbar[] = L"extensions.toolbar";
// server's perspective) an extension last included a "ping" parameter during
// its update check.
const wchar_t kLastPingDay[] = L"lastpingday";
+
+// A preference that, if true, will allow this extension to run in incognito
+// mode.
+const wchar_t kPrefIncognitoEnabled[] = L"incognito";
}
////////////////////////////////////////////////////////////////////////////////
@@ -257,6 +261,16 @@ void ExtensionPrefs::SetLastPingDay(const std::string& extension_id,
prefs_->ScheduleSavePersistentPrefs();
}
+bool ExtensionPrefs::IsIncognitoEnabled(const std::string& extension_id) {
+ return ReadExtensionPrefBoolean(extension_id, kPrefIncognitoEnabled);
+}
+
+void ExtensionPrefs::SetIsIncognitoEnabled(const std::string& extension_id,
+ bool enabled) {
+ UpdateExtensionPref(extension_id, kPrefIncognitoEnabled,
+ Value::CreateBooleanValue(enabled));
+ prefs_->SavePersistentPrefs();
+}
void ExtensionPrefs::GetKilledExtensionIds(std::set<std::string>* killed_ids) {
const DictionaryValue* dict = prefs_->GetDictionary(kExtensionsPref);
« no previous file with comments | « chrome/browser/extensions/extension_prefs.h ('k') | chrome/browser/extensions/extension_toolbar_model.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698