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

Unified Diff: chrome/browser/google/google_update.cc

Issue 7111012: Return a new error code for multi-install updates if Group Policy settings blocking... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/app/google_chrome_strings.grd ('k') | chrome/installer/setup/setup_main.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/google/google_update.cc
===================================================================
--- chrome/browser/google/google_update.cc (revision 89207)
+++ chrome/browser/google/google_update.cc (working copy)
@@ -13,11 +13,10 @@
#include "base/string_util.h"
#include "base/task.h"
#include "base/threading/thread.h"
-#include "base/win/registry.h"
#include "base/win/scoped_comptr.h"
#include "base/win/windows_version.h"
#include "chrome/installer/util/browser_distribution.h"
-#include "chrome/installer/util/google_update_constants.h"
+#include "chrome/installer/util/google_update_settings.h"
#include "chrome/installer/util/helper.h"
#include "chrome/installer/util/install_util.h"
#include "content/browser/browser_thread.h"
@@ -26,35 +25,9 @@
namespace {
-// The registry location of the Google Update policies.
-const wchar_t kGUPolicyRegistrySubKey[] =
- L"SOFTWARE\\Policies\\Google\\Update";
-const wchar_t kGUPolicyGlobalValue[] = L"UpdateDefault";
-const wchar_t kGUPolicyAppValuePrefix[] = L"Update";
-const DWORD kGUPolicyUpdatesDisabled = 0;
-
-// Checks if the updates have been disabled by policy.
-bool IsUpdateDisabledByPolicy(const std::wstring& guid) {
-#if !defined(GOOGLE_CHROME_BUILD)
- return true;
-#else
- std::wstring value_name(kGUPolicyAppValuePrefix);
- value_name.append(guid);
- DWORD value = 0;
- base::win::RegKey policy(HKEY_LOCAL_MACHINE,
- kGUPolicyRegistrySubKey, KEY_READ);
- // Per application settings override global setting.
- if ((policy.ReadValueDW(value_name.c_str(), &value) == ERROR_SUCCESS) ||
- (policy.ReadValueDW(kGUPolicyGlobalValue, &value) == ERROR_SUCCESS)) {
- return value == kGUPolicyUpdatesDisabled;
- }
- return false;
-#endif // defined(GOOGLE_CHROME_BUILD)
-}
-
// Check if the currently running instance can be updated by Google Update.
-// Returns true only if the instance running is a Google Chrome
-// distribution installed in a standard location.
+// Returns GOOGLE_UPDATE_NO_ERROR only if the instance running is a Google
+// Chrome distribution installed in a standard location.
GoogleUpdateErrorCode CanUpdateCurrentChrome(
const std::wstring& chrome_exe_path) {
#if !defined(GOOGLE_CHROME_BUILD)
@@ -84,7 +57,8 @@
!InstallUtil::IsPerUserInstall(chrome_exe_path.c_str()));
DCHECK(!app_guid.empty());
- if (IsUpdateDisabledByPolicy(app_guid))
+ if (GoogleUpdateSettings::GetAppUpdatePolicy(app_guid, NULL) ==
+ GoogleUpdateSettings::UPDATES_DISABLED)
return GOOGLE_UPDATE_DISABLED_BY_POLICY;
return GOOGLE_UPDATE_NO_ERROR;
« no previous file with comments | « chrome/app/google_chrome_strings.grd ('k') | chrome/installer/setup/setup_main.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698