| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 <windows.h> | 10 #include <windows.h> |
| (...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 146 } | 146 } |
| 147 } | 147 } |
| 148 | 148 |
| 149 // Checks if the current registry entry exists in HKLM registry and the value | 149 // Checks if the current registry entry exists in HKLM registry and the value |
| 150 // is same. | 150 // is same. |
| 151 bool ExistsInHKLM() { | 151 bool ExistsInHKLM() { |
| 152 RegKey key(HKEY_LOCAL_MACHINE, _key_path.c_str()); | 152 RegKey key(HKEY_LOCAL_MACHINE, _key_path.c_str()); |
| 153 bool found = false; | 153 bool found = false; |
| 154 if (_is_string) { | 154 if (_is_string) { |
| 155 std::wstring read_value; | 155 std::wstring read_value; |
| 156 found = key.ReadValue(_name.c_str(), &read_value) && | 156 found = (key.ReadValue(_name.c_str(), &read_value)) && |
| 157 read_value == _value; | 157 (read_value.size() == _value.size()) && |
| 158 (std::equal(_value.begin(), _value.end(), read_value.begin(), |
| 159 CaseInsensitiveCompare<wchar_t>())); |
| 158 } else { | 160 } else { |
| 159 DWORD read_value; | 161 DWORD read_value; |
| 160 found = key.ReadValueDW(_name.c_str(), &read_value) && | 162 found = key.ReadValueDW(_name.c_str(), &read_value) && |
| 161 read_value == _int_value; | 163 read_value == _int_value; |
| 162 } | 164 } |
| 163 key.Close(); | 165 key.Close(); |
| 164 return found; | 166 return found; |
| 165 } | 167 } |
| 166 | 168 |
| 167 // Checks if the current registry entry exists in HKLM registry | 169 // Checks if the current registry entry exists in HKLM registry |
| (...skipping 532 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 700 } else { | 702 } else { |
| 701 return file_util::UpdateShortcutLink(chrome_exe.c_str(), // target | 703 return file_util::UpdateShortcutLink(chrome_exe.c_str(), // target |
| 702 shortcut.c_str(), // shortcut | 704 shortcut.c_str(), // shortcut |
| 703 chrome_path.c_str(), // working dir | 705 chrome_path.c_str(), // working dir |
| 704 NULL, // arguments | 706 NULL, // arguments |
| 705 description.c_str(), // description | 707 description.c_str(), // description |
| 706 chrome_exe.c_str(), // icon file | 708 chrome_exe.c_str(), // icon file |
| 707 0); // icon index | 709 0); // icon index |
| 708 } | 710 } |
| 709 } | 711 } |
| OLD | NEW |