| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/extension_system_impl.h" | 5 #include "chrome/browser/extensions/extension_system_impl.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "base/base_switches.h" | 9 #include "base/base_switches.h" |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 226 extension_service_->component_loader()-> | 226 extension_service_->component_loader()-> |
| 227 AddDefaultComponentExtensionsForKioskMode(skip_session_extensions); | 227 AddDefaultComponentExtensionsForKioskMode(skip_session_extensions); |
| 228 } else { | 228 } else { |
| 229 extension_service_->component_loader()->AddDefaultComponentExtensions( | 229 extension_service_->component_loader()->AddDefaultComponentExtensions( |
| 230 skip_session_extensions); | 230 skip_session_extensions); |
| 231 } | 231 } |
| 232 #else | 232 #else |
| 233 extension_service_->component_loader()->AddDefaultComponentExtensions( | 233 extension_service_->component_loader()->AddDefaultComponentExtensions( |
| 234 skip_session_extensions); | 234 skip_session_extensions); |
| 235 #endif | 235 #endif |
| 236 if (command_line->HasSwitch(switches::kLoadComponentExtension)) { | |
| 237 base::CommandLine::StringType path_list = | |
| 238 command_line->GetSwitchValueNative(switches::kLoadComponentExtension); | |
| 239 base::StringTokenizerT<base::CommandLine::StringType, | |
| 240 base::CommandLine::StringType::const_iterator> | |
| 241 t(path_list, FILE_PATH_LITERAL(",")); | |
| 242 while (t.GetNext()) { | |
| 243 // Load the component extension manifest synchronously. | |
| 244 // Blocking the UI thread is acceptable here since | |
| 245 // this flag designated for developers. | |
| 246 base::ThreadRestrictions::ScopedAllowIO allow_io; | |
| 247 extension_service_->component_loader()->AddOrReplace( | |
| 248 base::FilePath(t.token())); | |
| 249 } | |
| 250 } | |
| 251 | 236 |
| 252 app_sorting_.reset(new ChromeAppSorting(profile_)); | 237 app_sorting_.reset(new ChromeAppSorting(profile_)); |
| 253 | 238 |
| 254 InitInstallGates(); | 239 InitInstallGates(); |
| 255 | 240 |
| 256 extension_service_->Init(); | 241 extension_service_->Init(); |
| 257 | 242 |
| 258 // Make sure ExtensionSyncService is created. | 243 // Make sure ExtensionSyncService is created. |
| 259 ExtensionSyncService::Get(profile_); | 244 ExtensionSyncService::Get(profile_); |
| 260 | 245 |
| (...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 448 void ExtensionSystemImpl::UnregisterExtensionWithRequestContexts( | 433 void ExtensionSystemImpl::UnregisterExtensionWithRequestContexts( |
| 449 const std::string& extension_id, | 434 const std::string& extension_id, |
| 450 const UnloadedExtensionInfo::Reason reason) { | 435 const UnloadedExtensionInfo::Reason reason) { |
| 451 BrowserThread::PostTask( | 436 BrowserThread::PostTask( |
| 452 BrowserThread::IO, | 437 BrowserThread::IO, |
| 453 FROM_HERE, | 438 FROM_HERE, |
| 454 base::Bind(&InfoMap::RemoveExtension, info_map(), extension_id, reason)); | 439 base::Bind(&InfoMap::RemoveExtension, info_map(), extension_id, reason)); |
| 455 } | 440 } |
| 456 | 441 |
| 457 } // namespace extensions | 442 } // namespace extensions |
| OLD | NEW |