| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |