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

Unified Diff: chrome/browser/views/go_button.cc

Issue 17428: Issue 358: Can't open a new tab by middle-clicking home button... (Closed) Base URL: http://src.chromium.org/svn/trunk/src/
Patch Set: '' Created 11 years, 9 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 | « chrome/browser/views/go_button.h ('k') | chrome/browser/views/location_bar_view.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/views/go_button.cc
===================================================================
--- chrome/browser/views/go_button.cc (revision 12354)
+++ chrome/browser/views/go_button.cc (working copy)
@@ -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::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)
« no previous file with comments | « chrome/browser/views/go_button.h ('k') | chrome/browser/views/location_bar_view.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698