summaryrefslogtreecommitdiffstats
path: root/chrome/browser/ui/views
diff options
context:
space:
mode:
Diffstat (limited to 'chrome/browser/ui/views')
-rw-r--r--chrome/browser/ui/views/browser_dialogs.h4
-rw-r--r--chrome/browser/ui/views/frame/browser_view.cc2
-rw-r--r--chrome/browser/ui/views/page_info_bubble_view.cc26
-rw-r--r--chrome/browser/ui/views/page_info_bubble_view.h7
4 files changed, 27 insertions, 12 deletions
diff --git a/chrome/browser/ui/views/browser_dialogs.h b/chrome/browser/ui/views/browser_dialogs.h
index 3a0a464..f178371 100644
--- a/chrome/browser/ui/views/browser_dialogs.h
+++ b/chrome/browser/ui/views/browser_dialogs.h
@@ -26,6 +26,7 @@ class TabContentsWrapper;
class TemplateURL;
namespace content {
+class PageNavigator;
struct SSLStatus;
}
@@ -62,7 +63,8 @@ void ShowPageInfoBubble(views::View* anchor_view,
Profile* profile,
const GURL& url,
const content::SSLStatus& ssl,
- bool show_history);
+ bool show_history,
+ content::PageNavigator* navigator);
// Shows the about dialog. See AboutChromeView.
views::Widget* ShowAboutChromeView(gfx::NativeWindow parent,
diff --git a/chrome/browser/ui/views/frame/browser_view.cc b/chrome/browser/ui/views/frame/browser_view.cc
index 7d5a2ba..6822c7d 100644
--- a/chrome/browser/ui/views/frame/browser_view.cc
+++ b/chrome/browser/ui/views/frame/browser_view.cc
@@ -1138,7 +1138,7 @@ void BrowserView::ShowPageInfo(Profile* profile,
const SSLStatus& ssl,
bool show_history) {
browser::ShowPageInfoBubble(GetLocationBarView()->location_icon_view(),
- profile, url, ssl, show_history);
+ profile, url, ssl, show_history, browser_.get());
}
void BrowserView::ShowWebsiteSettings(Profile* profile,
diff --git a/chrome/browser/ui/views/page_info_bubble_view.cc b/chrome/browser/ui/views/page_info_bubble_view.cc
index 86c5c59..5456668 100644
--- a/chrome/browser/ui/views/page_info_bubble_view.cc
+++ b/chrome/browser/ui/views/page_info_bubble_view.cc
@@ -105,14 +105,16 @@ PageInfoBubbleView::PageInfoBubbleView(views::View* anchor_view,
Profile* profile,
const GURL& url,
const SSLStatus& ssl,
- bool show_history)
+ bool show_history,
+ content::PageNavigator* navigator)
: BubbleDelegateView(anchor_view, views::BubbleBorder::TOP_LEFT),
ALLOW_THIS_IN_INITIALIZER_LIST(model_(profile, url, ssl,
show_history, this)),
cert_id_(ssl.cert_id),
help_center_link_(NULL),
ALLOW_THIS_IN_INITIALIZER_LIST(resize_animation_(this)),
- animation_start_height_(0) {
+ animation_start_height_(0),
+ navigator_(navigator) {
if (cert_id_ > 0) {
scoped_refptr<net::X509Certificate> cert;
@@ -282,11 +284,11 @@ gfx::Rect PageInfoBubbleView::GetAnchorRect() {
}
void PageInfoBubbleView::LinkClicked(views::Link* source, int event_flags) {
- Browser* browser = BrowserList::GetLastActive();
- OpenURLParams params(
- GURL(chrome::kPageInfoHelpCenterURL), Referrer(), NEW_FOREGROUND_TAB,
- content::PAGE_TRANSITION_LINK, false);
- browser->OpenURL(params);
+ navigator_->OpenURL(OpenURLParams(GURL(chrome::kPageInfoHelpCenterURL),
+ Referrer(),
+ NEW_FOREGROUND_TAB,
+ content::PAGE_TRANSITION_LINK,
+ false));
// NOTE: The bubble closes automatically on deactivation as the link opens.
}
@@ -452,9 +454,15 @@ void ShowPageInfoBubble(views::View* anchor_view,
Profile* profile,
const GURL& url,
const SSLStatus& ssl,
- bool show_history) {
+ bool show_history,
+ content::PageNavigator* navigator) {
PageInfoBubbleView* page_info_bubble =
- new PageInfoBubbleView(anchor_view, profile, url, ssl, show_history);
+ new PageInfoBubbleView(anchor_view,
+ profile,
+ url,
+ ssl,
+ show_history,
+ navigator);
views::BubbleDelegateView::CreateBubble(page_info_bubble);
page_info_bubble->Show();
}
diff --git a/chrome/browser/ui/views/page_info_bubble_view.h b/chrome/browser/ui/views/page_info_bubble_view.h
index d84d404..12788fc 100644
--- a/chrome/browser/ui/views/page_info_bubble_view.h
+++ b/chrome/browser/ui/views/page_info_bubble_view.h
@@ -14,6 +14,7 @@
#include "ui/views/controls/link_listener.h"
namespace content {
+class PageNavigator;
struct SSLStatus;
}
@@ -25,7 +26,8 @@ class PageInfoBubbleView : public views::BubbleDelegateView,
Profile* profile,
const GURL& url,
const content::SSLStatus& ssl,
- bool show_history);
+ bool show_history,
+ content::PageNavigator* navigator);
virtual ~PageInfoBubbleView();
// Show the certificate dialog.
@@ -75,6 +77,9 @@ class PageInfoBubbleView : public views::BubbleDelegateView,
// The height of the info bubble at the start of the resize animation.
int animation_start_height_;
+ // Used for loading pages.
+ content::PageNavigator* navigator_;
+
DISALLOW_COPY_AND_ASSIGN(PageInfoBubbleView);
};