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

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

Issue 2357053002: Always use arc::InstanceHolder<T>::GetInstanceForMethod (Closed)
Patch Set: Address comments from Luis 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
« no previous file with comments | « no previous file | chrome/browser/chromeos/arc/arc_downloads_watcher_service.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 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 211 matching lines...) Expand 10 before | Expand all | Expand 10 after
222 if (user_manager::UserManager::Get() 222 if (user_manager::UserManager::Get()
223 ->IsCurrentUserCryptohomeDataEphemeral()) { 223 ->IsCurrentUserCryptohomeDataEphemeral()) {
224 VLOG(2) << "Users with ephemeral data are not supported in Arc."; 224 VLOG(2) << "Users with ephemeral data are not supported in Arc.";
225 return false; 225 return false;
226 } 226 }
227 227
228 return true; 228 return true;
229 } 229 }
230 230
231 void ArcAuthService::OnInstanceReady() { 231 void ArcAuthService::OnInstanceReady() {
232 arc_bridge_service()->auth()->instance()->Init( 232 auto* instance = arc_bridge_service()->auth()->GetInstanceForMethod("Init");
233 binding_.CreateInterfacePtrAndBind()); 233 CHECK(instance);
dcheng 2016/09/24 00:25:25 We should prefer DCHECK() over CHECK() to document
dcheng 2016/09/24 00:27:13 See https://chromium.googlesource.com/chromium/src
Yusuke Sato 2016/09/24 00:50:54 Done.
Yusuke Sato 2016/09/24 00:50:54 Acknowledged.
234 instance->Init(binding_.CreateInterfacePtrAndBind());
234 } 235 }
235 236
236 void ArcAuthService::OnBridgeStopped(ArcBridgeService::StopReason reason) { 237 void ArcAuthService::OnBridgeStopped(ArcBridgeService::StopReason reason) {
237 // TODO(crbug.com/625923): Use |reason| to report more detailed errors. 238 // TODO(crbug.com/625923): Use |reason| to report more detailed errors.
238 if (arc_sign_in_timer_.IsRunning()) { 239 if (arc_sign_in_timer_.IsRunning()) {
239 OnSignInFailedInternal(ProvisioningResult::ARC_STOPPED); 240 OnSignInFailedInternal(ProvisioningResult::ARC_STOPPED);
240 } 241 }
241 242
242 if (clear_required_) { 243 if (clear_required_) {
243 // This should be always true, but just in case as this is looked at 244 // This should be always true, but just in case as this is looked at
(...skipping 664 matching lines...) Expand 10 before | Expand all | Expand 10 after
908 return os << kStateFetchingCode; 909 return os << kStateFetchingCode;
909 case ArcAuthService::State::ACTIVE: 910 case ArcAuthService::State::ACTIVE:
910 return os << kStateActive; 911 return os << kStateActive;
911 default: 912 default:
912 NOTREACHED(); 913 NOTREACHED();
913 return os; 914 return os;
914 } 915 }
915 } 916 }
916 917
917 } // namespace arc 918 } // namespace arc
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/chromeos/arc/arc_downloads_watcher_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698