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

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

Issue 2710673002: Add Mojo constant for "ash" and replace hardcoded strings (Closed)
Patch Set: Move conditional include down. 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') | no next file » | 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 #include "base/command_line.h" 7 #include "base/command_line.h"
8 8
9 #if defined(USE_ASH)
sky 2017/02/24 21:36:34 Sorry, we want to get rid of USE_ASH. It'll be rep
fwang 2017/02/24 22:00:08 Done.
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(USE_ASH)
22 return "ash"; 26 return ash::mojom::kServiceName;
27 #else
tonikitoo 2017/02/24 19:03:21 Actually !USE_ASH (or !OS_CHROMEOS) to not work wi
fwang 2017/02/24 19:19:58 On 2017/02/24 19:03:21, tonikitoo wrote: Is this
sky 2017/02/24 21:18:43 It is used on platforms where USE_ASH=0. Say windo
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
OLDNEW
« no previous file with comments | « mash/common/BUILD.gn ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698