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

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

Issue 2266123002: arc: Add the --arc-available switch (Closed) Base URL: https://chromium.googlesource.com/a/chromium/src.git@master
Patch Set: Created 4 years, 3 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 | « chromeos/chromeos_switches.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/arc_bridge_service.h" 5 #include "components/arc/arc_bridge_service.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/feature_list.h" 10 #include "base/feature_list.h"
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
42 LOG(ERROR) << "ArcBridgeService is not ready."; 42 LOG(ERROR) << "ArcBridgeService is not ready.";
43 return nullptr; 43 return nullptr;
44 } 44 }
45 DCHECK(g_arc_bridge_service->CalledOnValidThread()); 45 DCHECK(g_arc_bridge_service->CalledOnValidThread());
46 return g_arc_bridge_service; 46 return g_arc_bridge_service;
47 } 47 }
48 48
49 // static 49 // static
50 bool ArcBridgeService::GetEnabled(const base::CommandLine* command_line) { 50 bool ArcBridgeService::GetEnabled(const base::CommandLine* command_line) {
51 return command_line->HasSwitch(chromeos::switches::kEnableArc) || 51 return command_line->HasSwitch(chromeos::switches::kEnableArc) ||
52 base::FeatureList::IsEnabled(kArcEnabledFeature); 52 (command_line->HasSwitch(chromeos::switches::kArcAvailable) &&
53 base::FeatureList::IsEnabled(kArcEnabledFeature));
53 } 54 }
54 55
55 void ArcBridgeService::AddObserver(Observer* observer) { 56 void ArcBridgeService::AddObserver(Observer* observer) {
56 DCHECK(CalledOnValidThread()); 57 DCHECK(CalledOnValidThread());
57 observer_list_.AddObserver(observer); 58 observer_list_.AddObserver(observer);
58 } 59 }
59 60
60 void ArcBridgeService::RemoveObserver(Observer* observer) { 61 void ArcBridgeService::RemoveObserver(Observer* observer) {
61 DCHECK(CalledOnValidThread()); 62 DCHECK(CalledOnValidThread());
62 observer_list_.RemoveObserver(observer); 63 observer_list_.RemoveObserver(observer);
(...skipping 13 matching lines...) Expand all
76 void ArcBridgeService::SetStopReason(StopReason stop_reason) { 77 void ArcBridgeService::SetStopReason(StopReason stop_reason) {
77 DCHECK(CalledOnValidThread()); 78 DCHECK(CalledOnValidThread());
78 stop_reason_ = stop_reason; 79 stop_reason_ = stop_reason;
79 } 80 }
80 81
81 bool ArcBridgeService::CalledOnValidThread() { 82 bool ArcBridgeService::CalledOnValidThread() {
82 return thread_checker_.CalledOnValidThread(); 83 return thread_checker_.CalledOnValidThread();
83 } 84 }
84 85
85 } // namespace arc 86 } // namespace arc
OLDNEW
« no previous file with comments | « chromeos/chromeos_switches.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698