Index: extensions/browser/extension_prefs.cc |
diff --git a/extensions/browser/extension_prefs.cc b/extensions/browser/extension_prefs.cc |
index 79bd5472555310e8566fd98aa23074017c5ee2bd..58ccad71e6c0e4fd030571804bc5a99f79d80d5c 100644 |
--- a/extensions/browser/extension_prefs.cc |
+++ b/extensions/browser/extension_prefs.cc |
@@ -192,6 +192,10 @@ const char kPrefDoNotSync[] = "do_not_sync"; |
const char kCorruptedDisableCount[] = "extensions.corrupted_disable_count"; |
+// A boolean preference that indicates whether the extension has local changes |
+// that need to be synced. Default value is false. |
+const char kPrefNeedsSync[] = "needs_sync"; |
+ |
// Provider of write access to a dictionary storing extension prefs. |
class ScopedExtensionPrefUpdate : public DictionaryPrefUpdate { |
public: |
@@ -1852,6 +1856,16 @@ void ExtensionPrefs::IncrementCorruptedDisableCount() { |
prefs_->SetInteger(kCorruptedDisableCount, count + 1); |
} |
+bool ExtensionPrefs::NeedsSync(const std::string& extension_id) const { |
+ return ReadPrefAsBooleanAndReturn(extension_id, kPrefNeedsSync); |
+} |
+ |
+void ExtensionPrefs::SetNeedsSync(const std::string& extension_id, |
+ bool needs_sync) { |
+ UpdateExtensionPref(extension_id, kPrefNeedsSync, |
+ needs_sync ? new base::FundamentalValue(true) : nullptr); |
+} |
+ |
ExtensionPrefs::ExtensionPrefs( |
PrefService* prefs, |
const base::FilePath& root_dir, |