summaryrefslogtreecommitdiffstats
path: root/chrome/browser/views/go_button.cc
diff options
context:
space:
mode:
authoridanan@chromium.org <idanan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-03-24 19:06:12 +0000
committeridanan@chromium.org <idanan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-03-24 19:06:12 +0000
commit28a45c708dd128ee9e61c547f7d10cd55530f374 (patch)
tree107498b717ba720eca02df2eddfe034055f4469a /chrome/browser/views/go_button.cc
parent6b01318fe807d9a6dca2a31ce7f0242ef3c93453 (diff)
downloadchromium_src-28a45c708dd128ee9e61c547f7d10cd55530f374.zip
chromium_src-28a45c708dd128ee9e61c547f7d10cd55530f374.tar.gz
chromium_src-28a45c708dd128ee9e61c547f7d10cd55530f374.tar.bz2
Issue 6477: Support modifier clicks on UI elements
Mouse event flags transformed to WindoOpenDisposition so that browser commands can all inteterpert event modifiers. Implemented home, forward and backwards middle-click andshift middle click. Previously working on issue 358 which was market a duplicate and concerned with the home and tabstrip subset of this behavior: Can't open a new tab by middle-clicking home button. No functionality has been lost or altered, only the use ofmodifiers give access to increased functionality. BUG=6477 TBR=ben@chromium.org git-svn-id: svn://svn.chromium.org/chrome/trunk/src@12383 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/views/go_button.cc')
-rw-r--r--chrome/browser/views/go_button.cc14
1 files changed, 8 insertions, 6 deletions
diff --git a/chrome/browser/views/go_button.cc b/chrome/browser/views/go_button.cc
index db205c4..48773ae 100644
--- a/chrome/browser/views/go_button.cc
+++ b/chrome/browser/views/go_button.cc
@@ -5,7 +5,8 @@
#include "chrome/browser/views/go_button.h"
#include "chrome/app/chrome_dll_resource.h"
-#include "chrome/browser/command_updater.h"
+#include "chrome/browser/browser.h"
+#include "chrome/browser/views/event_utils.h"
#include "chrome/browser/views/location_bar_view.h"
#include "chrome/common/l10n_util.h"
#include "grit/generated_resources.h"
@@ -13,16 +14,17 @@
////////////////////////////////////////////////////////////////////////////////
// GoButton, public:
-GoButton::GoButton(LocationBarView* location_bar,
- CommandUpdater* command_updater)
+GoButton::GoButton(LocationBarView* location_bar, Browser* browser)
: ToggleImageButton(this),
location_bar_(location_bar),
- command_updater_(command_updater),
+ browser_(browser),
intended_mode_(MODE_GO),
visible_mode_(MODE_GO),
button_delay_(NULL),
stop_timer_(this) {
DCHECK(location_bar_);
+ set_triggerable_event_flags(views::Event::EF_LEFT_BUTTON_DOWN |
+ views::Event::EF_MIDDLE_BUTTON_DOWN);
}
GoButton::~GoButton() {
@@ -64,14 +66,14 @@ void GoButton::ScheduleChangeMode(Mode mode) {
void GoButton::ButtonPressed(views::Button* button) {
if (visible_mode_ == MODE_STOP) {
- command_updater_->ExecuteCommand(IDC_STOP);
+ browser_->Stop();
// The user has clicked, so we can feel free to update the button,
// even if the mouse is still hovering.
ChangeMode(MODE_GO);
} else if (visible_mode_ == MODE_GO && stop_timer_.empty()) {
// If the go button is visible and not within the double click timer, go.
- command_updater_->ExecuteCommand(IDC_GO);
+ browser_->Go(event_utils::DispositionFromEventFlags(mouse_event_flags()));
// Figure out the system double-click time.
if (button_delay_ == NULL)