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

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

Issue 164145: Modified the browser controller so that it can revert... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 4 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
===================================================================
--- chrome/browser/cocoa/browser_window_controller.mm (revision 22601)
+++ chrome/browser/cocoa/browser_window_controller.mm (working copy)
@@ -13,6 +13,7 @@
#include "chrome/browser/browser_list.h"
#include "chrome/browser/browser_process.h"
#include "chrome/browser/encoding_menu_controller.h"
+#include "chrome/browser/location_bar.h"
#include "chrome/browser/profile.h"
#include "chrome/browser/renderer_host/render_widget_host_view.h"
#include "chrome/browser/tab_contents/tab_contents.h"
@@ -460,6 +461,22 @@
// disabled in the UI in validateUserInterfaceItem:.
- (void)commandDispatch:(id)sender {
NSInteger tag = [sender tag];
+ switch (tag) {
+ case IDC_FORWARD:
+ case IDC_BACK:
+ [self locationBar]->Revert();
+ break;
+ case IDC_RELOAD:
+ if ([sender isKindOfClass:[NSButton class]]) {
+ // We revert the bar when the reload button is pressed, but don't when
+ // Command+r is pressed (Issue 15464). Unlike the event handler function
+ // for Windows (ToolbarView::ButtonPressed()), this function handles
+ // both reload button press event and Command+r press event. Thus the
+ // 'isKindofClass' check is necessary.
+ [self locationBar]->Revert();
+ }
+ break;
+ }
browser_->ExecuteCommand(tag);
}
« 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