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/files/file_path.h" | 8 #include "base/files/file_path.h" |
9 #include "base/files/file_util.h" | 9 #include "base/files/file_util.h" |
10 #include "base/files/scoped_file.h" | 10 #include "base/files/scoped_file.h" |
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
157 | 157 |
158 base::string16 extension_version; | 158 base::string16 extension_version; |
159 if (key.ReadValue(kRegistryExtensionVersion, &extension_version) | 159 if (key.ReadValue(kRegistryExtensionVersion, &extension_version) |
160 != ERROR_SUCCESS) { | 160 != ERROR_SUCCESS) { |
161 // TODO(erikkay): find a way to get this into about:extensions | 161 // TODO(erikkay): find a way to get this into about:extensions |
162 LOG(ERROR) << "Missing value " << kRegistryExtensionVersion | 162 LOG(ERROR) << "Missing value " << kRegistryExtensionVersion |
163 << " for key " << key_path << "."; | 163 << " for key " << key_path << "."; |
164 continue; | 164 continue; |
165 } | 165 } |
166 | 166 |
167 base::Version version(base::UTF16ToASCII(extension_version)); | 167 Version version(base::UTF16ToASCII(extension_version)); |
168 if (!version.IsValid()) { | 168 if (!version.IsValid()) { |
169 LOG(ERROR) << "Invalid version value " << extension_version | 169 LOG(ERROR) << "Invalid version value " << extension_version |
170 << " for key " << key_path << "."; | 170 << " for key " << key_path << "."; |
171 continue; | 171 continue; |
172 } | 172 } |
173 | 173 |
174 prefs->SetString( | 174 prefs->SetString( |
175 MakePrefName(id, ExternalProviderImpl::kExternalVersion), | 175 MakePrefName(id, ExternalProviderImpl::kExternalVersion), |
176 base::UTF16ToASCII(extension_version)); | 176 base::UTF16ToASCII(extension_version)); |
177 prefs->SetString( | 177 prefs->SetString( |
178 MakePrefName(id, ExternalProviderImpl::kExternalCrx), | 178 MakePrefName(id, ExternalProviderImpl::kExternalCrx), |
179 extension_path_str); | 179 extension_path_str); |
180 prefs->SetBoolean( | 180 prefs->SetBoolean( |
181 MakePrefName(id, ExternalProviderImpl::kMayBeUntrusted), | 181 MakePrefName(id, ExternalProviderImpl::kMayBeUntrusted), |
182 true); | 182 true); |
183 } | 183 } |
184 | 184 |
185 prefs_.reset(prefs.release()); | 185 prefs_.reset(prefs.release()); |
186 LOCAL_HISTOGRAM_TIMES("Extensions.ExternalRegistryLoaderWin", | 186 LOCAL_HISTOGRAM_TIMES("Extensions.ExternalRegistryLoaderWin", |
187 base::TimeTicks::Now() - start_time); | 187 base::TimeTicks::Now() - start_time); |
188 BrowserThread::PostTask( | 188 BrowserThread::PostTask( |
189 BrowserThread::UI, FROM_HERE, | 189 BrowserThread::UI, FROM_HERE, |
190 base::Bind(&ExternalRegistryLoader::LoadFinished, this)); | 190 base::Bind(&ExternalRegistryLoader::LoadFinished, this)); |
191 } | 191 } |
192 | 192 |
193 } // namespace extensions | 193 } // namespace extensions |
OLD | NEW |