Chromium Code Reviews| 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( |