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

Side by Side Diff: chrome/browser/chromeos/arc/arc_auth_service.cc

Issue 2206883002: Do not sync ARC opt-in preference (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add TODOs Created 4 years, 4 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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/chromeos/arc/arc_auth_service.h" 5 #include "chrome/browser/chromeos/arc/arc_auth_service.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "ash/common/shelf/shelf_delegate.h" 9 #include "ash/common/shelf/shelf_delegate.h"
10 #include "ash/common/wm_shell.h" 10 #include "ash/common/wm_shell.h"
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after
146 146
147 // static 147 // static
148 ArcAuthService* ArcAuthService::Get() { 148 ArcAuthService* ArcAuthService::Get() {
149 DCHECK_CURRENTLY_ON(content::BrowserThread::UI); 149 DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
150 return g_arc_auth_service; 150 return g_arc_auth_service;
151 } 151 }
152 152
153 // static 153 // static
154 void ArcAuthService::RegisterProfilePrefs( 154 void ArcAuthService::RegisterProfilePrefs(
155 user_prefs::PrefRegistrySyncable* registry) { 155 user_prefs::PrefRegistrySyncable* registry) {
156 registry->RegisterBooleanPref( 156 // TODO(dspaid): Implement a mechanism to allow this to sync on first boot
157 prefs::kArcEnabled, false, 157 // only.
158 user_prefs::PrefRegistrySyncable::SYNCABLE_PREF); 158 registry->RegisterBooleanPref(prefs::kArcEnabled, false);
159 registry->RegisterBooleanPref(prefs::kArcSignedIn, false); 159 registry->RegisterBooleanPref(prefs::kArcSignedIn, false);
160 registry->RegisterBooleanPref(prefs::kArcBackupRestoreEnabled, true); 160 registry->RegisterBooleanPref(prefs::kArcBackupRestoreEnabled, true);
161 registry->RegisterBooleanPref(prefs::kArcLocationServiceEnabled, true); 161 registry->RegisterBooleanPref(prefs::kArcLocationServiceEnabled, true);
162 } 162 }
163 163
164 // static 164 // static
165 void ArcAuthService::DisableUIForTesting() { 165 void ArcAuthService::DisableUIForTesting() {
166 g_disable_ui_for_testing = true; 166 g_disable_ui_for_testing = true;
167 } 167 }
168 168
(...skipping 343 matching lines...) Expand 10 before | Expand all | Expand 10 after
512 UpdateEnabledStateUMA(false); 512 UpdateEnabledStateUMA(false);
513 profile_->GetPrefs()->SetBoolean(prefs::kArcSignedIn, false); 513 profile_->GetPrefs()->SetBoolean(prefs::kArcSignedIn, false);
514 } 514 }
515 ShutdownBridgeAndCloseUI(); 515 ShutdownBridgeAndCloseUI();
516 } 516 }
517 517
518 void ArcAuthService::OnOptInPreferenceChanged() { 518 void ArcAuthService::OnOptInPreferenceChanged() {
519 DCHECK_CURRENTLY_ON(content::BrowserThread::UI); 519 DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
520 DCHECK(profile_); 520 DCHECK(profile_);
521 521
522 // TODO(dspaid): Move code from OnSyncedPrefChanged into this method.
523 OnSyncedPrefChanged(prefs::kArcEnabled, IsArcManaged());
524
522 const bool arc_enabled = IsArcEnabled(); 525 const bool arc_enabled = IsArcEnabled();
523 FOR_EACH_OBSERVER(Observer, observer_list_, OnOptInEnabled(arc_enabled)); 526 FOR_EACH_OBSERVER(Observer, observer_list_, OnOptInEnabled(arc_enabled));
524 527
525 if (!arc_enabled) { 528 if (!arc_enabled) {
526 StopArc(); 529 StopArc();
527 return; 530 return;
528 } 531 }
529 532
530 if (state_ == State::ACTIVE) 533 if (state_ == State::ACTIVE)
531 return; 534 return;
(...skipping 274 matching lines...) Expand 10 before | Expand all | Expand 10 after
806 return os << kStateFetchingCode; 809 return os << kStateFetchingCode;
807 case ArcAuthService::State::ACTIVE: 810 case ArcAuthService::State::ACTIVE:
808 return os << kStateActive; 811 return os << kStateActive;
809 default: 812 default:
810 NOTREACHED(); 813 NOTREACHED();
811 return os; 814 return os;
812 } 815 }
813 } 816 }
814 817
815 } // namespace arc 818 } // namespace arc
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698