Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(95)

Side by Side Diff: chrome/installer/util/google_update_settings.cc

Issue 17261014: Add support to Google Update wrappers for the "automatic updates only" group policy setting. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 7 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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
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 }
OLDNEW
« no previous file with comments | « chrome/installer/util/google_update_settings.h ('k') | chrome/installer/util/google_update_settings_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698