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

Unified Diff: chrome/browser/extensions/extension_dom_ui.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_dom_ui.cc
===================================================================
--- chrome/browser/extensions/extension_dom_ui.cc (revision 34039)
+++ chrome/browser/extensions/extension_dom_ui.cc (working copy)
@@ -63,10 +63,33 @@
has_callback);
}
-Browser* ExtensionDOMUI::GetBrowser() {
- return static_cast<Browser*>(tab_contents()->delegate());
+Browser* ExtensionDOMUI::GetBrowser() const {
+ TabContentsDelegate* tab_contents_delegate = tab_contents()->delegate();
+ if (tab_contents_delegate)
+ return tab_contents_delegate->GetBrowser();
+ return NULL;
}
+Profile* ExtensionDOMUI::GetProfile() {
+ return DOMUI::GetProfile();
+}
+
+gfx::NativeWindow ExtensionDOMUI::GetFrameNativeWindow() {
+ gfx::NativeWindow native_window =
+ ExtensionFunctionDispatcher::Delegate::GetFrameNativeWindow();
+
+ // If there was no window associated with the function dispatcher delegate,
+ // then this DOMUI may be hosted in an ExternalTabContainer, and a framing
+ // window will be accessible through the tab_contents.
+ if (!native_window) {
+ TabContentsDelegate* tab_contents_delegate = tab_contents()->delegate();
+ if (tab_contents_delegate)
+ native_window = tab_contents_delegate->GetFrameNativeWindow();
+ }
+
+ return native_window;
+}
+
////////////////////////////////////////////////////////////////////////////////
// chrome:// URL overrides

Powered by Google App Engine
This is Rietveld 408576698