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/google_update_settings.h" | 5 #include "chrome/installer/util/google_update_settings.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
160 return false; | 160 return false; |
161 } | 161 } |
162 | 162 |
163 if (!channel_info.GetChannelName(channel)) { | 163 if (!channel_info.GetChannelName(channel)) { |
164 channel->assign(installer::kChromeChannelUnknown); | 164 channel->assign(installer::kChromeChannelUnknown); |
165 } | 165 } |
166 | 166 |
167 // Tag the channel name if this is a multi-install. | 167 // Tag the channel name if this is a multi-install. |
168 if (add_multi_modifier && channel_info.IsMultiInstall()) { | 168 if (add_multi_modifier && channel_info.IsMultiInstall()) { |
169 if (!channel->empty()) { | 169 if (!channel->empty()) { |
170 channel->append(1, L'-'); | 170 channel->push_back(L'-'); |
171 } | 171 } |
172 channel->append(1, L'm'); | 172 channel->push_back(L'm'); |
173 } | 173 } |
174 | 174 |
175 return true; | 175 return true; |
176 } | 176 } |
177 | 177 |
178 // Populates |update_policy| with the UpdatePolicy enum value corresponding to a | 178 // Populates |update_policy| with the UpdatePolicy enum value corresponding to a |
179 // DWORD read from the registry and returns true if |value| is within range. | 179 // DWORD read from the registry and returns true if |value| is within range. |
180 // If |value| is out of range, returns false without modifying |update_policy|. | 180 // If |value| is out of range, returns false without modifying |update_policy|. |
181 bool GetUpdatePolicyFromDword( | 181 bool GetUpdatePolicyFromDword( |
182 const DWORD value, | 182 const DWORD value, |
(...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
402 bool GoogleUpdateSettings::UpdateDidRunStateForDistribution( | 402 bool GoogleUpdateSettings::UpdateDidRunStateForDistribution( |
403 BrowserDistribution* dist, | 403 BrowserDistribution* dist, |
404 bool did_run, | 404 bool did_run, |
405 bool system_level) { | 405 bool system_level) { |
406 return WriteGoogleUpdateStrKeyMultiInstall(dist, | 406 return WriteGoogleUpdateStrKeyMultiInstall(dist, |
407 google_update::kRegDidRunField, | 407 google_update::kRegDidRunField, |
408 did_run ? L"1" : L"0", | 408 did_run ? L"1" : L"0", |
409 system_level); | 409 system_level); |
410 } | 410 } |
411 | 411 |
412 std::wstring GoogleUpdateSettings::GetChromeChannel(bool system_install) { | 412 base::string16 GoogleUpdateSettings::GetChromeChannel(bool system_install) { |
413 std::wstring channel; | 413 base::string16 channel; |
414 GetChromeChannelInternal(system_install, false, &channel); | 414 GetChromeChannelInternal(system_install, false, &channel); |
415 return channel; | 415 return channel; |
416 } | 416 } |
417 | 417 |
418 bool GoogleUpdateSettings::GetChromeChannelAndModifiers( | 418 bool GoogleUpdateSettings::GetChromeChannelAndModifiers( |
419 bool system_install, | 419 bool system_install, |
420 base::string16* channel) { | 420 base::string16* channel) { |
421 return GetChromeChannelInternal(system_install, true, channel); | 421 return GetChromeChannelInternal(system_install, true, channel); |
422 } | 422 } |
423 | 423 |
(...skipping 436 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
860 } | 860 } |
861 | 861 |
862 // If the key or value was not present, return the empty string. | 862 // If the key or value was not present, return the empty string. |
863 if (result == ERROR_FILE_NOT_FOUND || result == ERROR_PATH_NOT_FOUND) { | 863 if (result == ERROR_FILE_NOT_FOUND || result == ERROR_PATH_NOT_FOUND) { |
864 experiment_labels->clear(); | 864 experiment_labels->clear(); |
865 return true; | 865 return true; |
866 } | 866 } |
867 | 867 |
868 return result == ERROR_SUCCESS; | 868 return result == ERROR_SUCCESS; |
869 } | 869 } |
OLD | NEW |