OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 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 "remoting/host/ipc_constants.h" | 5 #include "remoting/host/ipc_constants.h" |
6 | 6 |
7 #include "base/compiler_specific.h" | 7 #include "base/compiler_specific.h" |
8 #include "base/logging.h" | 8 #include "base/logging.h" |
9 #include "base/path_service.h" | 9 #include "base/path_service.h" |
| 10 #include "build/build_config.h" |
10 | 11 |
11 namespace remoting { | 12 namespace remoting { |
12 | 13 |
13 const base::FilePath::CharType kHostBinaryName[] = | 14 const base::FilePath::CharType kHostBinaryName[] = |
14 FILE_PATH_LITERAL("remoting_host"); | 15 FILE_PATH_LITERAL("remoting_host"); |
15 | 16 |
16 const base::FilePath::CharType kDesktopBinaryName[] = | 17 const base::FilePath::CharType kDesktopBinaryName[] = |
17 FILE_PATH_LITERAL("remoting_desktop"); | 18 FILE_PATH_LITERAL("remoting_desktop"); |
18 | 19 |
19 bool GetInstalledBinaryPath(const base::FilePath::StringType& binary, | 20 bool GetInstalledBinaryPath(const base::FilePath::StringType& binary, |
20 base::FilePath* full_path) { | 21 base::FilePath* full_path) { |
21 base::FilePath dir_path; | 22 base::FilePath dir_path; |
22 if (!PathService::Get(base::DIR_EXE, &dir_path)) { | 23 if (!PathService::Get(base::DIR_EXE, &dir_path)) { |
23 LOG(ERROR) << "Failed to get the executable file name."; | 24 LOG(ERROR) << "Failed to get the executable file name."; |
24 return false; | 25 return false; |
25 } | 26 } |
26 | 27 |
27 base::FilePath path = dir_path.Append(binary); | 28 base::FilePath path = dir_path.Append(binary); |
28 | 29 |
29 #if defined(OS_WIN) | 30 #if defined(OS_WIN) |
30 path = path.ReplaceExtension(FILE_PATH_LITERAL("exe")); | 31 path = path.ReplaceExtension(FILE_PATH_LITERAL("exe")); |
31 #endif // defined(OS_WIN) | 32 #endif // defined(OS_WIN) |
32 | 33 |
33 *full_path = path; | 34 *full_path = path; |
34 return true; | 35 return true; |
35 } | 36 } |
36 | 37 |
37 } // namespace remoting | 38 } // namespace remoting |
OLD | NEW |