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

Unified Diff: extensions/browser/extension_prefs.cc

Issue 308003005: app_list: Drive app integration. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: add a is_sycable prop and use it instead of installed_by_default Created 6 years, 6 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: extensions/browser/extension_prefs.cc
diff --git a/extensions/browser/extension_prefs.cc b/extensions/browser/extension_prefs.cc
index 665d3643e97aac1e46971c35c310648bd4a0e16f..8b1168c0716286d641ca72dcc6859cb2dac62bcc 100644
--- a/extensions/browser/extension_prefs.cc
+++ b/extensions/browser/extension_prefs.cc
@@ -203,6 +203,10 @@ const char kPrefNextStorageThreshold[] = "next_storage_threshold";
// extension or app consumes excessive disk space.
const char kPrefDisableStorageNotifications[] = "disable_storage_notifications";
+// A boolean preference that indicates whether the extension is allowed to be
+// synced. Default is true.
not at google - send to devlin 2014/06/06 01:26:29 pet peeve is optional boolean values whose default
Yoyo Zhou 2014/06/06 01:39:27 You mean this const char? It's fine to go here if
xiyuan 2014/06/06 04:12:37 Changed the pref to "do_not_sync".
+const char kPrefIsSyncable[] = "is_syncable";
+
// Provider of write access to a dictionary storing extension prefs.
class ScopedExtensionPrefUpdate : public DictionaryPrefUpdate {
public:
@@ -1743,6 +1747,14 @@ base::Time ExtensionPrefs::GetInstallTime(
return base::Time::FromInternalValue(install_time_i64);
}
+bool ExtensionPrefs::IsSyncable(const std::string& extension_id) const {
+ bool is_syncable;
+ if (!ReadPrefAsBoolean(extension_id, kPrefIsSyncable, &is_syncable))
+ return true;
+
+ return is_syncable;
+}
+
base::Time ExtensionPrefs::GetLastLaunchTime(
const std::string& extension_id) const {
const base::DictionaryValue* extension = GetExtensionPref(extension_id);
@@ -2165,6 +2177,9 @@ void ExtensionPrefs::PopulateExtensionInfoPrefs(
extension_dict->Set(kPrefManifest,
extension->manifest()->value()->DeepCopy());
}
+
+ extension_dict->Set(kPrefIsSyncable,
+ new base::FundamentalValue(extension->is_syncable()));
not at google - send to devlin 2014/06/06 01:26:29 only set it if its value is non-default
xiyuan 2014/06/06 04:12:37 Done.
}
void ExtensionPrefs::InitExtensionControlledPrefs(

Powered by Google App Engine
This is Rietveld 408576698