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

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

Issue 10855190: Disable sync for default apps (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: comments Created 8 years, 4 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_prefs_unittest.cc » ('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 aa0527728322ccb25148440cf53f4b683f21ce25..a8560f1d395237e036a008f1673da198b5764400 100644
--- a/chrome/browser/extensions/extension_prefs.cc
+++ b/chrome/browser/extensions/extension_prefs.cc
@@ -166,6 +166,10 @@ 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
+// default apps.
+const char kPrefWasInstalledByDefault[] = "was_installed_by_default";
+
// A preference that contains any extension-controlled preferences.
const char kPrefPreferences[] = "preferences";
@@ -1409,6 +1413,8 @@ void ExtensionPrefs::OnExtensionInstalled(
Value::CreateBooleanValue(from_webstore));
extension_dict->Set(kPrefFromBookmark,
Value::CreateBooleanValue(extension->from_bookmark()));
+ extension_dict->Set(kPrefWasInstalledByDefault,
+ Value::CreateBooleanValue(extension->was_installed_by_default()));
extension_dict->Set(kPrefInstallTime,
Value::CreateStringValue(
base::Int64ToString(install_time.ToInternalValue())));
@@ -1818,6 +1824,16 @@ bool ExtensionPrefs::IsFromBookmark(
return false;
}
+bool ExtensionPrefs::WasInstalledByDefault(
+ const std::string& extension_id) const {
+ const DictionaryValue* dictionary = GetExtensionPref(extension_id);
+ bool result = false;
+ if (dictionary &&
+ dictionary->GetBoolean(kPrefWasInstalledByDefault, &result))
+ return result;
+ return false;
+}
+
base::Time ExtensionPrefs::GetInstallTime(
const std::string& extension_id) const {
const DictionaryValue* extension = GetExtensionPref(extension_id);
« no previous file with comments | « chrome/browser/extensions/extension_prefs.h ('k') | chrome/browser/extensions/extension_prefs_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698