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

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

Issue 3836005: Move pe_image and registry from base to base/win and use the namespace. It re... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 10 years, 2 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) 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/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/registry.h"
11 #include "base/string_number_conversions.h" 10 #include "base/string_number_conversions.h"
12 #include "base/string_util.h" 11 #include "base/string_util.h"
13 #include "base/time.h" 12 #include "base/time.h"
13 #include "base/win/registry.h"
14 #include "chrome/common/chrome_switches.h" 14 #include "chrome/common/chrome_switches.h"
15 #include "chrome/installer/util/browser_distribution.h" 15 #include "chrome/installer/util/browser_distribution.h"
16 #include "chrome/installer/util/google_update_constants.h" 16 #include "chrome/installer/util/google_update_constants.h"
17 #include "chrome/installer/util/install_util.h" 17 #include "chrome/installer/util/install_util.h"
18 18
19 using base::win::RegKey;
20
19 namespace { 21 namespace {
20 22
21 bool ReadGoogleUpdateStrKey(const wchar_t* const name, std::wstring* value) { 23 bool ReadGoogleUpdateStrKey(const wchar_t* const name, std::wstring* value) {
22 BrowserDistribution* dist = BrowserDistribution::GetDistribution(); 24 BrowserDistribution* dist = BrowserDistribution::GetDistribution();
23 std::wstring reg_path = dist->GetStateKey(); 25 std::wstring reg_path = dist->GetStateKey();
24 RegKey key(HKEY_CURRENT_USER, reg_path.c_str(), KEY_READ); 26 RegKey key(HKEY_CURRENT_USER, reg_path.c_str(), KEY_READ);
25 if (!key.ReadValue(name, value)) { 27 if (!key.ReadValue(name, value)) {
26 RegKey hklm_key(HKEY_LOCAL_MACHINE, reg_path.c_str(), KEY_READ); 28 RegKey hklm_key(HKEY_LOCAL_MACHINE, reg_path.c_str(), KEY_READ);
27 return hklm_key.ReadValue(name, value); 29 return hklm_key.ReadValue(name, value);
28 } 30 }
(...skipping 256 matching lines...) Expand 10 before | Expand all | Expand 10 after
285 }; 287 };
286 const wchar_t** end = &kBrands[arraysize(kBrands)]; 288 const wchar_t** end = &kBrands[arraysize(kBrands)];
287 const wchar_t** found = std::find(&kBrands[0], end, brand); 289 const wchar_t** found = std::find(&kBrands[0], end, brand);
288 if (found != end) 290 if (found != end)
289 return true; 291 return true;
290 if (StartsWith(brand, L"EUB", true) || StartsWith(brand, L"EUC", true) || 292 if (StartsWith(brand, L"EUB", true) || StartsWith(brand, L"EUC", true) ||
291 StartsWith(brand, L"GGR", true)) 293 StartsWith(brand, L"GGR", true))
292 return true; 294 return true;
293 return false; 295 return false;
294 } 296 }
OLDNEW
« no previous file with comments | « chrome/installer/util/google_chrome_distribution.cc ('k') | chrome/installer/util/google_update_settings_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698