| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_extension_loader_win.h" | 5 #include "chrome/browser/extensions/external_registry_extension_loader_win.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/file_path.h" | 8 #include "base/file_path.h" |
| 9 #include "base/file_util.h" | 9 #include "base/file_util.h" |
| 10 #include "base/memory/scoped_handle.h" | 10 #include "base/memory/scoped_handle.h" |
| (...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 113 if (key.ReadValue(kRegistryExtensionVersion, &extension_version) | 113 if (key.ReadValue(kRegistryExtensionVersion, &extension_version) |
| 114 != ERROR_SUCCESS) { | 114 != ERROR_SUCCESS) { |
| 115 // TODO(erikkay): find a way to get this into about:extensions | 115 // TODO(erikkay): find a way to get this into about:extensions |
| 116 LOG(ERROR) << "Missing value " << kRegistryExtensionVersion | 116 LOG(ERROR) << "Missing value " << kRegistryExtensionVersion |
| 117 << " for key " << key_path << "."; | 117 << " for key " << key_path << "."; |
| 118 continue; | 118 continue; |
| 119 } | 119 } |
| 120 | 120 |
| 121 std::string id = WideToASCII(*it); | 121 std::string id = WideToASCII(*it); |
| 122 StringToLowerASCII(&id); | 122 StringToLowerASCII(&id); |
| 123 if (!Extension::IdIsValid(id)) { | 123 if (!extensions::Extension::IdIsValid(id)) { |
| 124 LOG(ERROR) << "Invalid id value " << id | 124 LOG(ERROR) << "Invalid id value " << id |
| 125 << " for key " << key_path << "."; | 125 << " for key " << key_path << "."; |
| 126 continue; | 126 continue; |
| 127 } | 127 } |
| 128 | 128 |
| 129 scoped_ptr<Version> version; | 129 scoped_ptr<Version> version; |
| 130 version.reset(Version::GetVersionFromString( | 130 version.reset(Version::GetVersionFromString( |
| 131 WideToASCII(extension_version))); | 131 WideToASCII(extension_version))); |
| 132 if (!version.get()) { | 132 if (!version.get()) { |
| 133 LOG(ERROR) << "Invalid version value " << extension_version | 133 LOG(ERROR) << "Invalid version value " << extension_version |
| 134 << " for key " << key_path << "."; | 134 << " for key " << key_path << "."; |
| 135 continue; | 135 continue; |
| 136 } | 136 } |
| 137 | 137 |
| 138 prefs->SetString( | 138 prefs->SetString( |
| 139 id + "." + ExternalExtensionProviderImpl::kExternalVersion, | 139 id + "." + ExternalExtensionProviderImpl::kExternalVersion, |
| 140 WideToASCII(extension_version)); | 140 WideToASCII(extension_version)); |
| 141 prefs->SetString( | 141 prefs->SetString( |
| 142 id + "." + ExternalExtensionProviderImpl::kExternalCrx, | 142 id + "." + ExternalExtensionProviderImpl::kExternalCrx, |
| 143 extension_path_str); | 143 extension_path_str); |
| 144 } | 144 } |
| 145 | 145 |
| 146 prefs_.reset(prefs.release()); | 146 prefs_.reset(prefs.release()); |
| 147 BrowserThread::PostTask( | 147 BrowserThread::PostTask( |
| 148 BrowserThread::UI, FROM_HERE, | 148 BrowserThread::UI, FROM_HERE, |
| 149 base::Bind(&ExternalRegistryExtensionLoader::LoadFinished, this)); | 149 base::Bind(&ExternalRegistryExtensionLoader::LoadFinished, this)); |
| 150 } | 150 } |
| OLD | NEW |