OLD | NEW |
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/browser/extensions/external_registry_loader_win.h" | 5 #include "chrome/browser/extensions/external_registry_loader_win.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/file_util.h" | 8 #include "base/file_util.h" |
9 #include "base/files/file_path.h" | 9 #include "base/files/file_path.h" |
10 #include "base/files/scoped_file.h" | 10 #include "base/files/scoped_file.h" |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
83 key_path.c_str(), KEY_READ) != ERROR_SUCCESS) { | 83 key_path.c_str(), KEY_READ) != ERROR_SUCCESS) { |
84 if (key.Open(HKEY_CURRENT_USER, | 84 if (key.Open(HKEY_CURRENT_USER, |
85 key_path.c_str(), KEY_READ) != ERROR_SUCCESS) { | 85 key_path.c_str(), KEY_READ) != ERROR_SUCCESS) { |
86 LOG(ERROR) << "Unable to read registry key at path (HKLM & HKCU): " | 86 LOG(ERROR) << "Unable to read registry key at path (HKLM & HKCU): " |
87 << key_path << "."; | 87 << key_path << "."; |
88 continue; | 88 continue; |
89 } | 89 } |
90 } | 90 } |
91 | 91 |
92 std::string id = base::UTF16ToASCII(*it); | 92 std::string id = base::UTF16ToASCII(*it); |
93 StringToLowerASCII(&id); | 93 base::StringToLowerASCII(&id); |
94 if (!Extension::IdIsValid(id)) { | 94 if (!Extension::IdIsValid(id)) { |
95 LOG(ERROR) << "Invalid id value " << id | 95 LOG(ERROR) << "Invalid id value " << id |
96 << " for key " << key_path << "."; | 96 << " for key " << key_path << "."; |
97 continue; | 97 continue; |
98 } | 98 } |
99 | 99 |
100 base::string16 extension_dist_id; | 100 base::string16 extension_dist_id; |
101 if (key.ReadValue(kRegistryExtensionInstallParam, &extension_dist_id) == | 101 if (key.ReadValue(kRegistryExtensionInstallParam, &extension_dist_id) == |
102 ERROR_SUCCESS) { | 102 ERROR_SUCCESS) { |
103 prefs->SetString(id + "." + ExternalProviderImpl::kInstallParam, | 103 prefs->SetString(id + "." + ExternalProviderImpl::kInstallParam, |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
173 | 173 |
174 prefs_.reset(prefs.release()); | 174 prefs_.reset(prefs.release()); |
175 HISTOGRAM_TIMES("Extensions.ExternalRegistryLoaderWin", | 175 HISTOGRAM_TIMES("Extensions.ExternalRegistryLoaderWin", |
176 base::TimeTicks::Now() - start_time); | 176 base::TimeTicks::Now() - start_time); |
177 BrowserThread::PostTask( | 177 BrowserThread::PostTask( |
178 BrowserThread::UI, FROM_HERE, | 178 BrowserThread::UI, FROM_HERE, |
179 base::Bind(&ExternalRegistryLoader::LoadFinished, this)); | 179 base::Bind(&ExternalRegistryLoader::LoadFinished, this)); |
180 } | 180 } |
181 | 181 |
182 } // namespace extensions | 182 } // namespace extensions |
OLD | NEW |