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 "chrome/installer/util/installation_state.h" | 5 #include "chrome/installer/util/installation_state.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "base/strings/string_util.h" | 8 #include "base/strings/string_util.h" |
9 #include "base/strings/utf_string_conversions.h" | 9 #include "base/strings/utf_string_conversions.h" |
10 #include "base/version.h" | 10 #include "base/version.h" |
(...skipping 24 matching lines...) Expand all Loading... |
35 // Returns false if there is no "Commands" subkey or on error. | 35 // Returns false if there is no "Commands" subkey or on error. |
36 // static | 36 // static |
37 bool ProductState::InitializeCommands(const base::win::RegKey& version_key, | 37 bool ProductState::InitializeCommands(const base::win::RegKey& version_key, |
38 AppCommands* commands) { | 38 AppCommands* commands) { |
39 static const DWORD kAccess = | 39 static const DWORD kAccess = |
40 KEY_ENUMERATE_SUB_KEYS | KEY_QUERY_VALUE | KEY_WOW64_32KEY; | 40 KEY_ENUMERATE_SUB_KEYS | KEY_QUERY_VALUE | KEY_WOW64_32KEY; |
41 base::win::RegKey commands_key; | 41 base::win::RegKey commands_key; |
42 | 42 |
43 if (commands_key.Open(version_key.Handle(), google_update::kRegCommandsKey, | 43 if (commands_key.Open(version_key.Handle(), google_update::kRegCommandsKey, |
44 kAccess) == ERROR_SUCCESS) | 44 kAccess) == ERROR_SUCCESS) |
45 return commands->Initialize(commands_key); | 45 return commands->Initialize(commands_key, KEY_WOW64_32KEY); |
46 return false; | 46 return false; |
47 } | 47 } |
48 | 48 |
49 bool ProductState::Initialize(bool system_install, | 49 bool ProductState::Initialize(bool system_install, |
50 BrowserDistribution* distribution) { | 50 BrowserDistribution* distribution) { |
51 static const DWORD kAccess = KEY_QUERY_VALUE | KEY_WOW64_32KEY; | 51 static const DWORD kAccess = KEY_QUERY_VALUE | KEY_WOW64_32KEY; |
52 const std::wstring version_key(distribution->GetVersionKey()); | 52 const std::wstring version_key(distribution->GetVersionKey()); |
53 const std::wstring state_key(distribution->GetStateKey()); | 53 const std::wstring state_key(distribution->GetStateKey()); |
54 const HKEY root_key = system_install ? HKEY_LOCAL_MACHINE : HKEY_CURRENT_USER; | 54 const HKEY root_key = system_install ? HKEY_LOCAL_MACHINE : HKEY_CURRENT_USER; |
55 base::win::RegKey key; | 55 base::win::RegKey key; |
(...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
269 } | 269 } |
270 | 270 |
271 const ProductState* InstallationState::GetProductState( | 271 const ProductState* InstallationState::GetProductState( |
272 bool system_install, | 272 bool system_install, |
273 BrowserDistribution::Type type) const { | 273 BrowserDistribution::Type type) const { |
274 const ProductState* product_state = | 274 const ProductState* product_state = |
275 GetNonVersionedProductState(system_install, type); | 275 GetNonVersionedProductState(system_install, type); |
276 return product_state->version_.get() == NULL ? NULL : product_state; | 276 return product_state->version_.get() == NULL ? NULL : product_state; |
277 } | 277 } |
278 } // namespace installer | 278 } // namespace installer |
OLD | NEW |