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

Side by Side Diff: chrome/browser/extensions/pending_enables.cc

Issue 195873020: [Sync] Move SyncPrefs into sync_driver component (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rerererebase Created 6 years, 9 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/browser/extensions/pending_enables.h ('k') | chrome/browser/prefs/browser_prefs.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/extensions/pending_enables.h" 5 #include "chrome/browser/extensions/pending_enables.h"
6 6
7 #include "chrome/browser/extensions/extension_service.h" 7 #include "chrome/browser/extensions/extension_service.h"
8 #include "chrome/browser/extensions/sync_bundle.h" 8 #include "chrome/browser/extensions/sync_bundle.h"
9 #include "chrome/browser/sync/sync_prefs.h" 9 #include "components/sync_driver/sync_prefs.h"
10 10
11 namespace extensions { 11 namespace extensions {
12 12
13 PendingEnables::PendingEnables(scoped_ptr<browser_sync::SyncPrefs> sync_prefs, 13 PendingEnables::PendingEnables(scoped_ptr<sync_driver::SyncPrefs> sync_prefs,
14 SyncBundle* sync_bundle, 14 SyncBundle* sync_bundle,
15 syncer::ModelType enable_type) 15 syncer::ModelType enable_type)
16 : sync_prefs_(sync_prefs.Pass()), 16 : sync_prefs_(sync_prefs.Pass()),
17 sync_bundle_(sync_bundle), 17 sync_bundle_(sync_bundle),
18 enable_type_(enable_type), 18 enable_type_(enable_type),
19 is_sync_enabled_for_test_(false) { 19 is_sync_enabled_for_test_(false) {}
20 }
21 20
22 PendingEnables::~PendingEnables() { 21 PendingEnables::~PendingEnables() {
23 } 22 }
24 23
25 void PendingEnables::OnExtensionEnabled(const std::string& extension_id) { 24 void PendingEnables::OnExtensionEnabled(const std::string& extension_id) {
26 if (IsWaitingForSync()) 25 if (IsWaitingForSync())
27 ids_.insert(extension_id); 26 ids_.insert(extension_id);
28 } 27 }
29 28
30 void PendingEnables::OnExtensionDisabled(const std::string& extension_id) { 29 void PendingEnables::OnExtensionDisabled(const std::string& extension_id) {
(...skipping 23 matching lines...) Expand all
54 sync_prefs_->GetPreferredDataTypes(syncer::ModelTypeSet(enable_type_)) 53 sync_prefs_->GetPreferredDataTypes(syncer::ModelTypeSet(enable_type_))
55 .Has(enable_type_); 54 .Has(enable_type_);
56 } 55 }
57 56
58 bool PendingEnables::IsWaitingForSync() { 57 bool PendingEnables::IsWaitingForSync() {
59 return IsSyncEnabled() && !sync_bundle_->IsSyncing(); 58 return IsSyncEnabled() && !sync_bundle_->IsSyncing();
60 } 59 }
61 60
62 } // namespace extensions 61 } // namespace extensions
63 62
OLDNEW
« no previous file with comments | « chrome/browser/extensions/pending_enables.h ('k') | chrome/browser/prefs/browser_prefs.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698