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

Side by Side Diff: chrome/browser/ui/app_list/arc/arc_package_sync_data_type_controller.cc

Issue 2388673002: Revert of [Sync] Move //components/sync to the syncer namespace. (patchset #5 id:40001 of https://co (Closed)
Patch Set: Created 4 years, 2 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
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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/ui/app_list/arc/arc_package_sync_data_type_controller.h " 5 #include "chrome/browser/ui/app_list/arc/arc_package_sync_data_type_controller.h "
6 6
7 #include "chrome/browser/chromeos/arc/arc_auth_service.h" 7 #include "chrome/browser/chromeos/arc/arc_auth_service.h"
8 #include "chrome/browser/profiles/profile.h" 8 #include "chrome/browser/profiles/profile.h"
9 #include "chrome/browser/ui/app_list/arc/arc_app_list_prefs.h" 9 #include "chrome/browser/ui/app_list/arc/arc_app_list_prefs.h"
10 #include "chrome/common/pref_names.h" 10 #include "chrome/common/pref_names.h"
(...skipping 12 matching lines...) Expand all
23 bool IsArcEnabled(Profile* profile) { 23 bool IsArcEnabled(Profile* profile) {
24 return arc::ArcAuthService::IsAllowedForProfile(profile) && 24 return arc::ArcAuthService::IsAllowedForProfile(profile) &&
25 profile->GetPrefs()->GetBoolean(prefs::kArcEnabled); 25 profile->GetPrefs()->GetBoolean(prefs::kArcEnabled);
26 } 26 }
27 27
28 } // namespace 28 } // namespace
29 29
30 ArcPackageSyncDataTypeController::ArcPackageSyncDataTypeController( 30 ArcPackageSyncDataTypeController::ArcPackageSyncDataTypeController(
31 syncer::ModelType type, 31 syncer::ModelType type,
32 const base::Closure& dump_stack, 32 const base::Closure& dump_stack,
33 syncer::SyncClient* sync_client, 33 sync_driver::SyncClient* sync_client,
34 Profile* profile) 34 Profile* profile)
35 : syncer::UIDataTypeController(type, dump_stack, sync_client), 35 : sync_driver::UIDataTypeController(type, dump_stack, sync_client),
36 profile_(profile), 36 profile_(profile),
37 sync_client_(sync_client) { 37 sync_client_(sync_client) {
38 pref_registrar_.Init(profile_->GetPrefs()); 38 pref_registrar_.Init(profile_->GetPrefs());
39 pref_registrar_.Add( 39 pref_registrar_.Add(
40 prefs::kArcEnabled, 40 prefs::kArcEnabled,
41 base::Bind(&ArcPackageSyncDataTypeController::OnArcEnabledPrefChanged, 41 base::Bind(&ArcPackageSyncDataTypeController::OnArcEnabledPrefChanged,
42 base::Unretained(this))); 42 base::Unretained(this)));
43 43
44 arc::ArcBridgeService* arc_bridge_service = arc::ArcBridgeService::Get(); 44 arc::ArcBridgeService* arc_bridge_service = arc::ArcBridgeService::Get();
45 if (arc_bridge_service) 45 if (arc_bridge_service)
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
90 "Arc package sync is now disabled because user disables Arc.", 90 "Arc package sync is now disabled because user disables Arc.",
91 type()); 91 type());
92 CreateErrorHandler()->OnUnrecoverableError(error); 92 CreateErrorHandler()->OnUnrecoverableError(error);
93 } 93 }
94 return; 94 return;
95 } 95 }
96 EnableDataType(); 96 EnableDataType();
97 } 97 }
98 98
99 void ArcPackageSyncDataTypeController::EnableDataType() { 99 void ArcPackageSyncDataTypeController::EnableDataType() {
100 syncer::SyncService* sync_service = sync_client_->GetSyncService(); 100 sync_driver::SyncService* sync_service = sync_client_->GetSyncService();
101 DCHECK(sync_service); 101 DCHECK(sync_service);
102 sync_service->ReenableDatatype(type()); 102 sync_service->ReenableDatatype(type());
103 } 103 }
104 104
105 bool ArcPackageSyncDataTypeController::ShouldSyncArc() const { 105 bool ArcPackageSyncDataTypeController::ShouldSyncArc() const {
106 syncer::SyncService* sync_service = sync_client_->GetSyncService(); 106 sync_driver::SyncService* sync_service = sync_client_->GetSyncService();
107 DCHECK(sync_service); 107 DCHECK(sync_service);
108 return sync_service->GetPreferredDataTypes().Has(type()); 108 return sync_service->GetPreferredDataTypes().Has(type());
109 } 109 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/app_list/arc/arc_package_sync_data_type_controller.h ('k') | chrome/browser/ui/ash/app_sync_ui_state.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698