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

Unified Diff: chrome/browser/cocoa/browser_window_controller.mm

Issue 330002: Mac: implement dispositions for back/forward buttons (not in drop-downs). (Closed)
Patch Set: We never need to call Revert() on back/forwards, so the logic can be simplified. Created 11 years, 2 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/cocoa/browser_window_controller.mm
diff --git a/chrome/browser/cocoa/browser_window_controller.mm b/chrome/browser/cocoa/browser_window_controller.mm
index be1d99fb9d0fb15f5192495f87d60076848c8ecf..6afedb578e588bcc622b573e02382f610f07633b 100644
--- a/chrome/browser/cocoa/browser_window_controller.mm
+++ b/chrome/browser/cocoa/browser_window_controller.mm
@@ -26,6 +26,7 @@
#import "chrome/browser/cocoa/browser_window_controller.h"
#import "chrome/browser/cocoa/chrome_browser_window.h"
#import "chrome/browser/cocoa/download_shelf_controller.h"
+#import "chrome/browser/cocoa/event_utils.h"
#import "chrome/browser/cocoa/extension_shelf_controller.h"
#import "chrome/browser/cocoa/find_bar_cocoa_controller.h"
#include "chrome/browser/cocoa/find_bar_bridge.h"
@@ -599,8 +600,12 @@ willPositionSheet:(NSWindow*)sheet
switch (tag) {
case IDC_FORWARD:
case IDC_BACK:
- [self locationBar]->Revert();
- break;
+ // For this, we need to check the key flags to figure out where to open
+ // the history item. Note that |Revert()| isn't needed, since any
+ // navigation in the current tab will reset the location bar's contents.
+ browser_->ExecuteCommandWithDisposition(tag,
+ event_utils::WindowOpenDispositionFromNSEvent([NSApp currentEvent]));
+ return;
case IDC_RELOAD:
if ([sender isKindOfClass:[NSButton class]]) {
// We revert the bar when the reload button is pressed, but don't when
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698