Chromium Code Reviews| Index: chrome/browser/chromeos/arc/arc_auth_service_impl.cc |
| diff --git a/chrome/browser/chromeos/arc/arc_auth_service_impl.cc b/chrome/browser/chromeos/arc/arc_auth_service_impl.cc |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..b46f03298024d322c667fc7fc4c0a098fca5cae3 |
| --- /dev/null |
| +++ b/chrome/browser/chromeos/arc/arc_auth_service_impl.cc |
| @@ -0,0 +1,40 @@ |
| +// Copyright 2015 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#include "chrome/browser/chromeos/arc/arc_auth_service_impl.h" |
| + |
| +#include <utility> |
| + |
| +namespace arc { |
| + |
| +ArcAuthServiceImpl::ArcAuthServiceImpl() : binding_(this) { |
| +} |
| + |
| +ArcAuthServiceImpl::~ArcAuthServiceImpl() { |
| + ArcBridgeService* bridge_service = ArcBridgeService::Get(); |
| + 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.
|
| + bridge_service->RemoveObserver(this); |
| +} |
| + |
| +void ArcAuthServiceImpl::StartObservingBridgeServiceChanges() { |
| + ArcBridgeService* bridge_service = ArcBridgeService::Get(); |
| + DCHECK(bridge_service); |
| + bridge_service->AddObserver(this); |
|
achuithb
2016/01/04 23:41:59
ArcBridgeService::Get()->AddObserver(this);
victorhsieh
2016/01/05 00:39:14
Done.
|
| +} |
| + |
| +void ArcAuthServiceImpl::OnAuthInstanceReady() { |
| + ArcBridgeService* bridge_service = ArcBridgeService::Get(); |
| + DCHECK(bridge_service); |
| + |
| + arc::AuthHostPtr host; |
| + binding_.Bind(GetProxy(&host)); |
| + 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.
|
| +} |
| + |
| +void ArcAuthServiceImpl::GetAuthCode(const GetAuthCodeCallback& callback) { |
| + // 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.
|
| + callback.Run(mojo::String("fake auth code from ArcAuthService in Chrome")); |
| +} |
| + |
| +} // namespace arc |