Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1235)

Unified Diff: chrome/browser/extensions/extension_function_dispatcher.cc

Issue 10021071: Remove Browser dependency in ExtensionFunctionDispatcher (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 8 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/extensions/extension_function_dispatcher.cc
diff --git a/chrome/browser/extensions/extension_function_dispatcher.cc b/chrome/browser/extensions/extension_function_dispatcher.cc
index 78aa9d767869f923c748778b5a4c59cde034b8c2..8a435bd1645286009ffa03d3e435f56fa105015e 100644
--- a/chrome/browser/extensions/extension_function_dispatcher.cc
+++ b/chrome/browser/extensions/extension_function_dispatcher.cc
@@ -22,8 +22,6 @@
#include "chrome/browser/external_protocol/external_protocol_handler.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/renderer_host/chrome_render_message_filter.h"
-#include "chrome/browser/ui/browser_list.h"
-#include "chrome/browser/ui/browser_window.h"
#include "chrome/common/extensions/api/extension_api.h"
#include "chrome/common/extensions/extension_messages.h"
#include "chrome/common/extensions/extension_set.h"
@@ -165,32 +163,6 @@ ExtensionFunctionDispatcher::ExtensionFunctionDispatcher(Profile* profile,
ExtensionFunctionDispatcher::~ExtensionFunctionDispatcher() {
}
-Browser* ExtensionFunctionDispatcher::GetCurrentBrowser(
- RenderViewHost* render_view_host, bool include_incognito) {
- Browser* browser = delegate_->GetBrowser();
-
- // If the delegate has an associated browser, that is always the right answer.
- if (browser)
- return browser;
-
- // Otherwise, try to default to a reasonable browser. If |include_incognito|
- // is true, we will also search browsers in the incognito version of this
- // profile. Note that the profile may already be incognito, in which case
- // we will search the incognito version only, regardless of the value of
- // |include_incognito|.
- Profile* profile = Profile::FromBrowserContext(
- render_view_host->GetProcess()->GetBrowserContext());
- browser = BrowserList::FindAnyBrowser(profile, include_incognito);
-
- // NOTE(rafaelw): This can return NULL in some circumstances. In particular,
- // a background_page onload chrome.tabs api call can make it into here
- // before the browser is sufficiently initialized to return here.
- // A similar situation may arise during shutdown.
- // TODO(rafaelw): Delay creation of background_page until the browser
- // is available. http://code.google.com/p/chromium/issues/detail?id=13284
- return browser;
-}
-
void ExtensionFunctionDispatcher::Dispatch(
const ExtensionHostMsg_Request_Params& params,
RenderViewHost* render_view_host) {

Powered by Google App Engine
This is Rietveld 408576698