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

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

Issue 616173003: Allow Registry Iterator functions to use a specified WOW64 mode when iterating. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 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
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 // This file defines functions that integrate Chrome in Windows shell. These 5 // This file defines functions that integrate Chrome in Windows shell. These
6 // functions can be used by Chrome as well as Chrome installer. All of the 6 // functions can be used by Chrome as well as Chrome installer. All of the
7 // work is done by the local functions defined in anonymous namespace in 7 // work is done by the local functions defined in anonymous namespace in
8 // this class. 8 // this class.
9 9
10 #include "chrome/installer/util/shell_util.h" 10 #include "chrome/installer/util/shell_util.h"
(...skipping 1635 matching lines...) Expand 10 before | Expand all | Expand 10 after
1646 base::string16 client_path; 1646 base::string16 client_path;
1647 RegKey key; 1647 RegKey key;
1648 base::string16 name; 1648 base::string16 name;
1649 base::string16 command; 1649 base::string16 command;
1650 1650
1651 // HKCU has precedence over HKLM for these registrations: http://goo.gl/xjczJ. 1651 // HKCU has precedence over HKLM for these registrations: http://goo.gl/xjczJ.
1652 // Look in HKCU second to override any identical values found in HKLM. 1652 // Look in HKCU second to override any identical values found in HKLM.
1653 const HKEY roots[] = { HKEY_LOCAL_MACHINE, HKEY_CURRENT_USER }; 1653 const HKEY roots[] = { HKEY_LOCAL_MACHINE, HKEY_CURRENT_USER };
1654 for (int i = 0; i < arraysize(roots); ++i) { 1654 for (int i = 0; i < arraysize(roots); ++i) {
1655 const HKEY root = roots[i]; 1655 const HKEY root = roots[i];
1656 for (base::win::RegistryKeyIterator iter(root, base_key.c_str()); 1656 for (base::win::RegistryKeyIterator iter(root, base_key.c_str(), 0);
1657 iter.Valid(); ++iter) { 1657 iter.Valid();
1658 ++iter) {
1658 client_path.assign(base_key).append(1, L'\\').append(iter.Name()); 1659 client_path.assign(base_key).append(1, L'\\').append(iter.Name());
1659 // Read the browser's name (localized according to install language). 1660 // Read the browser's name (localized according to install language).
1660 if (key.Open(root, client_path.c_str(), 1661 if (key.Open(root, client_path.c_str(),
1661 KEY_QUERY_VALUE) != ERROR_SUCCESS || 1662 KEY_QUERY_VALUE) != ERROR_SUCCESS ||
1662 key.ReadValue(NULL, &name) != ERROR_SUCCESS || 1663 key.ReadValue(NULL, &name) != ERROR_SUCCESS ||
1663 name.empty() || 1664 name.empty() ||
1664 name.find(dist->GetBaseAppName()) != base::string16::npos) { 1665 name.find(dist->GetBaseAppName()) != base::string16::npos) {
1665 continue; 1666 continue;
1666 } 1667 }
1667 // Read the browser's reinstall command. 1668 // Read the browser's reinstall command.
(...skipping 617 matching lines...) Expand 10 before | Expand all | Expand 10 after
2285 // are any left...). 2286 // are any left...).
2286 if (free_bits >= 8 && next_byte_index < size) { 2287 if (free_bits >= 8 && next_byte_index < size) {
2287 free_bits -= 8; 2288 free_bits -= 8;
2288 bit_stream += bytes[next_byte_index++] << free_bits; 2289 bit_stream += bytes[next_byte_index++] << free_bits;
2289 } 2290 }
2290 } 2291 }
2291 2292
2292 DCHECK_EQ(ret.length(), encoded_length); 2293 DCHECK_EQ(ret.length(), encoded_length);
2293 return ret; 2294 return ret;
2294 } 2295 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698