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

Unified Diff: extensions/browser/extension_function_dispatcher.cc

Issue 1169223002: [Extensions] Clean up the handling of ExtensionHostMsg_Request (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Latest master Created 5 years, 6 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: extensions/browser/extension_function_dispatcher.cc
diff --git a/extensions/browser/extension_function_dispatcher.cc b/extensions/browser/extension_function_dispatcher.cc
index e682701bc3f257d7ac950e4d1b376dfe3b16def7..7458159653186005ad5432b17c8139122b3de6f2 100644
--- a/extensions/browser/extension_function_dispatcher.cc
+++ b/extensions/browser/extension_function_dispatcher.cc
@@ -205,12 +205,12 @@ class ExtensionFunctionDispatcher::UIThreadResponseCallbackWrapper
WindowController*
ExtensionFunctionDispatcher::Delegate::GetExtensionWindowController() const {
- return NULL;
+ return nullptr;
}
content::WebContents*
ExtensionFunctionDispatcher::Delegate::GetAssociatedWebContents() const {
- return NULL;
+ return nullptr;
}
content::WebContents*
@@ -301,10 +301,8 @@ void ExtensionFunctionDispatcher::DispatchOnIOThread(
}
ExtensionFunctionDispatcher::ExtensionFunctionDispatcher(
- content::BrowserContext* browser_context,
- Delegate* delegate)
- : browser_context_(browser_context),
- delegate_(delegate) {
+ content::BrowserContext* browser_context)
+ : browser_context_(browser_context) {
}
ExtensionFunctionDispatcher::~ExtensionFunctionDispatcher() {
@@ -440,6 +438,22 @@ void ExtensionFunctionDispatcher::OnExtensionFunctionCompleted(
}
}
+WindowController*
+ExtensionFunctionDispatcher::GetExtensionWindowController() const {
+ return delegate_ ? delegate_->GetExtensionWindowController() : nullptr;
+}
+
+content::WebContents*
+ExtensionFunctionDispatcher::GetAssociatedWebContents() const {
+ return delegate_ ? delegate_->GetAssociatedWebContents() : nullptr;
+}
+
+content::WebContents*
+ExtensionFunctionDispatcher::GetVisibleWebContents() const {
+ return delegate_ ? delegate_->GetVisibleWebContents() :
+ GetAssociatedWebContents();
+}
+
// static
bool ExtensionFunctionDispatcher::CheckPermissions(
ExtensionFunction* function,

Powered by Google App Engine
This is Rietveld 408576698