diff options
author | aa@chromium.org <aa@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-03-24 19:59:41 +0000 |
---|---|---|
committer | aa@chromium.org <aa@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-03-24 19:59:41 +0000 |
commit | 0ec9203dac6b11c664adda8a39b77f3f00eb6072 (patch) | |
tree | 65e5cff3f9e04da87e32e9436ddc795a7811c278 /chrome/browser/extensions/extension_dom_ui.cc | |
parent | 630d1b047c8c4ea54eef06fa24a89ad516457875 (diff) | |
download | chromium_src-0ec9203dac6b11c664adda8a39b77f3f00eb6072.zip chromium_src-0ec9203dac6b11c664adda8a39b77f3f00eb6072.tar.gz chromium_src-0ec9203dac6b11c664adda8a39b77f3f00eb6072.tar.bz2 |
Generalize the ExtensionFunctionDispatcher::Delegate interface a bit more. In particular remove GetExtensionHost() and GetExtensionDOMUI(). I'm going to add a new type of EFD::Delegate soon that is neither of these, and I don't think it makes sense to have the code assume that EFD::Delegate must be one of the two of them.
Some code still does RTTI stuff through RenderViewHostDelegate::GetRenderViewType(), but in that case it is more clear that there are a long list of potential view types, and that the caller must be more careful.
Review URL: http://codereview.chromium.org/1149003
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@42519 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/extensions/extension_dom_ui.cc')
-rw-r--r-- | chrome/browser/extensions/extension_dom_ui.cc | 36 |
1 files changed, 12 insertions, 24 deletions
diff --git a/chrome/browser/extensions/extension_dom_ui.cc b/chrome/browser/extensions/extension_dom_ui.cc index 907e6c0..0a7e5d1 100644 --- a/chrome/browser/extensions/extension_dom_ui.cc +++ b/chrome/browser/extensions/extension_dom_ui.cc @@ -96,18 +96,12 @@ void ExtensionDOMUI::ProcessDOMUIMessage(const std::string& message, has_callback); } -Browser* ExtensionDOMUI::GetBrowser(bool include_incognito) const { +Browser* ExtensionDOMUI::GetBrowser() const { Browser* browser = NULL; TabContentsDelegate* tab_contents_delegate = tab_contents()->delegate(); - if (tab_contents_delegate) { + if (tab_contents_delegate) browser = tab_contents_delegate->GetBrowser(); - if (browser && browser->profile()->IsOffTheRecord() && !include_incognito) { - // Fall back to the toplevel regular browser if we don't want to include - // incognito browsers. - browser = BrowserList::GetLastActiveWithProfile( - browser->profile()->GetOriginalProfile()); - } - } + return browser; } @@ -115,20 +109,18 @@ Profile* ExtensionDOMUI::GetProfile() { return DOMUI::GetProfile(); } -gfx::NativeWindow ExtensionDOMUI::GetFrameNativeWindow() { - gfx::NativeWindow native_window = - ExtensionFunctionDispatcher::Delegate::GetFrameNativeWindow(); +gfx::NativeWindow ExtensionDOMUI::GetCustomFrameNativeWindow() { + if (GetBrowser()) + return NULL; - // If there was no window associated with the function dispatcher delegate, + // If there was no browser 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; + TabContentsDelegate* tab_contents_delegate = tab_contents()->delegate(); + if (tab_contents_delegate) + return tab_contents_delegate->GetFrameNativeWindow(); + else + return NULL; } gfx::NativeView ExtensionDOMUI::GetNativeViewOfHost() { @@ -287,10 +279,6 @@ void ExtensionDOMUI::UnregisterChromeURLOverride(const std::string& page, } } -RenderViewHost* ExtensionDOMUI::GetRenderViewHost() { - return tab_contents() ? tab_contents()->render_view_host() : NULL; -} - // static void ExtensionDOMUI::UnregisterChromeURLOverrides( Profile* profile, const Extension::URLOverrideMap& overrides) { |