OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 declares utility functions for the installer. The original reason | 5 // This file declares utility functions for the installer. The original reason |
6 // for putting these functions in installer\util library is so that we can | 6 // for putting these functions in installer\util library is so that we can |
7 // separate out the critical logic and write unit tests for it. | 7 // separate out the critical logic and write unit tests for it. |
8 | 8 |
9 #ifndef CHROME_INSTALLER_UTIL_INSTALL_UTIL_H__ | 9 #ifndef CHROME_INSTALLER_UTIL_INSTALL_UTIL_H__ |
10 #define CHROME_INSTALLER_UTIL_INSTALL_UTIL_H__ | 10 #define CHROME_INSTALLER_UTIL_INSTALL_UTIL_H__ |
11 #pragma once | 11 #pragma once |
12 | 12 |
13 #include <tchar.h> | 13 #include <tchar.h> |
14 #include <windows.h> | 14 #include <windows.h> |
15 #include <string> | 15 #include <string> |
16 | 16 |
17 #include "base/basictypes.h" | 17 #include "base/basictypes.h" |
| 18 #include "chrome/installer/util/master_preferences.h" |
18 #include "chrome/installer/util/util_constants.h" | 19 #include "chrome/installer/util/util_constants.h" |
19 #include "chrome/installer/util/version.h" | 20 #include "chrome/installer/util/version.h" |
20 | 21 |
21 class WorkItemList; | 22 class WorkItemList; |
22 | 23 |
23 namespace base { | 24 namespace base { |
24 namespace win { | 25 namespace win { |
25 class RegKey; | 26 class RegKey; |
26 } // namespace win | 27 } // namespace win |
27 } // namespace base | 28 } // namespace base |
(...skipping 83 matching lines...) Loading... |
111 | 112 |
112 // Deletes the registry key at path key_path under the key given by root_key. | 113 // Deletes the registry key at path key_path under the key given by root_key. |
113 static bool DeleteRegistryKey(base::win::RegKey& root_key, | 114 static bool DeleteRegistryKey(base::win::RegKey& root_key, |
114 const std::wstring& key_path); | 115 const std::wstring& key_path); |
115 | 116 |
116 // Deletes the registry value named value_name at path key_path under the key | 117 // Deletes the registry value named value_name at path key_path under the key |
117 // given by reg_root. | 118 // given by reg_root. |
118 static bool DeleteRegistryValue(HKEY reg_root, const std::wstring& key_path, | 119 static bool DeleteRegistryValue(HKEY reg_root, const std::wstring& key_path, |
119 const std::wstring& value_name); | 120 const std::wstring& value_name); |
120 | 121 |
| 122 // Returns a static preference object that has been initialized with the |
| 123 // CommandLine object for the current process. |
| 124 // NOTE: Must not be called before CommandLine::Init() is called! |
| 125 static const installer_util::MasterPreferences& |
| 126 GetMasterPreferencesForCurrentProcess(); |
| 127 |
121 private: | 128 private: |
122 DISALLOW_COPY_AND_ASSIGN(InstallUtil); | 129 DISALLOW_COPY_AND_ASSIGN(InstallUtil); |
123 }; | 130 }; |
124 | 131 |
125 | 132 |
126 #endif // CHROME_INSTALLER_UTIL_INSTALL_UTIL_H__ | 133 #endif // CHROME_INSTALLER_UTIL_INSTALL_UTIL_H__ |
OLD | NEW |