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

Unified Diff: extensions/browser/extension_prefs.cc

Issue 1240573012: Extension syncing: Introduce a NeedsSync pref (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@ext_sync_uninstall
Patch Set: (b); hackfix sync_integration_tests Created 5 years, 5 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 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,
« chrome/browser/extensions/extension_sync_service.cc ('K') | « extensions/browser/extension_prefs.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698