| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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_service.h" | 5 #include "chrome/browser/extensions/extension_service.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <iterator> | 8 #include <iterator> |
| 9 #include <set> | 9 #include <set> |
| 10 | 10 |
| (...skipping 391 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 402 blacklist, | 402 blacklist, |
| 403 update_frequency)); | 403 update_frequency)); |
| 404 } | 404 } |
| 405 | 405 |
| 406 component_loader_.reset( | 406 component_loader_.reset( |
| 407 new extensions::ComponentLoader(this, | 407 new extensions::ComponentLoader(this, |
| 408 profile->GetPrefs(), | 408 profile->GetPrefs(), |
| 409 g_browser_process->local_state())); | 409 g_browser_process->local_state())); |
| 410 | 410 |
| 411 if (extensions_enabled_) { | 411 if (extensions_enabled_) { |
| 412 CHECK(!ProfileManager::IsImportProcess(*command_line)); | |
| 413 extensions::ExternalProviderImpl::CreateExternalProviders( | 412 extensions::ExternalProviderImpl::CreateExternalProviders( |
| 414 this, profile_, &external_extension_providers_); | 413 this, profile_, &external_extension_providers_); |
| 415 } | 414 } |
| 416 | 415 |
| 417 // Set this as the ExtensionService for extension sorting to ensure it | 416 // Set this as the ExtensionService for extension sorting to ensure it |
| 418 // cause syncs if required. | 417 // cause syncs if required. |
| 419 extension_prefs_->extension_sorting()->SetExtensionService(this); | 418 extension_prefs_->extension_sorting()->SetExtensionService(this); |
| 420 | 419 |
| 421 #if defined(ENABLE_EXTENSIONS) | 420 #if defined(ENABLE_EXTENSIONS) |
| 422 extension_action_storage_manager_.reset( | 421 extension_action_storage_manager_.reset( |
| (...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 556 return NULL; | 555 return NULL; |
| 557 } | 556 } |
| 558 | 557 |
| 559 void ExtensionService::Init() { | 558 void ExtensionService::Init() { |
| 560 CHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 559 CHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| 561 | 560 |
| 562 DCHECK(!ready_); // Can't redo init. | 561 DCHECK(!ready_); // Can't redo init. |
| 563 DCHECK_EQ(extensions_.size(), 0u); | 562 DCHECK_EQ(extensions_.size(), 0u); |
| 564 | 563 |
| 565 const CommandLine* cmd_line = CommandLine::ForCurrentProcess(); | 564 const CommandLine* cmd_line = CommandLine::ForCurrentProcess(); |
| 566 | |
| 567 CHECK(!ProfileManager::IsImportProcess(*cmd_line)); | |
| 568 | |
| 569 if (cmd_line->HasSwitch(switches::kInstallFromWebstore) || | 565 if (cmd_line->HasSwitch(switches::kInstallFromWebstore) || |
| 570 cmd_line->HasSwitch(switches::kLimitedInstallFromWebstore)) { | 566 cmd_line->HasSwitch(switches::kLimitedInstallFromWebstore)) { |
| 571 // The sole purpose of this launch is to install a new extension from CWS | 567 // The sole purpose of this launch is to install a new extension from CWS |
| 572 // and immediately terminate: loading already installed extensions is | 568 // and immediately terminate: loading already installed extensions is |
| 573 // unnecessary and may interfere with the inline install dialog (e.g. if an | 569 // unnecessary and may interfere with the inline install dialog (e.g. if an |
| 574 // extension listens to onStartup and opens a window). | 570 // extension listens to onStartup and opens a window). |
| 575 SetReadyAndNotifyListeners(); | 571 SetReadyAndNotifyListeners(); |
| 576 } else { | 572 } else { |
| 577 // TODO(mek): It might be cleaner to do the FinishDelayedInstallInfo stuff | 573 // TODO(mek): It might be cleaner to do the FinishDelayedInstallInfo stuff |
| 578 // here instead of in installedloader. | 574 // here instead of in installedloader. |
| (...skipping 2511 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3090 } | 3086 } |
| 3091 | 3087 |
| 3092 void ExtensionService::AddUpdateObserver(extensions::UpdateObserver* observer) { | 3088 void ExtensionService::AddUpdateObserver(extensions::UpdateObserver* observer) { |
| 3093 update_observers_.AddObserver(observer); | 3089 update_observers_.AddObserver(observer); |
| 3094 } | 3090 } |
| 3095 | 3091 |
| 3096 void ExtensionService::RemoveUpdateObserver( | 3092 void ExtensionService::RemoveUpdateObserver( |
| 3097 extensions::UpdateObserver* observer) { | 3093 extensions::UpdateObserver* observer) { |
| 3098 update_observers_.RemoveObserver(observer); | 3094 update_observers_.RemoveObserver(observer); |
| 3099 } | 3095 } |
| OLD | NEW |