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

Unified Diff: components/arc/arc_bridge_service.cc

Issue 1466143002: arc-bridge: Enable ARC with a command-line flag (Closed) Base URL: https://chromium.googlesource.com/a/chromium/src.git@master
Patch Set: Rebased to ToT Created 5 years, 1 month 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « components/arc/arc_bridge_service.h ('k') | components/arc/arc_bridge_service_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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) {
VLOG(1) << "StopInstance() called while connecting";
return;
}
« no previous file with comments | « components/arc/arc_bridge_service.h ('k') | components/arc/arc_bridge_service_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698