OLD | NEW |
---|---|
(Empty) | |
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 | |
3 // found in the LICENSE file. | |
4 | |
5 #include "chrome/browser/chromeos/arc/arc_auth_service_impl.h" | |
6 | |
7 #include <utility> | |
8 | |
9 namespace arc { | |
10 | |
11 ArcAuthServiceImpl::ArcAuthServiceImpl() : binding_(this) { | |
12 } | |
13 | |
14 ArcAuthServiceImpl::~ArcAuthServiceImpl() { | |
15 ArcBridgeService* bridge_service = ArcBridgeService::Get(); | |
16 DCHECK(bridge_service); | |
achuithb
2016/01/04 23:41:59
You don't need this DCHECK, the line below crashes
victorhsieh
2016/01/05 00:39:14
Done.
| |
17 bridge_service->RemoveObserver(this); | |
18 } | |
19 | |
20 void ArcAuthServiceImpl::StartObservingBridgeServiceChanges() { | |
21 ArcBridgeService* bridge_service = ArcBridgeService::Get(); | |
22 DCHECK(bridge_service); | |
23 bridge_service->AddObserver(this); | |
achuithb
2016/01/04 23:41:59
ArcBridgeService::Get()->AddObserver(this);
victorhsieh
2016/01/05 00:39:14
Done.
| |
24 } | |
25 | |
26 void ArcAuthServiceImpl::OnAuthInstanceReady() { | |
27 ArcBridgeService* bridge_service = ArcBridgeService::Get(); | |
28 DCHECK(bridge_service); | |
29 | |
30 arc::AuthHostPtr host; | |
31 binding_.Bind(GetProxy(&host)); | |
32 bridge_service->auth_instance()->Init(std::move(host)); | |
achuithb
2016/01/04 23:41:59
ArcBridgeService::Get()->auth_instance()->Init(std
victorhsieh
2016/01/05 00:39:14
Done.
| |
33 } | |
34 | |
35 void ArcAuthServiceImpl::GetAuthCode(const GetAuthCodeCallback& callback) { | |
36 // TODO(victorhsieh): request auth code from LSO. | |
achuithb
2016/01/04 23:41:59
Please reference a bug here
victorhsieh
2016/01/05 00:39:14
Done.
| |
37 callback.Run(mojo::String("fake auth code from ArcAuthService in Chrome")); | |
38 } | |
39 | |
40 } // namespace arc | |
OLD | NEW |