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/memory/scoped_handle.h" | 10 #include "base/memory/scoped_handle.h" |
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
139 | 139 |
140 base::string16 extension_version; | 140 base::string16 extension_version; |
141 if (key.ReadValue(kRegistryExtensionVersion, &extension_version) | 141 if (key.ReadValue(kRegistryExtensionVersion, &extension_version) |
142 != ERROR_SUCCESS) { | 142 != ERROR_SUCCESS) { |
143 // TODO(erikkay): find a way to get this into about:extensions | 143 // TODO(erikkay): find a way to get this into about:extensions |
144 LOG(ERROR) << "Missing value " << kRegistryExtensionVersion | 144 LOG(ERROR) << "Missing value " << kRegistryExtensionVersion |
145 << " for key " << key_path << "."; | 145 << " for key " << key_path << "."; |
146 continue; | 146 continue; |
147 } | 147 } |
148 | 148 |
149 Version version(WideToASCII(extension_version)); | 149 base::Version version(WideToASCII(extension_version)); |
150 if (!version.IsValid()) { | 150 if (!version.IsValid()) { |
151 LOG(ERROR) << "Invalid version value " << extension_version | 151 LOG(ERROR) << "Invalid version value " << extension_version |
152 << " for key " << key_path << "."; | 152 << " for key " << key_path << "."; |
153 continue; | 153 continue; |
154 } | 154 } |
155 | 155 |
156 prefs->SetString( | 156 prefs->SetString( |
157 id + "." + ExternalProviderImpl::kExternalVersion, | 157 id + "." + ExternalProviderImpl::kExternalVersion, |
158 WideToASCII(extension_version)); | 158 WideToASCII(extension_version)); |
159 prefs->SetString( | 159 prefs->SetString( |
160 id + "." + ExternalProviderImpl::kExternalCrx, | 160 id + "." + ExternalProviderImpl::kExternalCrx, |
161 extension_path_str); | 161 extension_path_str); |
162 } | 162 } |
163 | 163 |
164 prefs_.reset(prefs.release()); | 164 prefs_.reset(prefs.release()); |
165 HISTOGRAM_TIMES("Extensions.ExternalRegistryLoaderWin", | 165 HISTOGRAM_TIMES("Extensions.ExternalRegistryLoaderWin", |
166 base::TimeTicks::Now() - start_time); | 166 base::TimeTicks::Now() - start_time); |
167 BrowserThread::PostTask( | 167 BrowserThread::PostTask( |
168 BrowserThread::UI, FROM_HERE, | 168 BrowserThread::UI, FROM_HERE, |
169 base::Bind(&ExternalRegistryLoader::LoadFinished, this)); | 169 base::Bind(&ExternalRegistryLoader::LoadFinished, this)); |
170 } | 170 } |
171 | 171 |
172 } // namespace extensions | 172 } // namespace extensions |
OLD | NEW |