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

Unified Diff: chrome/browser/ui/cocoa/page_info_bubble_controller.mm

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
Index: chrome/browser/ui/cocoa/page_info_bubble_controller.mm
===================================================================
--- chrome/browser/ui/cocoa/page_info_bubble_controller.mm (revision 138673)
+++ chrome/browser/ui/cocoa/page_info_bubble_controller.mm (working copy)
@@ -21,6 +21,7 @@
#import "chrome/browser/ui/cocoa/location_bar/location_bar_view_mac.h"
#include "chrome/common/url_constants.h"
#include "content/public/browser/cert_store.h"
+#include "content/public/browser/page_navigator.h"
#include "content/public/common/ssl_status.h"
#include "grit/generated_resources.h"
#include "grit/locale_settings.h"
@@ -158,14 +159,16 @@
Profile* profile,
const GURL& url,
const SSLStatus& ssl,
- bool show_history) {
+ bool show_history,
+ content::PageNavigator* navigator) {
PageInfoModelBubbleBridge* bridge = new PageInfoModelBubbleBridge();
PageInfoModel* model =
new PageInfoModel(profile, url, ssl, show_history, bridge);
PageInfoBubbleController* controller =
[[PageInfoBubbleController alloc] initWithPageInfoModel:model
modelObserver:bridge
- parentWindow:parent];
+ parentWindow:parent
+ navigator:navigator];
bridge->set_controller(controller);
[controller setCertID:ssl.cert_id];
[controller showWindow:nil];
@@ -179,7 +182,8 @@
- (id)initWithPageInfoModel:(PageInfoModel*)model
modelObserver:(PageInfoModelObserver*)bridge
- parentWindow:(NSWindow*)parentWindow {
+ parentWindow:(NSWindow*)parentWindow
+ navigator:(content::PageNavigator*)navigator {
DCHECK(parentWindow);
// Use an arbitrary height because it will be changed by the bridge.
@@ -196,6 +200,7 @@
anchoredAt:NSZeroPoint])) {
model_.reset(model);
bridge_.reset(bridge);
+ navigator_ = navigator;
[[self bubble] setArrowLocation:info_bubble::kTopLeft];
[self performLayout];
}
@@ -212,11 +217,11 @@
}
- (IBAction)showHelpPage:(id)sender {
- 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));
}
// This will create the subviews for the page info window. The general layout
« no previous file with comments | « chrome/browser/ui/cocoa/page_info_bubble_controller.h ('k') | chrome/browser/ui/cocoa/page_info_bubble_controller_unittest.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698