Chromium Code Reviews| Index: extensions/browser/extension_prefs.cc |
| diff --git a/extensions/browser/extension_prefs.cc b/extensions/browser/extension_prefs.cc |
| index 6741c62daaf978fcc7b28844eb881888ed73567d..e7119afe622c418de348ca96fb7ac8481f5f095d 100644 |
| --- a/extensions/browser/extension_prefs.cc |
| +++ b/extensions/browser/extension_prefs.cc |
| @@ -196,6 +196,10 @@ const char kPrefInstallParam[] = "install_parameter"; |
| // A list of installed ids and a signature. |
| const char kInstallSignature[] = "extensions.install_signature"; |
| +// 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: |
| @@ -1745,6 +1749,14 @@ base::Time ExtensionPrefs::GetInstallTime( |
| return base::Time::FromInternalValue(install_time_i64); |
| } |
| +bool ExtensionPrefs::DoNotSync(const std::string& extension_id) const { |
| + bool do_not_sync; |
| + if (!ReadPrefAsBoolean(extension_id, kPrefDoNotSync, &do_not_sync)) |
| + return false; |
| + |
| + return do_not_sync; |
| +} |
| + |
| base::Time ExtensionPrefs::GetLastLaunchTime( |
| const std::string& extension_id) const { |
| const base::DictionaryValue* extension = GetExtensionPref(extension_id); |
| @@ -2130,6 +2142,10 @@ void ExtensionPrefs::PopulateExtensionInfoPrefs( |
| extension_dict->Set(kPrefManifest, |
| extension->manifest()->value()->DeepCopy()); |
| } |
| + |
| + // Only writes kPrefDoNotSync when it is not the default. |
| + if (install_flags & kInstallFlagDoNotSync) |
| + extension_dict->Set(kPrefDoNotSync, new base::FundamentalValue(true)); |
|
not at google - send to devlin
2014/06/13 20:01:22
I think you need an else extension_dict->Remove(kP
xiyuan
2014/06/13 20:35:42
Done.
Yes, it's called for update as well. And f
|
| } |
| void ExtensionPrefs::InitExtensionControlledPrefs( |