Chromium Code Reviews| 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 #if defined(USE_ASH) | |
| 8 #include "ash/public/interfaces/constants.mojom.h" // nogncheck | |
| 9 #else | |
| 10 #include "mash/simple_wm/public/interfaces/constants.mojom.h" // nogncheck | |
| 11 #endif | |
| 7 #include "base/command_line.h" | 12 #include "base/command_line.h" |
| 8 | 13 |
| 9 namespace mash { | 14 namespace mash { |
| 10 namespace common { | 15 namespace common { |
| 11 | 16 |
| 12 const char kWindowManagerSwitch[] = "window-manager"; | 17 const char kWindowManagerSwitch[] = "window-manager"; |
| 13 | 18 |
| 14 std::string GetWindowManagerServiceName() { | 19 std::string GetWindowManagerServiceName() { |
| 15 if (base::CommandLine::ForCurrentProcess()->HasSwitch(kWindowManagerSwitch)) { | 20 if (base::CommandLine::ForCurrentProcess()->HasSwitch(kWindowManagerSwitch)) { |
| 16 std::string service_name = | 21 std::string service_name = |
| 17 base::CommandLine::ForCurrentProcess()->GetSwitchValueASCII( | 22 base::CommandLine::ForCurrentProcess()->GetSwitchValueASCII( |
| 18 kWindowManagerSwitch); | 23 kWindowManagerSwitch); |
| 19 return service_name; | 24 return service_name; |
| 20 } | 25 } |
| 21 // TODO(beng): move this constant to a mojom file in //ash. | 26 #if defined(USE_ASH) |
| 22 return "ash"; | 27 return ash::mojom::kServiceName; |
| 28 #else | |
| 29 return mash::simple_wm::mojom::kServiceName; | |
|
tonikitoo
2017/02/21 14:29:46
I believe there is a slightly behavior change here
fwang
2017/02/21 14:34:20
Yes, it only makes sense to return "ash" when ash
fwang
2017/02/22 07:12:59
Done in patch set 3.
| |
| 30 #endif | |
| 23 } | 31 } |
| 24 | 32 |
| 25 } // namespace common | 33 } // namespace common |
| 26 } // namespace mash | 34 } // namespace mash |
| OLD | NEW |