Remove Profile dependency from ExtensionFunction
This instead creates new variants of ExtensionFunction for Chrome APIs,
which need Profile, and uses them for any API that needs to access
Profiles.
[email protected]
BUG=297942
Review URL: https://codereview.chromium.org/35893010
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@231406 0039d316-1c4b-4281-b951-d872f2087c98
diff --git a/chrome/browser/extensions/api/debugger/debugger_api.cc b/chrome/browser/extensions/api/debugger/debugger_api.cc
index 32abf2eb..2c49d80 100644
--- a/chrome/browser/extensions/api/debugger/debugger_api.cc
+++ b/chrome/browser/extensions/api/debugger/debugger_api.cc
@@ -487,9 +487,13 @@
bool DebuggerFunction::InitAgentHost() {
if (debuggee_.tab_id) {
WebContents* web_contents = NULL;
- bool result = ExtensionTabUtil::GetTabById(
- *debuggee_.tab_id, profile(), include_incognito(), NULL, NULL,
- &web_contents, NULL);
+ bool result = ExtensionTabUtil::GetTabById(*debuggee_.tab_id,
+ GetProfile(),
+ include_incognito(),
+ NULL,
+ NULL,
+ &web_contents,
+ NULL);
if (result && web_contents) {
if (content::HasWebUIScheme(web_contents->GetURL())) {
error_ = ErrorUtils::FormatErrorMessage(
@@ -502,8 +506,9 @@
}
} else if (debuggee_.extension_id) {
extensions::ExtensionHost* extension_host =
- extensions::ExtensionSystem::Get(profile())->process_manager()->
- GetBackgroundHostForExtension(*debuggee_.extension_id);
+ extensions::ExtensionSystem::Get(GetProfile())
+ ->process_manager()
+ ->GetBackgroundHostForExtension(*debuggee_.extension_id);
if (extension_host) {
agent_host_ = DevToolsAgentHost::GetOrCreateFor(
extension_host->render_view_host());
@@ -581,9 +586,12 @@
}
}
- new ExtensionDevToolsClientHost(profile(), agent_host_.get(),
- GetExtension()->id(), GetExtension()->name(),
- debuggee_, infobar);
+ new ExtensionDevToolsClientHost(GetProfile(),
+ agent_host_.get(),
+ GetExtension()->id(),
+ GetExtension()->name(),
+ debuggee_,
+ infobar);
SendResponse(true);
return true;
}