| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/google_update_settings.h" | 5 #include "chrome/installer/util/google_update_settings.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/path_service.h" | 10 #include "base/path_service.h" |
| (...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 116 if (key.ReadValueDW(google_update::kRegEULAAceptedField, | 116 if (key.ReadValueDW(google_update::kRegEULAAceptedField, |
| 117 &previous_value) != ERROR_SUCCESS) | 117 &previous_value) != ERROR_SUCCESS) |
| 118 return FOUND_CLIENT_STATE; | 118 return FOUND_CLIENT_STATE; |
| 119 | 119 |
| 120 return ((previous_value != 0) == setting) ? | 120 return ((previous_value != 0) == setting) ? |
| 121 FOUND_SAME_SETTING : FOUND_OPPOSITE_SETTING; | 121 FOUND_SAME_SETTING : FOUND_OPPOSITE_SETTING; |
| 122 } | 122 } |
| 123 | 123 |
| 124 bool GetChromeChannelInternal(bool system_install, | 124 bool GetChromeChannelInternal(bool system_install, |
| 125 bool add_multi_modifier, | 125 bool add_multi_modifier, |
| 126 std::wstring* channel) { | 126 string16* channel) { |
| 127 BrowserDistribution* dist = BrowserDistribution::GetDistribution(); | 127 BrowserDistribution* dist = BrowserDistribution::GetDistribution(); |
| 128 if (dist->GetChromeChannel(channel)) { | 128 if (dist->GetChromeChannel(channel)) { |
| 129 return true; | 129 return true; |
| 130 } | 130 } |
| 131 | 131 |
| 132 HKEY root_key = system_install ? HKEY_LOCAL_MACHINE : HKEY_CURRENT_USER; | 132 HKEY root_key = system_install ? HKEY_LOCAL_MACHINE : HKEY_CURRENT_USER; |
| 133 std::wstring reg_path = dist->GetStateKey(); | 133 string16 reg_path = dist->GetStateKey(); |
| 134 RegKey key(root_key, reg_path.c_str(), KEY_READ); | 134 RegKey key(root_key, reg_path.c_str(), KEY_READ); |
| 135 | 135 |
| 136 installer::ChannelInfo channel_info; | 136 installer::ChannelInfo channel_info; |
| 137 if (!channel_info.Initialize(key)) { | 137 if (!channel_info.Initialize(key)) { |
| 138 channel->assign(L"unknown"); | 138 channel->assign(L"unknown"); |
| 139 return false; | 139 return false; |
| 140 } | 140 } |
| 141 | 141 |
| 142 if (!channel_info.GetChannelName(channel)) { | 142 if (!channel_info.GetChannelName(channel)) { |
| 143 channel->assign(L"unknown"); | 143 channel->assign(L"unknown"); |
| (...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 369 system_level); | 369 system_level); |
| 370 } | 370 } |
| 371 | 371 |
| 372 std::wstring GoogleUpdateSettings::GetChromeChannel(bool system_install) { | 372 std::wstring GoogleUpdateSettings::GetChromeChannel(bool system_install) { |
| 373 std::wstring channel; | 373 std::wstring channel; |
| 374 GetChromeChannelInternal(system_install, false, &channel); | 374 GetChromeChannelInternal(system_install, false, &channel); |
| 375 return channel; | 375 return channel; |
| 376 } | 376 } |
| 377 | 377 |
| 378 bool GoogleUpdateSettings::GetChromeChannelAndModifiers(bool system_install, | 378 bool GoogleUpdateSettings::GetChromeChannelAndModifiers(bool system_install, |
| 379 std::wstring* channel) { | 379 string16* channel) { |
| 380 return GetChromeChannelInternal(system_install, true, channel); | 380 return GetChromeChannelInternal(system_install, true, channel); |
| 381 } | 381 } |
| 382 | 382 |
| 383 void GoogleUpdateSettings::UpdateInstallStatus(bool system_install, | 383 void GoogleUpdateSettings::UpdateInstallStatus(bool system_install, |
| 384 installer::ArchiveType archive_type, int install_return_code, | 384 installer::ArchiveType archive_type, int install_return_code, |
| 385 const std::wstring& product_guid) { | 385 const std::wstring& product_guid) { |
| 386 DCHECK(archive_type != installer::UNKNOWN_ARCHIVE_TYPE || | 386 DCHECK(archive_type != installer::UNKNOWN_ARCHIVE_TYPE || |
| 387 install_return_code != 0); | 387 install_return_code != 0); |
| 388 HKEY reg_root = (system_install) ? HKEY_LOCAL_MACHINE : HKEY_CURRENT_USER; | 388 HKEY reg_root = (system_install) ? HKEY_LOCAL_MACHINE : HKEY_CURRENT_USER; |
| 389 | 389 |
| (...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 519 GetUpdatePolicyFromDword(value, &update_policy); | 519 GetUpdatePolicyFromDword(value, &update_policy); |
| 520 } | 520 } |
| 521 } | 521 } |
| 522 #endif // defined(GOOGLE_CHROME_BUILD) | 522 #endif // defined(GOOGLE_CHROME_BUILD) |
| 523 | 523 |
| 524 if (is_overridden != NULL) | 524 if (is_overridden != NULL) |
| 525 *is_overridden = found_override; | 525 *is_overridden = found_override; |
| 526 | 526 |
| 527 return update_policy; | 527 return update_policy; |
| 528 } | 528 } |
| OLD | NEW |