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

Side by Side Diff: mash/common/config.cc

Issue 2710673002: Add Mojo constant for "ash" and replace hardcoded strings (Closed)
Patch Set: Fix dep of simple_wm constants and (for completeness) make mojo interfaces a dep of simple_wm; add … Created 3 years, 10 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 unified diff | Download patch
« no previous file with comments | « mash/common/BUILD.gn ('k') | mash/simple_wm/BUILD.gn » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
OLDNEW
« no previous file with comments | « mash/common/BUILD.gn ('k') | mash/simple_wm/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698