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 |