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

Unified Diff: chrome/browser/ui/gtk/page_info_bubble_gtk.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/gtk/browser_window_gtk.cc ('k') | chrome/browser/ui/page_info_bubble.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/gtk/page_info_bubble_gtk.cc
===================================================================
--- chrome/browser/ui/gtk/page_info_bubble_gtk.cc (revision 138673)
+++ chrome/browser/ui/gtk/page_info_bubble_gtk.cc (working copy)
@@ -40,7 +40,8 @@
Profile* profile,
const GURL& url,
const SSLStatus& ssl,
- bool show_history);
+ bool show_history,
+ content::PageNavigator* navigator);
virtual ~PageInfoBubbleGtk();
// PageInfoModelObserver implementation.
@@ -85,6 +86,9 @@
Profile* profile_;
+ // Used for loading pages.
+ content::PageNavigator* navigator_;
+
DISALLOW_COPY_AND_ASSIGN(PageInfoBubbleGtk);
};
@@ -92,7 +96,8 @@
Profile* profile,
const GURL& url,
const SSLStatus& ssl,
- bool show_history)
+ bool show_history,
+ content::PageNavigator* navigator)
: ALLOW_THIS_IN_INITIALIZER_LIST(model_(profile, url, ssl,
show_history, this)),
url_(url),
@@ -100,7 +105,8 @@
parent_(parent),
contents_(NULL),
theme_service_(GtkThemeService::GetFrom(profile)),
- profile_(profile) {
+ profile_(profile),
+ navigator_(navigator) {
BrowserWindowGtk* browser_window =
BrowserWindowGtk::GetBrowserWindowForNativeWindow(parent);
@@ -228,10 +234,11 @@
}
void PageInfoBubbleGtk::OnHelpLinkClicked(GtkWidget* widget) {
- Browser* browser = browser::FindLastActiveWithProfile(profile_);
- browser->OpenURL(OpenURLParams(
- GURL(chrome::kPageInfoHelpCenterURL), content::Referrer(),
- NEW_FOREGROUND_TAB, content::PAGE_TRANSITION_LINK, false));
+ navigator_->OpenURL(OpenURLParams(GURL(chrome::kPageInfoHelpCenterURL),
+ content::Referrer(),
+ NEW_FOREGROUND_TAB,
+ content::PAGE_TRANSITION_LINK,
+ false));
bubble_->Close();
}
@@ -243,8 +250,9 @@
Profile* profile,
const GURL& url,
const SSLStatus& ssl,
- bool show_history) {
- new PageInfoBubbleGtk(parent, profile, url, ssl, show_history);
+ bool show_history,
+ content::PageNavigator* navigator) {
+ new PageInfoBubbleGtk(parent, profile, url, ssl, show_history, navigator);
}
} // namespace browser
« no previous file with comments | « chrome/browser/ui/gtk/browser_window_gtk.cc ('k') | chrome/browser/ui/page_info_bubble.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698