diff options
author | ananta@chromium.org <ananta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-10-19 23:49:26 +0000 |
---|---|---|
committer | ananta@chromium.org <ananta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-10-19 23:49:26 +0000 |
commit | 0b7a012d120787fe67d72f47a5ef695c7405fff6 (patch) | |
tree | 662f9b40bfbff90795a2ecc2fa2c744872eefe94 /chrome/browser/external_tab_container_win.cc | |
parent | 1af1dfeff5d142a28b69906ac544be6675e6bf7a (diff) | |
download | chromium_src-0b7a012d120787fe67d72f47a5ef695c7405fff6.zip chromium_src-0b7a012d120787fe67d72f47a5ef695c7405fff6.tar.gz chromium_src-0b7a012d120787fe67d72f47a5ef695c7405fff6.tar.bz2 |
Remove usage of the old page info dialogs in ChromeFrame and use the new page info bubble
instead. Changed the expectations of the corresponding chrome frame ui test to look for
this window.
Added support in ChromeFrame tests window watcher class to allow specifying window class names
as well.
Fixes bug http://code.google.com/p/chromium/issues/detail?id=59030
Bug=59030
Review URL: http://codereview.chromium.org/3864001
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@63138 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/external_tab_container_win.cc')
-rw-r--r-- | chrome/browser/external_tab_container_win.cc | 45 |
1 files changed, 44 insertions, 1 deletions
diff --git a/chrome/browser/external_tab_container_win.cc b/chrome/browser/external_tab_container_win.cc index 660ca4f..0384e09 100644 --- a/chrome/browser/external_tab_container_win.cc +++ b/chrome/browser/external_tab_container_win.cc @@ -6,6 +6,7 @@ #include <string> +#include "app/l10n_util.h" #include "base/i18n/rtl.h" #include "base/logging.h" #include "base/trace_event.h" @@ -26,6 +27,7 @@ #include "chrome/browser/tab_contents/provisional_load_details.h" #include "chrome/browser/views/tab_contents/render_view_context_menu_views.h" #include "chrome/browser/tab_contents/tab_contents.h" +#include "chrome/browser/views/page_info_bubble_view.h" #include "chrome/browser/views/tab_contents/tab_contents_container.h" #include "chrome/common/bindings_policy.h" #include "chrome/common/chrome_constants.h" @@ -36,12 +38,40 @@ #include "chrome/common/page_transition_types.h" #include "chrome/test/automation/automation_messages.h" #include "grit/generated_resources.h" +#include "grit/locale_settings.h" #include "views/grid_layout.h" #include "views/widget/root_view.h" #include "views/window/window.h" static const wchar_t kWindowObjectKey[] = L"ChromeWindowObject"; +// This class overrides the LinkActivated function in the PageInfoBubbleView +// class and routes the help center link navigation to the host browser. +class ExternalTabPageInfoBubbleView : public PageInfoBubbleView { + public: + ExternalTabPageInfoBubbleView(ExternalTabContainer* container, + gfx::NativeWindow parent_window, + Profile* profile, + const GURL& url, + const NavigationEntry::SSLStatus& ssl, + bool show_history) + : PageInfoBubbleView(parent_window, profile, url, ssl, show_history), + container_(container) { + DLOG(INFO) << __FUNCTION__; + } + virtual ~ExternalTabPageInfoBubbleView() { + DLOG(INFO) << __FUNCTION__; + } + // LinkController methods: + virtual void LinkActivated(views::Link* source, int event_flags) { + GURL url = GURL(l10n_util::GetStringUTF16(IDS_PAGE_INFO_HELP_CENTER)); + container_->OpenURLFromTab(container_->tab_contents(), url, GURL(), + NEW_FOREGROUND_TAB, PageTransition::LINK); + } + private: + scoped_refptr<ExternalTabContainer> container_; +}; + base::LazyInstance<ExternalTabContainer::PendingTabs> ExternalTabContainer::pending_tabs_(base::LINKER_INITIALIZED); @@ -524,7 +554,20 @@ void ExternalTabContainer::ShowPageInfo(Profile* profile, const GURL& url, const NavigationEntry::SSLStatus& ssl, bool show_history) { - browser::ShowPageInfo(GetNativeView(), profile, url, ssl, show_history); + POINT cursor_pos = {0}; + GetCursorPos(&cursor_pos); + + gfx::Rect bounds; + bounds.set_origin(gfx::Point(cursor_pos)); + + PageInfoBubbleView* page_info_bubble = + new ExternalTabPageInfoBubbleView(this, NULL, profile, url, + ssl, show_history); + InfoBubble* info_bubble = + InfoBubble::Show(this, bounds, + BubbleBorder::TOP_LEFT, + page_info_bubble, page_info_bubble); + page_info_bubble->set_info_bubble(info_bubble); } void ExternalTabContainer::RegisterRenderViewHostForAutomation( |