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

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

Issue 14990002: Make sure keybindings removed don't come back during extension update. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Remove command handler Created 7 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_prefs.cc
diff --git a/chrome/browser/extensions/extension_prefs.cc b/chrome/browser/extensions/extension_prefs.cc
index 5748c7b57dc6be96a4fd908031c1afba864c5873..69a26d4b3a605e6066c98544d6687104a0ca5750 100644
--- a/chrome/browser/extensions/extension_prefs.cc
+++ b/chrome/browser/extensions/extension_prefs.cc
@@ -184,10 +184,14 @@ const char kPrefFromWebStore[] = "from_webstore";
// mock App created from a bookmark.
const char kPrefFromBookmark[] = "from_bookmark";
-// A prefrence that indicates whethere the extension was installed as
+// A preference that indicates whether the extension was installed as
// default apps.
const char kPrefWasInstalledByDefault[] = "was_installed_by_default";
+// A preference that indicates that the initial keybindings for the given
+// extension have been set.
+const char kInitialBindingsHaveBeenAssigned[] = "initial_keybindings_set";
+
// A preference that contains any extension-controlled preferences.
const char kPrefPreferences[] = "preferences";
@@ -1764,6 +1768,22 @@ bool ExtensionPrefs::WasInstalledByDefault(
return false;
}
+void ExtensionPrefs::SetInitialBindingsHaveBeenAssigned(
+ const std::string& extension_id) {
+ UpdateExtensionPref(extension_id, kInitialBindingsHaveBeenAssigned,
+ Value::CreateBooleanValue(true));
+}
+
+bool ExtensionPrefs::InitialBindingsHaveBeenAssigned(
+ const std::string& extension_id) const {
+ const DictionaryValue* dictionary = GetExtensionPref(extension_id);
+ bool result = false;
+ if (dictionary &&
+ dictionary->GetBoolean(kInitialBindingsHaveBeenAssigned, &result))
+ return result;
+ return false;
+}
+
base::Time ExtensionPrefs::GetInstallTime(
const std::string& extension_id) const {
const DictionaryValue* extension = GetExtensionPref(extension_id);

Powered by Google App Engine
This is Rietveld 408576698