| 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 #include "chrome/installer/util/channel_info.h" | 5 #include "chrome/installer/util/channel_info.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "base/win/registry.h" | 8 #include "base/win/registry.h" |
| 9 #include "chrome/installer/util/google_update_constants.h" | 9 #include "chrome/installer/util/google_update_constants.h" |
| 10 | 10 |
| (...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 109 } | 109 } |
| 110 } | 110 } |
| 111 return false; | 111 return false; |
| 112 } | 112 } |
| 113 | 113 |
| 114 } // namespace | 114 } // namespace |
| 115 | 115 |
| 116 namespace installer { | 116 namespace installer { |
| 117 | 117 |
| 118 bool ChannelInfo::Initialize(const RegKey& key) { | 118 bool ChannelInfo::Initialize(const RegKey& key) { |
| 119 return key.ReadValue(google_update::kRegApField, &value_); | 119 return key.ReadValue(google_update::kRegApField, &value_) == ERROR_SUCCESS; |
| 120 } | 120 } |
| 121 | 121 |
| 122 bool ChannelInfo::Write(RegKey* key) const { | 122 bool ChannelInfo::Write(RegKey* key) const { |
| 123 return key->WriteValue(google_update::kRegApField, value_.c_str()); | 123 LONG result = key->WriteValue(google_update::kRegApField, value_.c_str()); |
| 124 return result == ERROR_SUCCESS; |
| 124 } | 125 } |
| 125 | 126 |
| 126 bool ChannelInfo::GetChannelName(std::wstring* channel_name) const { | 127 bool ChannelInfo::GetChannelName(std::wstring* channel_name) const { |
| 127 DCHECK(channel_name); | 128 DCHECK(channel_name); |
| 128 if (value_.empty()) { | 129 if (value_.empty()) { |
| 129 channel_name->erase(); | 130 channel_name->erase(); |
| 130 return true; | 131 return true; |
| 131 } else { | 132 } else { |
| 132 for (const wchar_t* const* scan = &kChannels[0], | 133 for (const wchar_t* const* scan = &kChannels[0], |
| 133 *const* end = &kChannels[arraysize(kChannels)]; scan != end; | 134 *const* end = &kChannels[arraysize(kChannels)]; scan != end; |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 202 | 203 |
| 203 bool ChannelInfo::HasMultiFailSuffix() const { | 204 bool ChannelInfo::HasMultiFailSuffix() const { |
| 204 return HasModifier(SFX_MULTI_FAIL, value_); | 205 return HasModifier(SFX_MULTI_FAIL, value_); |
| 205 } | 206 } |
| 206 | 207 |
| 207 bool ChannelInfo::SetMultiFailSuffix(bool value) { | 208 bool ChannelInfo::SetMultiFailSuffix(bool value) { |
| 208 return SetModifier(SFX_MULTI_FAIL, value, &value_); | 209 return SetModifier(SFX_MULTI_FAIL, value, &value_); |
| 209 } | 210 } |
| 210 | 211 |
| 211 } // namespace installer | 212 } // namespace installer |
| OLD | NEW |