From 89ebc7edb982ebf5f8b185aa6e3aae6904eed965 Mon Sep 17 00:00:00 2001 From: "mpcomplete@chromium.org" Date: Mon, 24 Aug 2009 22:11:07 +0000 Subject: Exposes a chrome.devtools object to extensions. This allows extensions to call chrome.devtools.connect() to open up a Port by which it can receive devtools messages to implement the proposed perf trace extensions API documented here: http://code.google.com/p/chromium/wiki/ExtensionsPerfTraceAPI Review URL: http://codereview.chromium.org/159882 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@24158 0039d316-1c4b-4281-b951-d872f2087c98 --- chrome/browser/profile.cc | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'chrome/browser/profile.cc') diff --git a/chrome/browser/profile.cc b/chrome/browser/profile.cc index 0e473315..77d4ff1 100644 --- a/chrome/browser/profile.cc +++ b/chrome/browser/profile.cc @@ -14,6 +14,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_devtools_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" @@ -220,6 +221,10 @@ class OffTheRecordProfileImpl : public Profile, return profile_->GetUserScriptMaster(); } + virtual ExtensionDevToolsManager* GetExtensionDevToolsManager() { + return NULL; + } + virtual ExtensionProcessManager* GetExtensionProcessManager() { return NULL; } @@ -494,6 +499,7 @@ class OffTheRecordProfileImpl : public Profile, ProfileImpl::ProfileImpl(const FilePath& path) : path_(path), visited_link_event_listener_(new VisitedLinkEventListener()), + extension_devtools_manager_(NULL), request_context_(NULL), media_request_context_(NULL), extensions_request_context_(NULL), @@ -512,6 +518,11 @@ ProfileImpl::ProfileImpl(const FilePath& path) TimeDelta::FromMilliseconds(kCreateSessionServiceDelayMS), this, &ProfileImpl::EnsureSessionServiceCreated); + if (CommandLine::ForCurrentProcess()->HasSwitch( + switches::kEnableExtensionTimelineApi)) { + extension_devtools_manager_ = new ExtensionDevToolsManager(this); + } + extension_process_manager_.reset(new ExtensionProcessManager(this)); extension_message_service_ = new ExtensionMessageService(this); @@ -744,6 +755,10 @@ UserScriptMaster* ProfileImpl::GetUserScriptMaster() { return user_script_master_.get(); } +ExtensionDevToolsManager* ProfileImpl::GetExtensionDevToolsManager() { + return extension_devtools_manager_.get(); +} + ExtensionProcessManager* ProfileImpl::GetExtensionProcessManager() { return extension_process_manager_.get(); } -- cgit v1.1