diff options
author | mpcomplete@chromium.org <mpcomplete@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-04-05 00:23:24 +0000 |
---|---|---|
committer | mpcomplete@chromium.org <mpcomplete@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-04-05 00:23:24 +0000 |
commit | 749d59a04b22c1233af7e969bfd3b65ccb99fdab (patch) | |
tree | ed280ea67e5c14fdfb2f3d00675e2826104e66ac | |
parent | a13283ccd0eef981bd92b5ba3b78c7d1b4a678f5 (diff) | |
download | chromium_src-749d59a04b22c1233af7e969bfd3b65ccb99fdab.zip chromium_src-749d59a04b22c1233af7e969bfd3b65ccb99fdab.tar.gz chromium_src-749d59a04b22c1233af7e969bfd3b65ccb99fdab.tar.bz2 |
Add ExtensionSytem::Get(Profile*) as a wrapper around
ExtensionSystemFactory::GetForProfile. Switch callsites to use that.
BUG=104095
TEST=no
TBR=akalin
TBR=mirandac
TBR=jrg
TBR=arv
Review URL: https://chromiumcodereview.appspot.com/9977021
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@130785 0039d316-1c4b-4281-b951-d872f2087c98
27 files changed, 65 insertions, 81 deletions
diff --git a/chrome/browser/automation/automation_provider.cc b/chrome/browser/automation/automation_provider.cc index 89119a8..26a5792 100644 --- a/chrome/browser/automation/automation_provider.cc +++ b/chrome/browser/automation/automation_provider.cc @@ -47,7 +47,6 @@ #include "chrome/browser/extensions/extension_message_service.h" #include "chrome/browser/extensions/extension_service.h" #include "chrome/browser/extensions/extension_system.h" -#include "chrome/browser/extensions/extension_system_factory.h" #include "chrome/browser/extensions/extension_tab_util.h" #include "chrome/browser/extensions/extension_toolbar_model.h" #include "chrome/browser/extensions/unpacked_installer.h" @@ -929,7 +928,7 @@ void AutomationProvider::ExecuteExtensionActionInActiveTabAsync( const Extension* extension = GetEnabledExtension(extension_handle); ExtensionService* service = profile_->GetExtensionService(); ExtensionMessageService* message_service = - ExtensionSystemFactory::GetForProfile(profile_)->message_service(); + ExtensionSystem::Get(profile_)->message_service(); Browser* browser = browser_tracker_->GetResource(browser_handle); if (extension && service && message_service && browser) { int tab_id = ExtensionTabUtil::GetTabId(browser->GetSelectedWebContents()); diff --git a/chrome/browser/chrome_content_browser_client.cc b/chrome/browser/chrome_content_browser_client.cc index 2685100..0068ed8 100644 --- a/chrome/browser/chrome_content_browser_client.cc +++ b/chrome/browser/chrome_content_browser_client.cc @@ -32,7 +32,6 @@ #include "chrome/browser/extensions/extension_process_manager.h" #include "chrome/browser/extensions/extension_service.h" #include "chrome/browser/extensions/extension_system.h" -#include "chrome/browser/extensions/extension_system_factory.h" #include "chrome/browser/extensions/extension_web_ui.h" #include "chrome/browser/extensions/extension_webkit_preferences.h" #include "chrome/browser/geolocation/chrome_access_token_store.h" @@ -634,7 +633,7 @@ void ChromeContentBrowserClient::SiteInstanceGotProcess( BrowserThread::PostTask( BrowserThread::IO, FROM_HERE, base::Bind(&ExtensionInfoMap::RegisterExtensionProcess, - ExtensionSystemFactory::GetForProfile(profile)->info_map(), + ExtensionSystem::Get(profile)->info_map(), extension->id(), site_instance->GetProcess()->GetID(), site_instance->GetId())); @@ -663,7 +662,7 @@ void ChromeContentBrowserClient::SiteInstanceDeleting( BrowserThread::PostTask( BrowserThread::IO, FROM_HERE, base::Bind(&ExtensionInfoMap::UnregisterExtensionProcess, - ExtensionSystemFactory::GetForProfile(profile)->info_map(), + ExtensionSystem::Get(profile)->info_map(), extension->id(), site_instance->GetProcess()->GetID(), site_instance->GetId())); diff --git a/chrome/browser/extensions/extension_devtools_bridge.cc b/chrome/browser/extensions/extension_devtools_bridge.cc index 2abf5bd..18b14bc 100644 --- a/chrome/browser/extensions/extension_devtools_bridge.cc +++ b/chrome/browser/extensions/extension_devtools_bridge.cc @@ -13,7 +13,6 @@ #include "chrome/browser/extensions/extension_devtools_manager.h" #include "chrome/browser/extensions/extension_event_router.h" #include "chrome/browser/extensions/extension_system.h" -#include "chrome/browser/extensions/extension_system_factory.h" #include "chrome/browser/extensions/extension_tab_util.h" #include "chrome/browser/profiles/profile.h" #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" @@ -35,7 +34,7 @@ ExtensionDevToolsBridge::ExtensionDevToolsBridge(int tab_id, on_tab_close_event_name_( ExtensionDevToolsEvents::OnTabCloseEventNameForTab(tab_id)) { extension_devtools_manager_ = - ExtensionSystemFactory::GetForProfile(profile)->devtools_manager(); + ExtensionSystem::Get(profile)->devtools_manager(); DCHECK(extension_devtools_manager_.get()); } diff --git a/chrome/browser/extensions/extension_event_router.cc b/chrome/browser/extensions/extension_event_router.cc index fae37af..d73c6b9 100644 --- a/chrome/browser/extensions/extension_event_router.cc +++ b/chrome/browser/extensions/extension_event_router.cc @@ -16,7 +16,6 @@ #include "chrome/browser/extensions/extension_processes_api_constants.h" #include "chrome/browser/extensions/extension_service.h" #include "chrome/browser/extensions/extension_system.h" -#include "chrome/browser/extensions/extension_system_factory.h" #include "chrome/browser/extensions/extension_tabs_module.h" #include "chrome/browser/extensions/lazy_background_task_queue.h" #include "chrome/browser/extensions/process_map.h" @@ -104,7 +103,7 @@ void ExtensionEventRouter::DispatchEvent(IPC::Message::Sender* ipc_sender, ExtensionEventRouter::ExtensionEventRouter(Profile* profile) : profile_(profile), extension_devtools_manager_( - ExtensionSystemFactory::GetForProfile(profile)->devtools_manager()) { + ExtensionSystem::Get(profile)->devtools_manager()) { registrar_.Add(this, content::NOTIFICATION_RENDERER_PROCESS_TERMINATED, content::NotificationService::AllSources()); registrar_.Add(this, content::NOTIFICATION_RENDERER_PROCESS_CLOSED, @@ -396,8 +395,7 @@ void ExtensionEventRouter::MaybeLoadLazyBackgroundPage( return; LazyBackgroundTaskQueue* queue = - ExtensionSystemFactory::GetForProfile(profile)-> - lazy_background_task_queue(); + ExtensionSystem::Get(profile)->lazy_background_task_queue(); if (queue->ShouldEnqueueTask(profile, extension)) { queue->AddPendingTask( profile, extension->id(), diff --git a/chrome/browser/extensions/extension_message_handler.cc b/chrome/browser/extensions/extension_message_handler.cc index d55538e..5a57fbd 100644 --- a/chrome/browser/extensions/extension_message_handler.cc +++ b/chrome/browser/extensions/extension_message_handler.cc @@ -6,7 +6,6 @@ #include "chrome/browser/extensions/extension_message_service.h" #include "chrome/browser/extensions/extension_system.h" -#include "chrome/browser/extensions/extension_system_factory.h" #include "chrome/browser/profiles/profile.h" #include "chrome/common/extensions/extension_messages.h" #include "content/public/browser/render_process_host.h" @@ -41,7 +40,7 @@ void ExtensionMessageHandler::OnPostMessage(int port_id, Profile* profile = Profile::FromBrowserContext( render_view_host()->GetProcess()->GetBrowserContext()); ExtensionMessageService* message_service = - ExtensionSystemFactory::GetForProfile(profile)->message_service(); + ExtensionSystem::Get(profile)->message_service(); if (message_service) { message_service->PostMessageFromRenderer(port_id, message); } diff --git a/chrome/browser/extensions/extension_service.cc b/chrome/browser/extensions/extension_service.cc index c2e6101..766dcf7 100644 --- a/chrome/browser/extensions/extension_service.cc +++ b/chrome/browser/extensions/extension_service.cc @@ -55,7 +55,6 @@ #include "chrome/browser/extensions/extension_special_storage_policy.h" #include "chrome/browser/extensions/extension_sync_data.h" #include "chrome/browser/extensions/extension_system.h" -#include "chrome/browser/extensions/extension_system_factory.h" #include "chrome/browser/extensions/extension_web_ui.h" #include "chrome/browser/extensions/external_extension_provider_impl.h" #include "chrome/browser/extensions/external_extension_provider_interface.h" @@ -379,7 +378,7 @@ ExtensionService::ExtensionService(Profile* profile, bool autoupdate_enabled, bool extensions_enabled) : profile_(profile), - system_(ExtensionSystemFactory::GetForProfile(profile)), + system_(ExtensionSystem::Get(profile)), extension_prefs_(extension_prefs), settings_frontend_(extensions::SettingsFrontend::Create(profile)), pending_extension_manager_(*ALLOW_THIS_IN_INITIALIZER_LIST(this)), diff --git a/chrome/browser/extensions/extension_service_unittest.cc b/chrome/browser/extensions/extension_service_unittest.cc index 2ed4b66..3546a47 100644 --- a/chrome/browser/extensions/extension_service_unittest.cc +++ b/chrome/browser/extensions/extension_service_unittest.cc @@ -37,7 +37,6 @@ #include "chrome/browser/extensions/extension_special_storage_policy.h" #include "chrome/browser/extensions/extension_sync_data.h" #include "chrome/browser/extensions/extension_system.h" -#include "chrome/browser/extensions/extension_system_factory.h" #include "chrome/browser/extensions/external_extension_provider_impl.h" #include "chrome/browser/extensions/external_extension_provider_interface.h" #include "chrome/browser/extensions/external_pref_extension_loader.h" @@ -422,7 +421,7 @@ void ExtensionServiceTestBase::InitializeExtensionService( profile_.reset(profile); service_ = static_cast<TestExtensionSystem*>( - ExtensionSystemFactory::GetForProfile(profile))->CreateExtensionService( + ExtensionSystem::Get(profile))->CreateExtensionService( CommandLine::ForCurrentProcess(), extensions_install_dir, autoupdate_enabled); @@ -462,7 +461,7 @@ void ExtensionServiceTestBase::InitializeEmptyExtensionService() { void ExtensionServiceTestBase::InitializeExtensionProcessManager() { static_cast<TestExtensionSystem*>( - ExtensionSystemFactory::GetForProfile(profile_.get()))-> + ExtensionSystem::Get(profile_.get()))-> CreateExtensionProcessManager(); } @@ -3855,7 +3854,7 @@ TEST(ExtensionServiceTestSimple, Enabledness) { // By default, we are enabled. command_line.reset(new CommandLine(CommandLine::NO_PROGRAM)); ExtensionService* service = static_cast<TestExtensionSystem*>( - ExtensionSystemFactory::GetForProfile(profile.get()))-> + ExtensionSystem::Get(profile.get()))-> CreateExtensionService( command_line.get(), install_dir, @@ -3870,7 +3869,7 @@ TEST(ExtensionServiceTestSimple, Enabledness) { profile.reset(new TestingProfile()); command_line->AppendSwitch(switches::kDisableExtensions); service = static_cast<TestExtensionSystem*>( - ExtensionSystemFactory::GetForProfile(profile.get()))-> + ExtensionSystem::Get(profile.get()))-> CreateExtensionService( command_line.get(), install_dir, @@ -3884,7 +3883,7 @@ TEST(ExtensionServiceTestSimple, Enabledness) { profile.reset(new TestingProfile()); profile->GetPrefs()->SetBoolean(prefs::kDisableExtensions, true); service = static_cast<TestExtensionSystem*>( - ExtensionSystemFactory::GetForProfile(profile.get()))-> + ExtensionSystem::Get(profile.get()))-> CreateExtensionService( command_line.get(), install_dir, @@ -3899,7 +3898,7 @@ TEST(ExtensionServiceTestSimple, Enabledness) { profile->GetPrefs()->SetBoolean(prefs::kDisableExtensions, true); command_line.reset(new CommandLine(CommandLine::NO_PROGRAM)); service = static_cast<TestExtensionSystem*>( - ExtensionSystemFactory::GetForProfile(profile.get()))-> + ExtensionSystem::Get(profile.get()))-> CreateExtensionService( command_line.get(), install_dir, diff --git a/chrome/browser/extensions/extension_system.cc b/chrome/browser/extensions/extension_system.cc index 6e4da65..c72ad64 100644 --- a/chrome/browser/extensions/extension_system.cc +++ b/chrome/browser/extensions/extension_system.cc @@ -46,6 +46,11 @@ ExtensionSystem::ExtensionSystem() { ExtensionSystem::~ExtensionSystem() { } +// static +ExtensionSystem* ExtensionSystem::Get(Profile* profile) { + return ExtensionSystemFactory::GetForProfile(profile); +} + // // ExtensionSystemImpl::Shared // diff --git a/chrome/browser/extensions/extension_system.h b/chrome/browser/extensions/extension_system.h index 3ed5002..bc1f52a 100644 --- a/chrome/browser/extensions/extension_system.h +++ b/chrome/browser/extensions/extension_system.h @@ -37,6 +37,10 @@ class ExtensionSystem : public ProfileKeyedService { ExtensionSystem(); virtual ~ExtensionSystem(); + // Returns the instance for the given profile, or NULL if none. This is + // a convenience wrapper around ExtensionSystemFactory::GetForProfile. + static ExtensionSystem* Get(Profile* profile); + // ProfileKeyedService implementation. virtual void Shutdown() OVERRIDE {} diff --git a/chrome/browser/extensions/extension_system_factory.cc b/chrome/browser/extensions/extension_system_factory.cc index 956e735..80d4cde 100644 --- a/chrome/browser/extensions/extension_system_factory.cc +++ b/chrome/browser/extensions/extension_system_factory.cc @@ -52,8 +52,7 @@ bool ExtensionSystemSharedFactory::ServiceRedirectedInIncognito() { // ExtensionSystemFactory // static -ExtensionSystem* ExtensionSystemFactory::GetForProfile( - Profile* profile) { +ExtensionSystem* ExtensionSystemFactory::GetForProfile(Profile* profile) { return static_cast<ExtensionSystem*>( GetInstance()->GetServiceForProfile(profile, true)); } diff --git a/chrome/browser/extensions/updater/extension_updater_unittest.cc b/chrome/browser/extensions/updater/extension_updater_unittest.cc index 6892bc4..080c74b 100644 --- a/chrome/browser/extensions/updater/extension_updater_unittest.cc +++ b/chrome/browser/extensions/updater/extension_updater_unittest.cc @@ -21,7 +21,6 @@ #include "chrome/browser/extensions/extension_error_reporter.h" #include "chrome/browser/extensions/extension_sync_data.h" #include "chrome/browser/extensions/extension_system.h" -#include "chrome/browser/extensions/extension_system_factory.h" #include "chrome/browser/extensions/test_extension_prefs.h" #include "chrome/browser/extensions/test_extension_service.h" #include "chrome/browser/extensions/test_extension_system.h" @@ -987,13 +986,13 @@ class ExtensionUpdaterTest : public testing::Test { // the CrxInstaller actions we want. TestingProfile profile; static_cast<TestExtensionSystem*>( - ExtensionSystemFactory::GetForProfile(&profile))-> + ExtensionSystem::Get(&profile))-> CreateExtensionService( CommandLine::ForCurrentProcess(), FilePath(), false); ExtensionService* extension_service = - ExtensionSystemFactory::GetForProfile(&profile)->extension_service(); + ExtensionSystem::Get(&profile)->extension_service(); extension_service->set_extensions_enabled(true); extension_service->set_show_extensions_prompts(false); diff --git a/chrome/browser/profiles/off_the_record_profile_impl.cc b/chrome/browser/profiles/off_the_record_profile_impl.cc index c40dca4..c22c132 100644 --- a/chrome/browser/profiles/off_the_record_profile_impl.cc +++ b/chrome/browser/profiles/off_the_record_profile_impl.cc @@ -27,7 +27,6 @@ #include "chrome/browser/extensions/extension_service.h" #include "chrome/browser/extensions/extension_special_storage_policy.h" #include "chrome/browser/extensions/extension_system.h" -#include "chrome/browser/extensions/extension_system_factory.h" #include "chrome/browser/io_thread.h" #include "chrome/browser/net/proxy_service_factory.h" #include "chrome/browser/plugin_prefs.h" @@ -123,7 +122,7 @@ OffTheRecordProfileImpl::~OffTheRecordProfileImpl() { io_data_.GetResourceContextNoInit()); ExtensionService* extension_service = - ExtensionSystemFactory::GetForProfile(this)->extension_service(); + ExtensionSystem::Get(this)->extension_service(); if (extension_service && extension_service->extensions_enabled()) { extension_service->extension_prefs()-> ClearIncognitoSessionOnlyContentSettings(); @@ -198,20 +197,20 @@ ExtensionPrefValueMap* OffTheRecordProfileImpl::GetExtensionPrefValueMap() { } ExtensionService* OffTheRecordProfileImpl::GetExtensionService() { - return ExtensionSystemFactory::GetForProfile(this)->extension_service(); + return ExtensionSystem::Get(this)->extension_service(); } UserScriptMaster* OffTheRecordProfileImpl::GetUserScriptMaster() { - return ExtensionSystemFactory::GetForProfile(this)->user_script_master(); + return ExtensionSystem::Get(this)->user_script_master(); } ExtensionProcessManager* OffTheRecordProfileImpl::GetExtensionProcessManager() { - return ExtensionSystemFactory::GetForProfile(this)->process_manager(); + return ExtensionSystem::Get(this)->process_manager(); } ExtensionEventRouter* OffTheRecordProfileImpl::GetExtensionEventRouter() { - return ExtensionSystemFactory::GetForProfile(this)->event_router(); + return ExtensionSystem::Get(this)->event_router(); } ExtensionSpecialStoragePolicy* diff --git a/chrome/browser/profiles/profile.h b/chrome/browser/profiles/profile.h index 19a1357..446b508 100644 --- a/chrome/browser/profiles/profile.h +++ b/chrome/browser/profiles/profile.h @@ -211,26 +211,26 @@ class Profile : public content::BrowserContext { // TODO(yoz): make this a ProfileKeyedService. virtual ExtensionPrefValueMap* GetExtensionPrefValueMap() = 0; - // DEPRECATED. Instead, use ExtensionSystemFactory::extension_service(). + // DEPRECATED. Instead, use ExtensionSystem::extension_service(). // Retrieves a pointer to the ExtensionService associated with this // profile. The ExtensionService is created at startup. // TODO(yoz): remove this accessor (bug 104095). virtual ExtensionService* GetExtensionService() = 0; - // DEPRECATED. Instead, use ExtensionSystemFactory::user_script_master(). + // DEPRECATED. Instead, use ExtensionSystem::user_script_master(). // Retrieves a pointer to the UserScriptMaster associated with this // profile. The UserScriptMaster is lazily created the first time // that this method is called. // TODO(yoz): remove this accessor (bug 104095). virtual UserScriptMaster* GetUserScriptMaster() = 0; - // DEPRECATED. Instead, use ExtensionSystemFactory::process_manager(). + // DEPRECATED. Instead, use ExtensionSystem::process_manager(). // Retrieves a pointer to the ExtensionProcessManager associated with this // profile. The instance is created at startup. // TODO(yoz): remove this accessor (bug 104095). virtual ExtensionProcessManager* GetExtensionProcessManager() = 0; - // DEPRECATED. Instead, use ExtensionSystemFactory::event_router(). + // DEPRECATED. Instead, use ExtensionSystem::event_router(). // Accessor. The instance is created at startup. // TODO(yoz): remove this accessor (bug 104095). virtual ExtensionEventRouter* GetExtensionEventRouter() = 0; diff --git a/chrome/browser/profiles/profile_impl.cc b/chrome/browser/profiles/profile_impl.cc index 0ebfc01..b8a7a26 100644 --- a/chrome/browser/profiles/profile_impl.cc +++ b/chrome/browser/profiles/profile_impl.cc @@ -35,7 +35,6 @@ #include "chrome/browser/extensions/extension_service.h" #include "chrome/browser/extensions/extension_special_storage_policy.h" #include "chrome/browser/extensions/extension_system.h" -#include "chrome/browser/extensions/extension_system_factory.h" #include "chrome/browser/extensions/user_script_master.h" #include "chrome/browser/favicon/favicon_service.h" #include "chrome/browser/geolocation/chrome_geolocation_permission_context.h" @@ -580,19 +579,19 @@ VisitedLinkMaster* ProfileImpl::GetVisitedLinkMaster() { } ExtensionService* ProfileImpl::GetExtensionService() { - return ExtensionSystemFactory::GetForProfile(this)->extension_service(); + return ExtensionSystem::Get(this)->extension_service(); } UserScriptMaster* ProfileImpl::GetUserScriptMaster() { - return ExtensionSystemFactory::GetForProfile(this)->user_script_master(); + return ExtensionSystem::Get(this)->user_script_master(); } ExtensionProcessManager* ProfileImpl::GetExtensionProcessManager() { - return ExtensionSystemFactory::GetForProfile(this)->process_manager(); + return ExtensionSystem::Get(this)->process_manager(); } ExtensionEventRouter* ProfileImpl::GetExtensionEventRouter() { - return ExtensionSystemFactory::GetForProfile(this)->event_router(); + return ExtensionSystem::Get(this)->event_router(); } ExtensionSpecialStoragePolicy* @@ -684,7 +683,7 @@ net::URLRequestContextGetter* ProfileImpl::GetRequestContext() { net::URLRequestContextGetter* ProfileImpl::GetRequestContextForRenderProcess( int renderer_child_id) { ExtensionService* extension_service = - ExtensionSystemFactory::GetForProfile(this)->extension_service(); + ExtensionSystem::Get(this)->extension_service(); if (extension_service) { const Extension* installed_app = extension_service-> GetInstalledAppForRenderer(renderer_child_id); diff --git a/chrome/browser/profiles/profile_io_data.cc b/chrome/browser/profiles/profile_io_data.cc index 1a4c1a7..f145154 100644 --- a/chrome/browser/profiles/profile_io_data.cc +++ b/chrome/browser/profiles/profile_io_data.cc @@ -25,7 +25,6 @@ #include "chrome/browser/extensions/extension_info_map.h" #include "chrome/browser/extensions/extension_protocols.h" #include "chrome/browser/extensions/extension_system.h" -#include "chrome/browser/extensions/extension_system_factory.h" #include "chrome/browser/io_thread.h" #include "chrome/browser/net/chrome_cookie_notification_details.h" #include "chrome/browser/net/chrome_fraudulent_certificate_reporter.h" @@ -198,7 +197,7 @@ void ProfileIOData::InitializeOnUIThread(Profile* profile) { params->cookie_monster_delegate = new ChromeCookieMonsterDelegate(profile_getter); params->extension_info_map = - ExtensionSystemFactory::GetForProfile(profile)->info_map(); + ExtensionSystem::Get(profile)->info_map(); #if defined(ENABLE_NOTIFICATIONS) params->notification_service = diff --git a/chrome/browser/profiles/profile_manager.cc b/chrome/browser/profiles/profile_manager.cc index 84ecbd8..ecef874 100644 --- a/chrome/browser/profiles/profile_manager.cc +++ b/chrome/browser/profiles/profile_manager.cc @@ -19,7 +19,6 @@ #include "chrome/browser/extensions/default_apps_trial.h" #include "chrome/browser/extensions/extension_service.h" #include "chrome/browser/extensions/extension_system.h" -#include "chrome/browser/extensions/extension_system_factory.h" #include "chrome/browser/managed_mode.h" #include "chrome/browser/prefs/pref_service.h" #include "chrome/browser/prefs/scoped_user_pref_update.h" @@ -641,7 +640,7 @@ void ProfileManager::DoFinalInit(Profile* profile, bool go_off_the_record) { void ProfileManager::DoFinalInitForServices(Profile* profile, bool go_off_the_record) { const CommandLine& command_line = *CommandLine::ForCurrentProcess(); - ExtensionSystemFactory::GetForProfile(profile)->Init(!go_off_the_record); + ExtensionSystem::Get(profile)->Init(!go_off_the_record); if (!command_line.HasSwitch(switches::kDisableWebResources)) profile->InitPromoResources(); } diff --git a/chrome/browser/renderer_host/chrome_render_message_filter.cc b/chrome/browser/renderer_host/chrome_render_message_filter.cc index 2e04e39..4f1c1eb 100644 --- a/chrome/browser/renderer_host/chrome_render_message_filter.cc +++ b/chrome/browser/renderer_host/chrome_render_message_filter.cc @@ -19,7 +19,6 @@ #include "chrome/browser/extensions/extension_process_manager.h" #include "chrome/browser/extensions/extension_service.h" #include "chrome/browser/extensions/extension_system.h" -#include "chrome/browser/extensions/extension_system_factory.h" #include "chrome/browser/metrics/histogram_synchronizer.h" #include "chrome/browser/nacl_host/nacl_process_host.h" #include "chrome/browser/net/chrome_url_request_context.h" @@ -56,8 +55,7 @@ ChromeRenderMessageFilter::ChromeRenderMessageFilter( : render_process_id_(render_process_id), profile_(profile), request_context_(request_context), - extension_info_map_( - ExtensionSystemFactory::GetForProfile(profile)->info_map()), + extension_info_map_(ExtensionSystem::Get(profile)->info_map()), cookie_settings_(CookieSettings::Factory::GetForProfile(profile)), weak_ptr_factory_(ALLOW_THIS_IN_INITIALIZER_LIST(this)) { } @@ -277,7 +275,7 @@ void ChromeRenderMessageFilter::OpenChannelToExtensionOnUIThread( const std::string& target_extension_id, const std::string& channel_name) { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); - ExtensionSystemFactory::GetForProfile(profile_)->message_service()-> + ExtensionSystem::Get(profile_)->message_service()-> OpenChannelToExtension( source_process_id, source_routing_id, receiver_port_id, source_extension_id, target_extension_id, channel_name); @@ -303,7 +301,7 @@ void ChromeRenderMessageFilter::OpenChannelToTabOnUIThread( const std::string& extension_id, const std::string& channel_name) { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); - ExtensionSystemFactory::GetForProfile(profile_)->message_service()-> + ExtensionSystem::Get(profile_)->message_service()-> OpenChannelToTab( source_process_id, source_routing_id, receiver_port_id, tab_id, extension_id, channel_name); @@ -396,7 +394,7 @@ void ChromeRenderMessageFilter::OnExtensionCloseChannel(int port_id, return; // To guard against crash in browser_tests shutdown. ExtensionMessageService* message_service = - ExtensionSystemFactory::GetForProfile(profile_)->message_service(); + ExtensionSystem::Get(profile_)->message_service(); if (message_service) message_service->CloseChannel(port_id, connection_error); } @@ -427,9 +425,9 @@ void ChromeRenderMessageFilter::OnExtensionUnloadAck( void ChromeRenderMessageFilter::OnExtensionIncrementLazyKeepaliveCount( const std::string& extension_id) { ExtensionService* service = - ExtensionSystemFactory::GetForProfile(profile_)->extension_service(); + ExtensionSystem::Get(profile_)->extension_service(); ExtensionProcessManager* process_manager = - ExtensionSystemFactory::GetForProfile(profile_)->process_manager(); + ExtensionSystem::Get(profile_)->process_manager(); if (process_manager && service) { const Extension* extension = service->extensions()->GetByID(extension_id); if (extension) @@ -440,9 +438,9 @@ void ChromeRenderMessageFilter::OnExtensionIncrementLazyKeepaliveCount( void ChromeRenderMessageFilter::OnExtensionDecrementLazyKeepaliveCount( const std::string& extension_id) { ExtensionService* service = - ExtensionSystemFactory::GetForProfile(profile_)->extension_service(); + ExtensionSystem::Get(profile_)->extension_service(); ExtensionProcessManager* process_manager = - ExtensionSystemFactory::GetForProfile(profile_)->process_manager(); + ExtensionSystem::Get(profile_)->process_manager(); if (process_manager && service) { const Extension* extension = service->extensions()->GetByID(extension_id); if (extension) diff --git a/chrome/browser/sync/glue/extension_data_type_controller.cc b/chrome/browser/sync/glue/extension_data_type_controller.cc index 303546b..9adb5b6 100644 --- a/chrome/browser/sync/glue/extension_data_type_controller.cc +++ b/chrome/browser/sync/glue/extension_data_type_controller.cc @@ -6,7 +6,6 @@ #include "base/metrics/histogram.h" #include "chrome/browser/extensions/extension_system.h" -#include "chrome/browser/extensions/extension_system_factory.h" #include "chrome/browser/profiles/profile.h" #include "chrome/browser/sync/profile_sync_components_factory.h" @@ -29,7 +28,7 @@ ExtensionDataTypeController::~ExtensionDataTypeController() { } bool ExtensionDataTypeController::StartModels() { - ExtensionSystemFactory::GetForProfile(profile_)->Init(true); + ExtensionSystem::Get(profile_)->Init(true); return true; } diff --git a/chrome/browser/sync/glue/extension_setting_data_type_controller.cc b/chrome/browser/sync/glue/extension_setting_data_type_controller.cc index 9f60544..352d4c7 100644 --- a/chrome/browser/sync/glue/extension_setting_data_type_controller.cc +++ b/chrome/browser/sync/glue/extension_setting_data_type_controller.cc @@ -8,7 +8,6 @@ #include "base/metrics/histogram.h" #include "chrome/browser/extensions/extension_service.h" #include "chrome/browser/extensions/extension_system.h" -#include "chrome/browser/extensions/extension_system_factory.h" #include "chrome/browser/profiles/profile.h" #include "chrome/browser/sync/api/syncable_service.h" #include "chrome/browser/sync/glue/generic_change_processor.h" @@ -55,7 +54,7 @@ bool ExtensionSettingDataTypeController::PostTaskOnBackendThread( bool ExtensionSettingDataTypeController::StartModels() { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); - ExtensionSystemFactory::GetForProfile(profile_)->Init(true); + ExtensionSystem::Get(profile_)->Init(true); return true; } diff --git a/chrome/browser/sync/glue/theme_data_type_controller.cc b/chrome/browser/sync/glue/theme_data_type_controller.cc index 20047ea..c8af597 100644 --- a/chrome/browser/sync/glue/theme_data_type_controller.cc +++ b/chrome/browser/sync/glue/theme_data_type_controller.cc @@ -6,7 +6,6 @@ #include "base/metrics/histogram.h" #include "chrome/browser/extensions/extension_system.h" -#include "chrome/browser/extensions/extension_system_factory.h" #include "chrome/browser/profiles/profile.h" #include "chrome/browser/sync/profile_sync_components_factory.h" @@ -29,7 +28,7 @@ syncable::ModelType ThemeDataTypeController::type() const { } bool ThemeDataTypeController::StartModels() { - ExtensionSystemFactory::GetForProfile(profile_)->Init(true); + ExtensionSystem::Get(profile_)->Init(true); return true; } diff --git a/chrome/browser/sync/profile_sync_components_factory_impl.cc b/chrome/browser/sync/profile_sync_components_factory_impl.cc index f20a54c..3d45609 100644 --- a/chrome/browser/sync/profile_sync_components_factory_impl.cc +++ b/chrome/browser/sync/profile_sync_components_factory_impl.cc @@ -87,7 +87,7 @@ ProfileSyncComponentsFactoryImpl::ProfileSyncComponentsFactoryImpl( : profile_(profile), command_line_(command_line), extension_system_( - ExtensionSystemFactory::GetForProfile(profile)) { + ExtensionSystem::Get(profile)) { } void ProfileSyncComponentsFactoryImpl::RegisterDataTypes( diff --git a/chrome/browser/sync/test/integration/sync_app_helper.cc b/chrome/browser/sync/test/integration/sync_app_helper.cc index aa63718..efa61c7 100644 --- a/chrome/browser/sync/test/integration/sync_app_helper.cc +++ b/chrome/browser/sync/test/integration/sync_app_helper.cc @@ -6,7 +6,6 @@ #include "chrome/browser/extensions/extension_service.h" #include "chrome/browser/extensions/extension_system.h" -#include "chrome/browser/extensions/extension_system_factory.h" #include "chrome/browser/extensions/extension_sorting.h" #include "chrome/browser/profiles/profile.h" #include "chrome/browser/sync/test/integration/extensions_helper.h" @@ -94,9 +93,9 @@ void SyncAppHelper::SetupIfNecessary(SyncTest* test) { return; for (int i = 0; i < test->num_clients(); ++i) { - ExtensionSystemFactory::GetForProfile(test->GetProfile(i))->Init(true); + ExtensionSystem::Get(test->GetProfile(i))->Init(true); } - ExtensionSystemFactory::GetForProfile(test->verifier())->Init(true); + ExtensionSystem::Get(test->verifier())->Init(true); setup_completed_ = true; } diff --git a/chrome/browser/sync/test/integration/sync_extension_helper.cc b/chrome/browser/sync/test/integration/sync_extension_helper.cc index d3e3a3e..f1d8b77 100644 --- a/chrome/browser/sync/test/integration/sync_extension_helper.cc +++ b/chrome/browser/sync/test/integration/sync_extension_helper.cc @@ -10,7 +10,6 @@ #include "base/values.h" #include "chrome/browser/extensions/extension_service.h" #include "chrome/browser/extensions/extension_system.h" -#include "chrome/browser/extensions/extension_system_factory.h" #include "chrome/browser/extensions/pending_extension_info.h" #include "chrome/browser/extensions/pending_extension_manager.h" #include "chrome/browser/profiles/profile.h" @@ -241,7 +240,7 @@ bool SyncExtensionHelper::ExtensionStatesMatch( } void SyncExtensionHelper::SetupProfile(Profile* profile) { - ExtensionSystemFactory::GetForProfile(profile)->Init(true); + ExtensionSystem::Get(profile)->Init(true); profile_extensions_.insert(make_pair(profile, ExtensionNameMap())); } diff --git a/chrome/browser/translate/translate_manager_browsertest.cc b/chrome/browser/translate/translate_manager_browsertest.cc index 7e11c9e..42586d8 100644 --- a/chrome/browser/translate/translate_manager_browsertest.cc +++ b/chrome/browser/translate/translate_manager_browsertest.cc @@ -13,7 +13,6 @@ #include "base/utf_string_conversions.h" #include "base/values.h" #include "chrome/app/chrome_command_ids.h" -#include "chrome/browser/extensions/extension_system_factory.h" #include "chrome/browser/extensions/test_extension_system.h" #include "chrome/browser/infobars/infobar.h" #include "chrome/browser/infobars/infobar_tab_helper.h" @@ -1350,7 +1349,7 @@ TEST_F(TranslateManagerTest, BeforeTranslateExtraButtons) { TestingProfile* test_profile = static_cast<TestingProfile*>(contents()->GetBrowserContext()); static_cast<TestExtensionSystem*>( - ExtensionSystemFactory::GetForProfile(test_profile))-> + ExtensionSystem::Get(test_profile))-> CreateExtensionProcessManager(); test_profile->set_incognito(true); for (int i = 0; i < 8; ++i) { diff --git a/chrome/browser/ui/cocoa/bookmarks/bookmark_bar_controller_unittest.mm b/chrome/browser/ui/cocoa/bookmarks/bookmark_bar_controller_unittest.mm index 23e6ac0f..f63f659 100644 --- a/chrome/browser/ui/cocoa/bookmarks/bookmark_bar_controller_unittest.mm +++ b/chrome/browser/ui/cocoa/bookmarks/bookmark_bar_controller_unittest.mm @@ -13,7 +13,6 @@ #include "base/utf_string_conversions.h" #include "chrome/browser/bookmarks/bookmark_model.h" #include "chrome/browser/bookmarks/bookmark_utils.h" -#include "chrome/browser/extensions/extension_system_factory.h" #include "chrome/browser/extensions/test_extension_system.h" #import "chrome/browser/ui/cocoa/animation_utils.h" #import "chrome/browser/ui/cocoa/bookmarks/bookmark_bar_constants.h" @@ -275,7 +274,7 @@ class BookmarkBarControllerTestBase : public CocoaProfileTest { FilePath extension_dir; static_cast<TestExtensionSystem*>( - ExtensionSystemFactory::GetForProfile(profile()))-> + ExtensionSystem::Get(profile()))-> CreateExtensionService( CommandLine::ForCurrentProcess(), extension_dir, false); diff --git a/chrome/browser/ui/webui/extensions/extension_settings_handler.cc b/chrome/browser/ui/webui/extensions/extension_settings_handler.cc index a1c9073..47abbb9 100644 --- a/chrome/browser/ui/webui/extensions/extension_settings_handler.cc +++ b/chrome/browser/ui/webui/extensions/extension_settings_handler.cc @@ -20,7 +20,6 @@ #include "chrome/browser/extensions/extension_host.h" #include "chrome/browser/extensions/extension_service.h" #include "chrome/browser/extensions/extension_system.h" -#include "chrome/browser/extensions/extension_system_factory.h" #include "chrome/browser/extensions/extension_warning_set.h" #include "chrome/browser/extensions/lazy_background_task_queue.h" #include "chrome/browser/extensions/unpacked_installer.h" @@ -529,8 +528,7 @@ void ExtensionSettingsHandler::HandleInspectMessage(const ListValue* args) { ExtensionProcessManager* pm = profile->GetExtensionProcessManager(); LazyBackgroundTaskQueue* queue = - ExtensionSystemFactory::GetForProfile(profile)-> - lazy_background_task_queue(); + ExtensionSystem::Get(profile)->lazy_background_task_queue(); ExtensionHost* host = pm->GetBackgroundHostForExtension(extension->id()); if (host) { diff --git a/chrome/test/base/testing_profile.cc b/chrome/test/base/testing_profile.cc index c6783ae..076f27d 100644 --- a/chrome/test/base/testing_profile.cc +++ b/chrome/test/base/testing_profile.cc @@ -440,19 +440,19 @@ ExtensionPrefValueMap* TestingProfile::GetExtensionPrefValueMap() { } ExtensionService* TestingProfile::GetExtensionService() { - return ExtensionSystemFactory::GetForProfile(this)->extension_service(); + return ExtensionSystem::Get(this)->extension_service(); } UserScriptMaster* TestingProfile::GetUserScriptMaster() { - return ExtensionSystemFactory::GetForProfile(this)->user_script_master(); + return ExtensionSystem::Get(this)->user_script_master(); } ExtensionProcessManager* TestingProfile::GetExtensionProcessManager() { - return ExtensionSystemFactory::GetForProfile(this)->process_manager(); + return ExtensionSystem::Get(this)->process_manager(); } ExtensionEventRouter* TestingProfile::GetExtensionEventRouter() { - return ExtensionSystemFactory::GetForProfile(this)->event_router(); + return ExtensionSystem::Get(this)->event_router(); } void TestingProfile::SetExtensionSpecialStoragePolicy( @@ -548,7 +548,7 @@ net::URLRequestContextGetter* TestingProfile::GetRequestContext() { net::URLRequestContextGetter* TestingProfile::GetRequestContextForRenderProcess( int renderer_child_id) { ExtensionService* extension_service = - ExtensionSystemFactory::GetForProfile(this)->extension_service(); + ExtensionSystem::Get(this)->extension_service(); if (extension_service) { const Extension* installed_app = extension_service-> GetInstalledAppForRenderer(renderer_child_id); |