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

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: pref is_syancable -> do_not_sync, remove AppListModel deps and no auto uninstall new_app 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..37767b87510c3c19cae6e879c7759dde856d29fe 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 should not be
+// synced. Default value is false.
+const char kPrefDoNotSync[] = "do_not_sync";
+
// 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 {
not at google - send to devlin 2014/06/06 19:37:16 i'd mildly prefer this to reflect the actual prefe
xiyuan 2014/06/09 20:59:59 Done.
+ bool do_not_sync;
+ if (!ReadPrefAsBoolean(extension_id, kPrefDoNotSync, &do_not_sync))
+ return true;
+
+ return !do_not_sync;
+}
+
base::Time ExtensionPrefs::GetLastLaunchTime(
const std::string& extension_id) const {
const base::DictionaryValue* extension = GetExtensionPref(extension_id);
@@ -2165,6 +2177,10 @@ void ExtensionPrefs::PopulateExtensionInfoPrefs(
extension_dict->Set(kPrefManifest,
extension->manifest()->value()->DeepCopy());
}
+
+ // Only writes kPrefDoNotSync when it is not the default.
+ if (!extension->is_syncable())
+ extension_dict->Set(kPrefDoNotSync, new base::FundamentalValue(true));
}
void ExtensionPrefs::InitExtensionControlledPrefs(

Powered by Google App Engine
This is Rietveld 408576698