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, |