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

Side by Side Diff: components/arc/arc_auth_service.cc

Issue 1553613002: Add ArcAuthService to handle IPC request from ARC (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 11 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
(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 "components/arc/arc_auth_service.h"
6
7 namespace arc {
8
9 ArcAuthService::ArcAuthService() : binding_(this) {
10 }
11
12 ArcAuthService::~ArcAuthService() {
13 ArcBridgeService* bridge_service = ArcBridgeService::Get();
14 DCHECK(bridge_service);
15 bridge_service->RemoveObserver(this);
16 }
17
18 void ArcAuthService::StartObservingBridgeServiceChanges() {
Luis Héctor Chávez 2015/12/30 00:02:37 Can this be done in the constructor?
victorhsieh 2015/12/30 00:32:34 No, ABS is not available when this is instantiated
lhc(google) 2015/12/30 01:06:47 Right, but does as the code stands there is no nee
victorhsieh 2016/01/04 21:20:02 Since we need to get a profile to store a pref, th
19 ArcBridgeService* bridge_service = ArcBridgeService::Get();
20 DCHECK(bridge_service);
21 bridge_service->AddObserver(this);
22 }
23
24 void ArcAuthService::OnAuthInstanceReady() {
25 ArcBridgeService* bridge_service = ArcBridgeService::Get();
26 DCHECK(bridge_service);
27
28 arc::AuthHostPtr host;
29 binding_.Bind(GetProxy(&host));
30 bridge_service->auth_instance()->Init(std::move(host));
31 }
32
33 void ArcAuthService::GetAuthCode(const GetAuthCodeCallback& callback) {
34 // TODO(victorhsieh): request auth code from LSO.
35 callback.Run(mojo::String("fake auth code from ArcAuthService in Chrome"));
36 }
37
38 } // namespace arc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698