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

Unified Diff: chrome/browser/extensions/pending_enables.h

Issue 1240573012: Extension syncing: Introduce a NeedsSync pref (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@ext_sync_uninstall
Patch Set: more cleanup; fix test 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: chrome/browser/extensions/pending_enables.h
diff --git a/chrome/browser/extensions/pending_enables.h b/chrome/browser/extensions/pending_enables.h
deleted file mode 100644
index c8e59b87f57dbb1092878f7a7b35898131fcf0f7..0000000000000000000000000000000000000000
--- a/chrome/browser/extensions/pending_enables.h
+++ /dev/null
@@ -1,66 +0,0 @@
-// Copyright 2013 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef CHROME_BROWSER_EXTENSIONS_PENDING_ENABLES_H_
-#define CHROME_BROWSER_EXTENSIONS_PENDING_ENABLES_H_
-
-#include <set>
-
-// Included for syncer::ModelType, which is in
-// sync/internal_api/public/base/model_type.h but that is disallowed by
-// chrome/browser/DEPS.
-#include "sync/api/syncable_service.h"
-
-class ExtensionService;
-class ProfileSyncService;
-
-namespace sync_driver {
-class SyncPrefs;
-}
-
-namespace extensions {
-
-class SyncBundle;
-
-// A pending enable is when an app or extension is enabled locally before sync
-// has started. We track these to prevent sync data arriving and clobbering
-// local state, and also to ensure that these early enables get synced to the
-// server when sync does start.
-class PendingEnables {
- public:
- PendingEnables(scoped_ptr<sync_driver::SyncPrefs> sync_prefs,
- SyncBundle* sync_bundle,
- syncer::ModelType enable_type);
- ~PendingEnables();
-
- // Called when an extension is enabled / disabled locally.
- // These will check the sync state and figure out whether the change
- // needs to be remembered for syncing when syncing starts.
- void Add(const std::string& extension_id);
- void Remove(const std::string& extension_id);
-
- // Called when |sync_bundle_| is ready to accept sync changes.
- // Uses |service| to look up extensions from extension ids.
- void OnSyncStarted(ExtensionService* service);
-
- // Whether |extension_id| has a pending enable.
- bool Contains(const std::string& extension_id) const;
-
- private:
- bool IsSyncEnabled();
- bool IsWaitingForSync();
-
- scoped_ptr<sync_driver::SyncPrefs> sync_prefs_;
- SyncBundle* sync_bundle_;
- syncer::ModelType enable_type_;
- std::set<std::string> ids_;
-
- bool is_sync_enabled_for_test_;
-
- DISALLOW_COPY_AND_ASSIGN(PendingEnables);
-};
-
-} // namespace extensions
-
-#endif // CHROME_BROWSER_EXTENSIONS_PENDING_ENABLES_H_

Powered by Google App Engine
This is Rietveld 408576698