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 | 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 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
140 // Populates |update_policy| with the UpdatePolicy enum value corresponding to a | 140 // Populates |update_policy| with the UpdatePolicy enum value corresponding to a |
141 // DWORD read from the registry and returns true if |value| is within range. | 141 // DWORD read from the registry and returns true if |value| is within range. |
142 // If |value| is out of range, returns false without modifying |update_policy|. | 142 // If |value| is out of range, returns false without modifying |update_policy|. |
143 bool GetUpdatePolicyFromDword( | 143 bool GetUpdatePolicyFromDword( |
144 const DWORD value, | 144 const DWORD value, |
145 GoogleUpdateSettings::UpdatePolicy* update_policy) { | 145 GoogleUpdateSettings::UpdatePolicy* update_policy) { |
146 switch (value) { | 146 switch (value) { |
147 case GoogleUpdateSettings::UPDATES_DISABLED: | 147 case GoogleUpdateSettings::UPDATES_DISABLED: |
148 case GoogleUpdateSettings::AUTOMATIC_UPDATES: | 148 case GoogleUpdateSettings::AUTOMATIC_UPDATES: |
149 case GoogleUpdateSettings::MANUAL_UPDATES_ONLY: | 149 case GoogleUpdateSettings::MANUAL_UPDATES_ONLY: |
| 150 case GoogleUpdateSettings::AUTO_UPDATES_ONLY: |
150 *update_policy = static_cast<GoogleUpdateSettings::UpdatePolicy>(value); | 151 *update_policy = static_cast<GoogleUpdateSettings::UpdatePolicy>(value); |
151 return true; | 152 return true; |
152 default: | 153 default: |
153 LOG(WARNING) << "Unexpected update policy override value: " << value; | 154 LOG(WARNING) << "Unexpected update policy override value: " << value; |
154 } | 155 } |
155 return false; | 156 return false; |
156 } | 157 } |
157 | 158 |
158 } // namespace | 159 } // namespace |
159 | 160 |
(...skipping 541 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
701 } | 702 } |
702 | 703 |
703 // If the key or value was not present, return the empty string. | 704 // If the key or value was not present, return the empty string. |
704 if (result == ERROR_FILE_NOT_FOUND || result == ERROR_PATH_NOT_FOUND) { | 705 if (result == ERROR_FILE_NOT_FOUND || result == ERROR_PATH_NOT_FOUND) { |
705 experiment_labels->clear(); | 706 experiment_labels->clear(); |
706 return true; | 707 return true; |
707 } | 708 } |
708 | 709 |
709 return result == ERROR_SUCCESS; | 710 return result == ERROR_SUCCESS; |
710 } | 711 } |
OLD | NEW |