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); |