| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 // This file defines utility functions that can report details about the | 5 // This file defines utility functions that can report details about the |
| 6 // host operating environment. | 6 // host operating environment. |
| 7 | 7 |
| 8 #ifndef CHROME_APP_CLIENT_UTIL_H_ | 8 #ifndef CHROME_APP_CLIENT_UTIL_H_ |
| 9 #define CHROME_APP_CLIENT_UTIL_H_ | 9 #define CHROME_APP_CLIENT_UTIL_H_ |
| 10 | 10 |
| 11 #include <windows.h> | 11 #include <windows.h> |
| 12 | 12 |
| 13 #include <string> | 13 #include <string> |
| 14 | 14 |
| 15 #include "sandbox/src/sandbox_factory.h" | 15 #include "sandbox/src/sandbox_factory.h" |
| 16 | 16 |
| 17 namespace client_util { | 17 namespace client_util { |
| 18 typedef int (*DLL_MAIN)(HINSTANCE instance, sandbox::SandboxInterfaceInfo*, | 18 typedef int (*DLL_MAIN)(HINSTANCE instance, sandbox::SandboxInterfaceInfo*, |
| 19 TCHAR*, int); | 19 TCHAR*); |
| 20 | 20 |
| 21 extern const wchar_t kProductVersionKey[]; | 21 extern const wchar_t kProductVersionKey[]; |
| 22 | 22 |
| 23 // Returns true if file specified by file_path exists | 23 // Returns true if file specified by file_path exists |
| 24 bool FileExists(const wchar_t* const file_path); | 24 bool FileExists(const wchar_t* const file_path); |
| 25 | 25 |
| 26 // Returns Chromium version after reading it from reg_key registry key. Uses | 26 // Returns Chromium version after reading it from reg_key registry key. Uses |
| 27 // exe_path to detemine registry root key (HKLM/HKCU). Note it is the | 27 // exe_path to detemine registry root key (HKLM/HKCU). Note it is the |
| 28 // responsibility of caller to free *version when function is successful. | 28 // responsibility of caller to free *version when function is successful. |
| 29 bool GetChromiumVersion(const wchar_t* const exe_path, | 29 bool GetChromiumVersion(const wchar_t* const exe_path, |
| 30 const wchar_t* const reg_key_path, | 30 const wchar_t* const reg_key_path, |
| 31 wchar_t** version); | 31 wchar_t** version); |
| 32 | 32 |
| 33 // Get path to DLL specified by dll_name. If dll_path is specified and it | 33 // Get path to DLL specified by dll_name. If dll_path is specified and it |
| 34 // exists we assume DLL is in that directory and return that. Else we search | 34 // exists we assume DLL is in that directory and return that. Else we search |
| 35 // for that DLL by calling Windows API. | 35 // for that DLL by calling Windows API. |
| 36 std::wstring GetDLLPath(const std::wstring dll_name, | 36 std::wstring GetDLLPath(const std::wstring dll_name, |
| 37 const std::wstring dll_path); | 37 const std::wstring dll_path); |
| 38 | 38 |
| 39 // Returns the path to the exe (without the file name) that called this | 39 // Returns the path to the exe (without the file name) that called this |
| 40 // function. The buffer should already be allocated (ideally of MAX_PATH size). | 40 // function. The buffer should already be allocated (ideally of MAX_PATH size). |
| 41 void GetExecutablePath(wchar_t* exe_path); | 41 void GetExecutablePath(wchar_t* exe_path); |
| 42 | 42 |
| 43 } // namespace client_util | 43 } // namespace client_util |
| 44 | 44 |
| 45 #endif // CHROME_APP_CLIENT_UTIL_H_ | 45 #endif // CHROME_APP_CLIENT_UTIL_H_ |
| 46 | 46 |
| OLD | NEW |