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_extension_provider_impl.h" | 5 #include "chrome/browser/extensions/external_extension_provider_impl.h" |
6 | 6 |
7 #include "app/app_paths.h" | 7 #include "app/app_paths.h" |
8 #include "base/file_path.h" | 8 #include "base/file_path.h" |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "base/linked_ptr.h" | 10 #include "base/linked_ptr.h" |
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
136 | 136 |
137 scoped_ptr<Version> version; | 137 scoped_ptr<Version> version; |
138 version.reset(Version::GetVersionFromString(external_version)); | 138 version.reset(Version::GetVersionFromString(external_version)); |
139 if (!version.get()) { | 139 if (!version.get()) { |
140 LOG(WARNING) << "Malformed extension dictionary for extension: " | 140 LOG(WARNING) << "Malformed extension dictionary for extension: " |
141 << extension_id.c_str() << ". Invalid version string \"" | 141 << extension_id.c_str() << ". Invalid version string \"" |
142 << external_version << "\"."; | 142 << external_version << "\"."; |
143 continue; | 143 continue; |
144 } | 144 } |
145 service_->OnExternalExtensionFileFound(extension_id, version.get(), path, | 145 service_->OnExternalExtensionFileFound(extension_id, version.get(), path, |
146 crx_location_); | 146 crx_location_); |
147 } else { // if (has_external_update_url) | 147 } else { // if (has_external_update_url) |
148 CHECK(has_external_update_url); // Checking of keys above ensures this. | 148 CHECK(has_external_update_url); // Checking of keys above ensures this. |
149 if (download_location_ == Extension::INVALID) { | 149 if (download_location_ == Extension::INVALID) { |
150 LOG(WARNING) << "This provider does not support installing external " | 150 LOG(WARNING) << "This provider does not support installing external " |
151 << "extensions from update URLs."; | 151 << "extensions from update URLs."; |
152 continue; | 152 continue; |
153 } | 153 } |
154 GURL update_url(external_update_url); | 154 GURL update_url(external_update_url); |
155 if (!update_url.is_valid()) { | 155 if (!update_url.is_valid()) { |
156 LOG(WARNING) << "Malformed extension dictionary for extension: " | 156 LOG(WARNING) << "Malformed extension dictionary for extension: " |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
220 | 220 |
221 // static | 221 // static |
222 void ExternalExtensionProviderImpl::CreateExternalProviders( | 222 void ExternalExtensionProviderImpl::CreateExternalProviders( |
223 VisitorInterface* service, | 223 VisitorInterface* service, |
224 Profile* profile, | 224 Profile* profile, |
225 ProviderCollection* provider_list) { | 225 ProviderCollection* provider_list) { |
226 provider_list->push_back( | 226 provider_list->push_back( |
227 linked_ptr<ExternalExtensionProviderInterface>( | 227 linked_ptr<ExternalExtensionProviderInterface>( |
228 new ExternalExtensionProviderImpl( | 228 new ExternalExtensionProviderImpl( |
229 service, | 229 service, |
230 new ExternalPrefExtensionLoader(app::DIR_EXTERNAL_EXTENSIONS), | 230 new ExternalPrefExtensionLoader( |
| 231 app::DIR_EXTERNAL_EXTENSIONS), |
231 Extension::EXTERNAL_PREF, | 232 Extension::EXTERNAL_PREF, |
232 Extension::EXTERNAL_PREF_DOWNLOAD))); | 233 Extension::EXTERNAL_PREF_DOWNLOAD))); |
| 234 |
| 235 #if defined(OS_CHROMEOS) |
| 236 // Chrome OS specific source for OEM customization. |
| 237 provider_list->push_back( |
| 238 linked_ptr<ExternalExtensionProviderInterface>( |
| 239 new ExternalExtensionProviderImpl( |
| 240 service, |
| 241 new ExternalPrefExtensionLoader( |
| 242 chrome::DIR_USER_EXTERNAL_EXTENSIONS), |
| 243 Extension::EXTERNAL_PREF, |
| 244 Extension::EXTERNAL_PREF_DOWNLOAD))); |
| 245 #endif |
233 #if defined(OS_WIN) | 246 #if defined(OS_WIN) |
234 provider_list->push_back( | 247 provider_list->push_back( |
235 linked_ptr<ExternalExtensionProviderInterface>( | 248 linked_ptr<ExternalExtensionProviderInterface>( |
236 new ExternalExtensionProviderImpl( | 249 new ExternalExtensionProviderImpl( |
237 service, | 250 service, |
238 new ExternalRegistryExtensionLoader, | 251 new ExternalRegistryExtensionLoader, |
239 Extension::EXTERNAL_REGISTRY, | 252 Extension::EXTERNAL_REGISTRY, |
240 Extension::INVALID))); | 253 Extension::INVALID))); |
241 #endif | 254 #endif |
242 provider_list->push_back( | 255 provider_list->push_back( |
243 linked_ptr<ExternalExtensionProviderInterface>( | 256 linked_ptr<ExternalExtensionProviderInterface>( |
244 new ExternalExtensionProviderImpl( | 257 new ExternalExtensionProviderImpl( |
245 service, | 258 service, |
246 new ExternalPolicyExtensionLoader(profile), | 259 new ExternalPolicyExtensionLoader(profile), |
247 Extension::INVALID, | 260 Extension::INVALID, |
248 Extension::EXTERNAL_POLICY_DOWNLOAD))); | 261 Extension::EXTERNAL_POLICY_DOWNLOAD))); |
249 } | 262 } |
OLD | NEW |