| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "mash/common/config.h" | 5 #include "mash/common/config.h" |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 | 8 |
| 9 #if defined(OS_CHROMEOS) |
| 10 #include "ash/public/interfaces/constants.mojom.h" // nogncheck |
| 11 #endif |
| 12 |
| 9 namespace mash { | 13 namespace mash { |
| 10 namespace common { | 14 namespace common { |
| 11 | 15 |
| 12 const char kWindowManagerSwitch[] = "window-manager"; | 16 const char kWindowManagerSwitch[] = "window-manager"; |
| 13 | 17 |
| 14 std::string GetWindowManagerServiceName() { | 18 std::string GetWindowManagerServiceName() { |
| 15 if (base::CommandLine::ForCurrentProcess()->HasSwitch(kWindowManagerSwitch)) { | 19 if (base::CommandLine::ForCurrentProcess()->HasSwitch(kWindowManagerSwitch)) { |
| 16 std::string service_name = | 20 std::string service_name = |
| 17 base::CommandLine::ForCurrentProcess()->GetSwitchValueASCII( | 21 base::CommandLine::ForCurrentProcess()->GetSwitchValueASCII( |
| 18 kWindowManagerSwitch); | 22 kWindowManagerSwitch); |
| 19 return service_name; | 23 return service_name; |
| 20 } | 24 } |
| 21 // TODO(beng): move this constant to a mojom file in //ash. | 25 #if defined(OS_CHROMEOS) |
| 22 return "ash"; | 26 return ash::mojom::kServiceName; |
| 27 #else |
| 28 LOG(FATAL) |
| 29 << "You must specify a window manager e.g. --window-manager=simple_wm"; |
| 30 return std::string(); |
| 31 #endif |
| 23 } | 32 } |
| 24 | 33 |
| 25 } // namespace common | 34 } // namespace common |
| 26 } // namespace mash | 35 } // namespace mash |
| OLD | NEW |