Chromium Code Reviews| Index: components/arc/arc_bridge_service.cc |
| diff --git a/components/arc/arc_bridge_service.cc b/components/arc/arc_bridge_service.cc |
| index c4890afe66aca3bc0b4867d7cbfb421462e4946a..e2146c22541caf484caba3ce87d86dff9ba23859 100644 |
| --- a/components/arc/arc_bridge_service.cc |
| +++ b/components/arc/arc_bridge_service.cc |
| @@ -4,12 +4,14 @@ |
| #include "components/arc/arc_bridge_service.h" |
| +#include "base/command_line.h" |
| #include "base/files/file_path.h" |
| #include "base/files/file_util.h" |
| #include "base/prefs/pref_registry_simple.h" |
| #include "base/prefs/pref_service.h" |
| #include "base/task_runner_util.h" |
| #include "base/thread_task_runner_handle.h" |
| +#include "chromeos/chromeos_switches.h" |
| #include "chromeos/dbus/dbus_method_call_status.h" |
| #include "chromeos/dbus/dbus_thread_manager.h" |
| #include "chromeos/dbus/session_manager_client.h" |
| @@ -57,6 +59,11 @@ ArcBridgeService* ArcBridgeService::Get() { |
| return g_arc_bridge_service; |
| } |
| +// static |
| +bool ArcBridgeService::GetEnabled(const base::CommandLine* command_line) { |
| + return command_line->HasSwitch(chromeos::switches::kEnableArc); |
| +} |
| + |
| void ArcBridgeService::DetectAvailability() { |
| chromeos::SessionManagerClient* session_manager_client = |
| chromeos::DBusThreadManager::Get()->GetSessionManagerClient(); |
| @@ -233,7 +240,9 @@ void ArcBridgeService::OnInstanceStarted(bool success) { |
| void ArcBridgeService::OnInstanceBootPhase(InstanceBootPhase phase) { |
| DCHECK(origin_task_runner_->RunsTasksOnCurrentThread()); |
| - if (state_ != State::STARTING) { |
| + // The state can be STARTING the first time this is called, and will then |
| + // transition to READY after BRIDGE_READY has been passed. |
| + if (state_ != State::STARTING && state_ != State::READY) { |
|
elijahtaylor (use chromium)
2015/11/23 18:01:04
this doesn't seem related to the flag, what is thi
Luis Héctor Chávez
2015/11/23 18:02:45
This is a fix for a test breakage that we did not
|
| VLOG(1) << "StopInstance() called while connecting"; |
| return; |
| } |