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::Get()->RemoveObserver(this); |
| 16 } |
| 17 |
| 18 void ArcAuthServiceImpl::StartObservingBridgeServiceChanges() { |
| 19 ArcBridgeService::Get()->AddObserver(this); |
| 20 } |
| 21 |
| 22 void ArcAuthServiceImpl::OnAuthInstanceReady() { |
| 23 arc::AuthHostPtr host; |
| 24 binding_.Bind(GetProxy(&host)); |
| 25 ArcBridgeService::Get()->auth_instance()->Init(std::move(host)); |
| 26 } |
| 27 |
| 28 void ArcAuthServiceImpl::GetAuthCode(const GetAuthCodeCallback& callback) { |
| 29 // TODO(victorhsieh): request auth code from LSO (crbug.com/571146). |
| 30 callback.Run(mojo::String("fake auth code from ArcAuthService in Chrome")); |
| 31 } |
| 32 |
| 33 } // namespace arc |
OLD | NEW |