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

Unified Diff: chrome/browser/ui/views/page_info_bubble_view.cc

Issue 10413061: Make PageInfoBubble not use BrowserList::GetLastActive and instead obtain a navigator at creation t… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 7 months 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
« no previous file with comments | « chrome/browser/ui/views/page_info_bubble_view.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/views/page_info_bubble_view.cc
===================================================================
--- chrome/browser/ui/views/page_info_bubble_view.cc (revision 138673)
+++ chrome/browser/ui/views/page_info_bubble_view.cc (working copy)
@@ -105,14 +105,16 @@
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 @@
}
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 @@
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();
}
« no previous file with comments | « chrome/browser/ui/views/page_info_bubble_view.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698