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

Unified Diff: chrome/browser/chromeos/ash_config.cc

Issue 2833173002: mash: Support ShelfModel access in Chrome. (Closed)
Patch Set: Address comments; fix test failures. Created 3 years, 7 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: chrome/browser/chromeos/ash_config.cc
diff --git a/chrome/browser/chromeos/ash_config.cc b/chrome/browser/chromeos/ash_config.cc
index 4b33bf6a8c9c171c836abeb00409b2d58e09233c..1eca0a0624b9b9eb3137f9cec4feca5f57248ac0 100644
--- a/chrome/browser/chromeos/ash_config.cc
+++ b/chrome/browser/chromeos/ash_config.cc
@@ -10,14 +10,27 @@
namespace chromeos {
-ash::Config GetAshConfig() {
- if (!service_manager::ServiceManagerIsRemote())
- return ash::Config::CLASSIC;
+namespace {
+
+ash::Config ComputeAshConfig() {
+ base::CommandLine* command_line = base::CommandLine::ForCurrentProcess();
+ std::string flag = command_line->GetSwitchValueASCII(switches::kMusConfig);
+ ash::Config config = ash::Config::CLASSIC;
+ if (command_line->HasSwitch("mash") || flag == switches::kMash)
+ config = ash::Config::MASH;
+ else if (command_line->HasSwitch("mus") || flag == switches::kMus)
+ config = ash::Config::MUS;
+ VLOG_IF(1, config != ash::Config::CLASSIC &&
+ !service_manager::ServiceManagerIsRemote())
+ << " Running with a simulated ash config (likely for testing).";
+ return config;
+}
- return base::CommandLine::ForCurrentProcess()->GetSwitchValueASCII(
- switches::kMusConfig) == switches::kMash
- ? ash::Config::MASH
- : ash::Config::MUS;
+} // namespace
+
+ash::Config GetAshConfig() {
+ static const ash::Config config = ComputeAshConfig();
+ return config;
}
} // namespace chromeos

Powered by Google App Engine
This is Rietveld 408576698