diff options
author | yusukes@google.com <yusukes@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-07-22 06:31:15 +0000 |
---|---|---|
committer | yusukes@google.com <yusukes@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-07-22 06:31:15 +0000 |
commit | de2a7201d8ab8bc261f9c7e1d6698aa8beaeb8c9 (patch) | |
tree | cde962d2a6cc80324c03d3deaf6ec20cdc75ece6 | |
parent | f97238d2329697e3d38cf187d94e62da9f73de02 (diff) | |
download | chromium_src-de2a7201d8ab8bc261f9c7e1d6698aa8beaeb8c9.zip chromium_src-de2a7201d8ab8bc261f9c7e1d6698aa8beaeb8c9.tar.gz chromium_src-de2a7201d8ab8bc261f9c7e1d6698aa8beaeb8c9.tar.bz2 |
o Modified the toolbar button handler so that the handler can revert its omnibox when the button pressed is RELOAD, FORWARD, or BACK.
o Modified Browser::Reload(). Don't revert the bar when the user hit F5 or Ctrl-r.
BUG=15464
TEST=see the comment #3 of issue 15464
Review URL: http://codereview.chromium.org/155908
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@21267 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | chrome/browser/browser.cc | 5 | ||||
-rw-r--r-- | chrome/browser/views/toolbar_view.cc | 14 |
2 files changed, 12 insertions, 7 deletions
diff --git a/chrome/browser/browser.cc b/chrome/browser/browser.cc index e248920..1e9a830 100644 --- a/chrome/browser/browser.cc +++ b/chrome/browser/browser.cc @@ -729,11 +729,6 @@ void Browser::Reload() { return; } - // Forcibly reset the location bar, since otherwise it won't discard any - // ongoing user edits, since it doesn't realize this is a user-initiated - // action. - window_->GetLocationBar()->Revert(); - // As this is caused by a user action, give the focus to the page. current_tab->Focus(); current_tab->controller().Reload(true); diff --git a/chrome/browser/views/toolbar_view.cc b/chrome/browser/views/toolbar_view.cc index d92a876..d690008 100644 --- a/chrome/browser/views/toolbar_view.cc +++ b/chrome/browser/views/toolbar_view.cc @@ -351,9 +351,19 @@ void ToolbarView::EnabledStateChangedForCommand(int id, bool enabled) { // ToolbarView, views::Button::ButtonListener implementation: void ToolbarView::ButtonPressed(views::Button* sender) { + int id = sender->tag(); + switch (id) { + case IDC_BACK: + case IDC_FORWARD: + case IDC_RELOAD: + // Forcibly reset the location bar, since otherwise it won't discard any + // ongoing user edits, since it doesn't realize this is a user-initiated + // action. + location_bar_->Revert(); + break; + } browser_->ExecuteCommandWithDisposition( - sender->tag(), - event_utils::DispositionFromEventFlags(sender->mouse_event_flags())); + id, event_utils::DispositionFromEventFlags(sender->mouse_event_flags())); } //////////////////////////////////////////////////////////////////////////////// |