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

Side by Side Diff: components/arc/test/fake_arc_bridge_service.cc

Issue 1618193003: arc: Pass auth token from Chrome to ARC instance. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: update BUILD.gn Created 4 years, 10 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 | « components/arc/auth/arc_auth_fetcher.cc ('k') | no next file » | 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 "components/arc/test/fake_arc_bridge_service.h" 5 #include "components/arc/test/fake_arc_bridge_service.h"
6 6
7 namespace arc { 7 namespace arc {
8 8
9 FakeArcBridgeService::FakeArcBridgeService() { 9 FakeArcBridgeService::FakeArcBridgeService() {
10 } 10 }
11 11
12 FakeArcBridgeService::~FakeArcBridgeService() { 12 FakeArcBridgeService::~FakeArcBridgeService() {
13 if (state() != State::STOPPED) { 13 SetStopped();
14 SetState(State::STOPPED);
15 }
16 } 14 }
17 15
18 void FakeArcBridgeService::DetectAvailability() { 16 void FakeArcBridgeService::DetectAvailability() {
19 } 17 }
20 18
21 void FakeArcBridgeService::HandleStartup() { 19 void FakeArcBridgeService::HandleStartup() {
20 SetReady();
22 } 21 }
23 22
24 void FakeArcBridgeService::Shutdown() { 23 void FakeArcBridgeService::Shutdown() {
24 SetStopped();
25 } 25 }
26 26
27 void FakeArcBridgeService::SetReady() { 27 void FakeArcBridgeService::SetReady() {
28 SetState(State::READY); 28 if (state() != State::READY)
29 SetState(State::READY);
29 } 30 }
30 31
31 void FakeArcBridgeService::SetStopped() { 32 void FakeArcBridgeService::SetStopped() {
32 SetState(State::STOPPED); 33 if (state() != State::STOPPED)
34 SetState(State::STOPPED);
33 } 35 }
34 36
35 bool FakeArcBridgeService::HasObserver(const Observer* observer) { 37 bool FakeArcBridgeService::HasObserver(const Observer* observer) {
36 return observer_list().HasObserver(observer); 38 return observer_list().HasObserver(observer);
37 } 39 }
38 40
39 } // namespace arc 41 } // namespace arc
OLDNEW
« no previous file with comments | « components/arc/auth/arc_auth_fetcher.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698