summaryrefslogtreecommitdiff
path: root/chromium/mash/common/config.cc
blob: b13e15f8e8594c81ed85c1c680f51af1a5610b74 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
// Copyright 2016 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "mash/common/config.h"

#include "base/command_line.h"

#if defined(OS_CHROMEOS)
#include "ash/public/interfaces/constants.mojom.h"  // nogncheck
#endif

namespace mash {
namespace common {

const char kWindowManagerSwitch[] = "window-manager";

std::string GetWindowManagerServiceName() {
  if (base::CommandLine::ForCurrentProcess()->HasSwitch(kWindowManagerSwitch)) {
    std::string service_name =
        base::CommandLine::ForCurrentProcess()->GetSwitchValueASCII(
            kWindowManagerSwitch);
    return service_name;
  }
#if defined(OS_CHROMEOS)
  return ash::mojom::kServiceName;
#else
  LOG(FATAL)
      << "You must specify a window manager e.g. --window-manager=simple_wm";
  return std::string();
#endif
}

}  // namespace common
}  // namespace mash