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

Unified Diff: components/arc/arc_util.cc

Issue 2642783003: Move more utility functions to arc_util. (Closed)
Patch Set: Revert IsIntentHelperAvailable fix. Created 3 years, 11 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 side-by-side diff with in-line comments
Download patch
Index: components/arc/arc_util.cc
diff --git a/components/arc/arc_bridge_service.cc b/components/arc/arc_util.cc
similarity index 50%
copy from components/arc/arc_bridge_service.cc
copy to components/arc/arc_util.cc
index f17d3d62b19e4bb75e98545ceeba5e2ad5de0c7c..05dbe5b355b2b85992a82365daa440534239c7ba 100644
--- a/components/arc/arc_bridge_service.cc
+++ b/components/arc/arc_util.cc
@@ -1,18 +1,16 @@
-// Copyright 2015 The Chromium Authors. All rights reserved.
+// Copyright 2017 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "components/arc/arc_bridge_service.h"
-
-#include <utility>
+#include "components/arc/arc_util.h"
#include "base/command_line.h"
#include "base/feature_list.h"
-#include "base/sequenced_task_runner.h"
-#include "base/threading/thread_task_runner_handle.h"
#include "chromeos/chromeos_switches.h"
+#include "components/user_manager/user_manager.h"
namespace arc {
+namespace util {
namespace {
@@ -21,20 +19,27 @@ const base::Feature kArcEnabledFeature{"EnableARC",
} // namespace
-ArcBridgeService::ArcBridgeService() = default;
-
-ArcBridgeService::~ArcBridgeService() = default;
-
-// static
-bool ArcBridgeService::GetEnabled(const base::CommandLine* command_line) {
+bool IsArcEnabled() {
+ const auto* command_line = base::CommandLine::ForCurrentProcess();
return command_line->HasSwitch(chromeos::switches::kEnableArc) ||
(command_line->HasSwitch(chromeos::switches::kArcAvailable) &&
base::FeatureList::IsEnabled(kArcEnabledFeature));
}
-// static
-bool ArcBridgeService::GetAvailable(const base::CommandLine* command_line) {
+bool IsArcAvailable() {
+ const auto* command_line = base::CommandLine::ForCurrentProcess();
return command_line->HasSwitch(chromeos::switches::kArcAvailable);
}
+bool IsArcKioskMode() {
+ return user_manager::UserManager::Get()->IsLoggedInAsArcKioskApp();
+}
+
+bool IsOptInVerificationDisabled() {
+ const auto* command_line = base::CommandLine::ForCurrentProcess();
+ return command_line->HasSwitch(
+ chromeos::switches::kDisableArcOptInVerification);
+}
+
+} // namespace util
} // namespace arc

Powered by Google App Engine
This is Rietveld 408576698