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

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

Issue 434046: Support for chrome.experimental.popup API in ExternalTabContainer views (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 11 years 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
===================================================================
--- chrome/browser/extensions/extension_function_dispatcher.cc (revision 34039)
+++ chrome/browser/extensions/extension_function_dispatcher.cc (working copy)
@@ -7,6 +7,8 @@
#include "base/process_util.h"
#include "base/singleton.h"
#include "base/values.h"
+#include "chrome/browser/browser.h"
+#include "chrome/browser/browser_window.h"
#include "chrome/browser/extensions/execute_code_in_tab_function.h"
#include "chrome/browser/extensions/extension_bookmarks_module.h"
#include "chrome/browser/extensions/extension_bookmarks_module_constants.h"
@@ -181,6 +183,20 @@
}; // namespace
+// ExtensionFunctionDispatcher::Delegate ---------------------------------------
+
+gfx::NativeWindow ExtensionFunctionDispatcher::Delegate::
+ GetFrameNativeWindow() {
+ Browser* browser = GetBrowser();
+ // If a browser is bound to this dispatcher, then return the widget hosting
+ // the window. Extensions hosted in ExternalTabContainer objects may not
+ // have a running browser instance.
+ if (browser)
+ return browser->window()->GetNativeHandle();
+
+ return NULL;
+}
+
// ExtensionFunctionDispatcher -------------------------------------------------
void ExtensionFunctionDispatcher::GetAllFunctionNames(
@@ -318,3 +334,7 @@
Profile* ExtensionFunctionDispatcher::profile() {
return render_view_host_->process()->profile();
}
+
+gfx::NativeWindow ExtensionFunctionDispatcher::GetFrameNativeWindow() {
+ return delegate_ ? delegate_->GetFrameNativeWindow() : NULL;
+}

Powered by Google App Engine
This is Rietveld 408576698