Roll src/third_party/WebKit b41a10f:afd8afd (svn 202201:202202)
[chromium-blink-merge.git] / remoting / host / ipc_constants.cc
blob6862400b394a26e81242463a7c9e45a68f8a7f48
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #include "remoting/host/ipc_constants.h"
7 #include "base/compiler_specific.h"
8 #include "base/logging.h"
9 #include "base/path_service.h"
11 namespace remoting {
13 const base::FilePath::CharType kHostBinaryName[] =
14 FILE_PATH_LITERAL("remoting_host");
16 const base::FilePath::CharType kDesktopBinaryName[] =
17 FILE_PATH_LITERAL("remoting_desktop");
19 bool GetInstalledBinaryPath(const base::FilePath::StringType& binary,
20 base::FilePath* full_path) {
21 base::FilePath dir_path;
22 if (!PathService::Get(base::DIR_EXE, &dir_path)) {
23 LOG(ERROR) << "Failed to get the executable file name.";
24 return false;
27 base::FilePath path = dir_path.Append(binary);
29 #if defined(OS_WIN)
30 path = path.ReplaceExtension(FILE_PATH_LITERAL("exe"));
31 #endif // defined(OS_WIN)
33 *full_path = path;
34 return true;
37 } // namespace remoting