summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoryusukes@google.com <yusukes@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-08-10 04:54:23 +0000
committeryusukes@google.com <yusukes@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-08-10 04:54:23 +0000
commit75354378470fc3a4ee6f70f01378b7880129f978 (patch)
treeca77b7556ffe2aa154a1686122263ef4d05b9535
parentb1b55365bf2a643d45635f1b4b0b3d39604002bf (diff)
downloadchromium_src-75354378470fc3a4ee6f70f01378b7880129f978.zip
chromium_src-75354378470fc3a4ee6f70f01378b7880129f978.tar.gz
chromium_src-75354378470fc3a4ee6f70f01378b7880129f978.tar.bz2
Modified the browser controller so that it can revert the location bar when a user pressed RELOAD, FORWARD, or BACK buttons.
Note that this change does not revert the bar when Command+r is pressed. That's intentional. Please see the comment #7 by pkasting in http://crbug.com/15464 . Windows change: http://codereview.chromium.org/155908 Linux change: http://codereview.chromium.org/164137 BUG=18710 TEST=The same as http://codereview.chromium.org/155908 (except the F5 stuff since Chromium Mac seems not to support F5 reload?) Review URL: http://codereview.chromium.org/164145 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@22894 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/browser/cocoa/browser_window_controller.mm17
1 files changed, 17 insertions, 0 deletions
diff --git a/chrome/browser/cocoa/browser_window_controller.mm b/chrome/browser/cocoa/browser_window_controller.mm
index 5155a72..da50796 100644
--- a/chrome/browser/cocoa/browser_window_controller.mm
+++ b/chrome/browser/cocoa/browser_window_controller.mm
@@ -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"
@@ -468,6 +469,22 @@ willPositionSheet:(NSWindow*)sheet
// 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);
}