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( |