From 7120f1327bcd3f0c33a983ee4a61c277747bb566 Mon Sep 17 00:00:00 2001 From: "mpcomplete@chromium.org" Date: Mon, 20 Jul 2009 21:05:37 +0000 Subject: Changed the extension.connect() API not to broadcast to all tabs. Added a more specific tabs.connect(tabId) API to connect to a specific tab. Also changed the ExtensionMessageService from a singleton to a Profile-owned object. BUG=12461 TEST=no Review URL: http://codereview.chromium.org/155707 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@21102 0039d316-1c4b-4281-b951-d872f2087c98 --- chrome/browser/profile.cc | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'chrome/browser/profile.cc') diff --git a/chrome/browser/profile.cc b/chrome/browser/profile.cc index 36517c4..9017c5f 100644 --- a/chrome/browser/profile.cc +++ b/chrome/browser/profile.cc @@ -15,6 +15,7 @@ #include "chrome/browser/browser_process.h" #include "chrome/browser/browser_theme_provider.h" #include "chrome/browser/download/download_manager.h" +#include "chrome/browser/extensions/extension_message_service.h" #include "chrome/browser/extensions/extension_process_manager.h" #include "chrome/browser/extensions/extensions_service.h" #include "chrome/browser/extensions/user_script_master.h" @@ -220,6 +221,10 @@ class OffTheRecordProfileImpl : public Profile, return NULL; } + virtual ExtensionMessageService* GetExtensionMessageService() { + return NULL; + } + virtual SSLHostState* GetSSLHostState() { if (!ssl_host_state_.get()) ssl_host_state_.reset(new SSLHostState()); @@ -499,6 +504,7 @@ ProfileImpl::ProfileImpl(const FilePath& path) &ProfileImpl::EnsureSessionServiceCreated); extension_process_manager_.reset(new ExtensionProcessManager(this)); + extension_message_service_ = new ExtensionMessageService(this); PrefService* prefs = GetPrefs(); prefs->AddPrefObserver(prefs::kSpellCheckDictionary, this); @@ -663,6 +669,8 @@ ProfileImpl::~ProfileImpl() { history_service_ = NULL; bookmark_bar_model_.reset(); + extension_message_service_->ProfileDestroyed(); + MarkAsCleanShutdown(); } @@ -715,6 +723,10 @@ ExtensionProcessManager* ProfileImpl::GetExtensionProcessManager() { return extension_process_manager_.get(); } +ExtensionMessageService* ProfileImpl::GetExtensionMessageService() { + return extension_message_service_.get(); +} + SSLHostState* ProfileImpl::GetSSLHostState() { if (!ssl_host_state_.get()) ssl_host_state_.reset(new SSLHostState()); -- cgit v1.1