summaryrefslogtreecommitdiffstats
path: root/views/controls/button
diff options
context:
space:
mode:
authormsw@chromium.org <msw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-03-14 23:17:20 +0000
committermsw@chromium.org <msw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-03-14 23:17:20 +0000
commit2c831b235ec39e7e4258cfd93b735de06f079a0e (patch)
treef0a49df25f1d7736bd8483de7cf09794fc06f055 /views/controls/button
parent05a1ba49bd770a52a3a84aa2ce6241b0e538d7da (diff)
downloadchromium_src-2c831b235ec39e7e4258cfd93b735de06f079a0e.zip
chromium_src-2c831b235ec39e7e4258cfd93b735de06f079a0e.tar.gz
chromium_src-2c831b235ec39e7e4258cfd93b735de06f079a0e.tar.bz2
Clean up some event code:
Update some RootView event construction. Fixup some *MouseExited/OnLeaveNotify codepaths. Normalize event argument names. Move View::ConvertPoint*Ancestor defs to private section. Review URL: http://codereview.chromium.org/6685018 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@78121 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'views/controls/button')
-rw-r--r--views/controls/button/button_dropdown.cc34
-rw-r--r--views/controls/button/button_dropdown.h14
-rw-r--r--views/controls/button/checkbox.cc26
-rw-r--r--views/controls/button/checkbox.h16
-rw-r--r--views/controls/button/custom_button.cc50
-rw-r--r--views/controls/button/custom_button.h24
-rw-r--r--views/controls/button/menu_button.cc23
-rw-r--r--views/controls/button/menu_button.h14
8 files changed, 100 insertions, 101 deletions
diff --git a/views/controls/button/button_dropdown.cc b/views/controls/button/button_dropdown.cc
index 7bc5910..cdd93c3 100644
--- a/views/controls/button/button_dropdown.cc
+++ b/views/controls/button/button_dropdown.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2010 The Chromium Authors. All rights reserved.
+// Copyright (c) 2011 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -41,12 +41,12 @@ ButtonDropDown::~ButtonDropDown() {
//
////////////////////////////////////////////////////////////////////////////////
-bool ButtonDropDown::OnMousePressed(const MouseEvent& e) {
- if (IsEnabled() && IsTriggerableEvent(e) && HitTest(e.location())) {
+bool ButtonDropDown::OnMousePressed(const MouseEvent& event) {
+ if (IsEnabled() && IsTriggerableEvent(event) && HitTest(event.location())) {
// Store the y pos of the mouse coordinates so we can use them later to
// determine if the user dragged the mouse down (which should pop up the
// drag down menu immediately, instead of waiting for the timer)
- y_position_on_lbuttondown_ = e.y();
+ y_position_on_lbuttondown_ = event.y();
// Schedule a task that will show the menu.
MessageLoop::current()->PostDelayedTask(FROM_HERE,
@@ -54,37 +54,37 @@ bool ButtonDropDown::OnMousePressed(const MouseEvent& e) {
GetWidget()->GetNativeView()),
kMenuTimerDelay);
}
- return ImageButton::OnMousePressed(e);
+ return ImageButton::OnMousePressed(event);
}
-void ButtonDropDown::OnMouseReleased(const MouseEvent& e, bool canceled) {
+void ButtonDropDown::OnMouseReleased(const MouseEvent& event, bool canceled) {
// Showing the drop down results in a MouseReleased with a canceled drag, we
// need to ignore it.
- if (!canceled && (IsTriggerableEvent(e) ||
- (e.IsRightMouseButton() && !HitTest(e.location())))) {
- ImageButton::OnMouseReleased(e, canceled);
+ if (!canceled && (IsTriggerableEvent(event) ||
+ (event.IsRightMouseButton() && !HitTest(event.location())))) {
+ ImageButton::OnMouseReleased(event, canceled);
}
if (canceled)
return;
- if (IsTriggerableEvent(e))
+ if (IsTriggerableEvent(event))
show_menu_factory_.RevokeAll();
- if (IsEnabled() && e.IsRightMouseButton() && HitTest(e.location())) {
+ if (IsEnabled() && event.IsRightMouseButton() && HitTest(event.location())) {
show_menu_factory_.RevokeAll();
ShowDropDownMenu(GetWidget()->GetNativeView());
}
}
-bool ButtonDropDown::OnMouseDragged(const MouseEvent& e) {
- bool result = ImageButton::OnMouseDragged(e);
+bool ButtonDropDown::OnMouseDragged(const MouseEvent& event) {
+ bool result = ImageButton::OnMouseDragged(event);
if (!show_menu_factory_.empty()) {
// If the mouse is dragged to a y position lower than where it was when
// clicked then we should not wait for the menu to appear but show
// it immediately.
- if (e.y() > y_position_on_lbuttondown_ + GetHorizontalDragThreshold()) {
+ if (event.y() > y_position_on_lbuttondown_ + GetHorizontalDragThreshold()) {
show_menu_factory_.RevokeAll();
ShowDropDownMenu(GetWidget()->GetNativeView());
}
@@ -93,7 +93,7 @@ bool ButtonDropDown::OnMouseDragged(const MouseEvent& e) {
return result;
}
-void ButtonDropDown::OnMouseExited(const MouseEvent& e) {
+void ButtonDropDown::OnMouseExited(const MouseEvent& event) {
// Starting a drag results in a MouseExited, we need to ignore it.
// A right click release triggers an exit event. We want to
// remain in a PUSHED state until the drop down menu closes.
@@ -114,11 +114,11 @@ void ButtonDropDown::ShowContextMenu(const gfx::Point& p,
SetState(BS_HOT);
}
-bool ButtonDropDown::ShouldEnterPushedState(const MouseEvent& e) {
+bool ButtonDropDown::ShouldEnterPushedState(const MouseEvent& event) {
// Enter PUSHED state on press with Left or Right mouse button. Remain
// in this state while the context menu is open.
return ((ui::EF_LEFT_BUTTON_DOWN |
- ui::EF_RIGHT_BUTTON_DOWN) & e.flags()) != 0;
+ ui::EF_RIGHT_BUTTON_DOWN) & event.flags()) != 0;
}
void ButtonDropDown::ShowDropDownMenu(gfx::NativeView window) {
diff --git a/views/controls/button/button_dropdown.h b/views/controls/button/button_dropdown.h
index 32f2c5c..fe558e1 100644
--- a/views/controls/button/button_dropdown.h
+++ b/views/controls/button/button_dropdown.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2010 The Chromium Authors. All rights reserved.
+// Copyright (c) 2011 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -30,22 +30,22 @@ class ButtonDropDown : public ImageButton {
private:
// Overridden from CustomButton
- virtual bool OnMousePressed(const MouseEvent& e);
- virtual void OnMouseReleased(const MouseEvent& e, bool canceled);
- virtual bool OnMouseDragged(const MouseEvent& e);
- virtual void OnMouseExited(const MouseEvent& e);
+ virtual bool OnMousePressed(const MouseEvent& event) OVERRIDE;
+ virtual void OnMouseReleased(const MouseEvent& event, bool canceled) OVERRIDE;
+ virtual bool OnMouseDragged(const MouseEvent& event) OVERRIDE;
+ virtual void OnMouseExited(const MouseEvent& event) OVERRIDE;
// Overridden from View. Used to display the right-click menu, as triggered
// by the keyboard, for instance. Using the member function ShowDropDownMenu
// for the actual display.
virtual void ShowContextMenu(const gfx::Point& p,
- bool is_mouse_gesture);
+ bool is_mouse_gesture) OVERRIDE;
// Overridden from CustomButton. Returns true if the button should become
// pressed when a user holds the mouse down over the button. For this
// implementation, both left and right mouse buttons can trigger a change
// to the PUSHED state.
- virtual bool ShouldEnterPushedState(const MouseEvent& e);
+ virtual bool ShouldEnterPushedState(const MouseEvent& event) OVERRIDE;
// Internal function to show the dropdown menu
void ShowDropDownMenu(gfx::NativeView window);
diff --git a/views/controls/button/checkbox.cc b/views/controls/button/checkbox.cc
index 2a34cc5..45aea1c 100644
--- a/views/controls/button/checkbox.cc
+++ b/views/controls/button/checkbox.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2010 The Chromium Authors. All rights reserved.
+// Copyright (c) 2011 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -122,32 +122,32 @@ void Checkbox::OnPaintFocusBorder(gfx::Canvas* canvas) {
// Our focus border is rendered by the label, so we don't do anything here.
}
-void Checkbox::OnMouseEntered(const MouseEvent& e) {
- native_wrapper_->SetPushed(HitTestLabel(e));
+void Checkbox::OnMouseEntered(const MouseEvent& event) {
+ native_wrapper_->SetPushed(HitTestLabel(event));
}
-void Checkbox::OnMouseMoved(const MouseEvent& e) {
- native_wrapper_->SetPushed(HitTestLabel(e));
+void Checkbox::OnMouseMoved(const MouseEvent& event) {
+ native_wrapper_->SetPushed(HitTestLabel(event));
}
-void Checkbox::OnMouseExited(const MouseEvent& e) {
+void Checkbox::OnMouseExited(const MouseEvent& event) {
native_wrapper_->SetPushed(false);
}
-bool Checkbox::OnMousePressed(const MouseEvent& e) {
- native_wrapper_->SetPushed(HitTestLabel(e));
+bool Checkbox::OnMousePressed(const MouseEvent& event) {
+ native_wrapper_->SetPushed(HitTestLabel(event));
return true;
}
-void Checkbox::OnMouseReleased(const MouseEvent& e, bool canceled) {
+void Checkbox::OnMouseReleased(const MouseEvent& event, bool canceled) {
native_wrapper_->SetPushed(false);
- if (!canceled && HitTestLabel(e)) {
+ if (!canceled && HitTestLabel(event)) {
SetChecked(!checked());
ButtonPressed();
}
}
-bool Checkbox::OnMouseDragged(const MouseEvent& e) {
+bool Checkbox::OnMouseDragged(const MouseEvent& event) {
return false;
}
@@ -193,8 +193,8 @@ void Checkbox::SetLabel(const std::wstring& label) {
////////////////////////////////////////////////////////////////////////////////
// Checkbox, protected:
-bool Checkbox::HitTestLabel(const MouseEvent& e) {
- gfx::Point tmp(e.location());
+bool Checkbox::HitTestLabel(const MouseEvent& event) {
+ gfx::Point tmp(event.location());
ConvertPointToView(this, label_, &tmp);
return label_->HitTest(tmp);
}
diff --git a/views/controls/button/checkbox.h b/views/controls/button/checkbox.h
index 801b0fd..75660b4 100644
--- a/views/controls/button/checkbox.h
+++ b/views/controls/button/checkbox.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2010 The Chromium Authors. All rights reserved.
+// Copyright (c) 2011 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -47,12 +47,12 @@ class Checkbox : public NativeButton {
virtual void Layout() OVERRIDE;
virtual void SetEnabled(bool enabled) OVERRIDE;
virtual void OnPaintFocusBorder(gfx::Canvas* canvas) OVERRIDE;
- virtual void OnMouseEntered(const MouseEvent& e) OVERRIDE;
- virtual void OnMouseMoved(const MouseEvent& e) OVERRIDE;
- virtual void OnMouseExited(const MouseEvent& e) OVERRIDE;
- virtual bool OnMousePressed(const MouseEvent& e) OVERRIDE;
- virtual void OnMouseReleased(const MouseEvent& e, bool canceled) OVERRIDE;
- virtual bool OnMouseDragged(const MouseEvent& e) OVERRIDE;
+ virtual void OnMouseEntered(const MouseEvent& event) OVERRIDE;
+ virtual void OnMouseMoved(const MouseEvent& event) OVERRIDE;
+ virtual void OnMouseExited(const MouseEvent& event) OVERRIDE;
+ virtual bool OnMousePressed(const MouseEvent& event) OVERRIDE;
+ virtual void OnMouseReleased(const MouseEvent& event, bool canceled) OVERRIDE;
+ virtual bool OnMouseDragged(const MouseEvent& event) OVERRIDE;
virtual void OnFocus() OVERRIDE;
virtual void OnBlur() OVERRIDE;
@@ -71,7 +71,7 @@ class Checkbox : public NativeButton {
// Returns true if the event (in Checkbox coordinates) is within the bounds of
// the label.
- bool HitTestLabel(const MouseEvent& e);
+ bool HitTestLabel(const MouseEvent& event);
private:
// Called from the constructor to create and configure the checkbox label.
diff --git a/views/controls/button/custom_button.cc b/views/controls/button/custom_button.cc
index 04ee51a..2e7b4cdd 100644
--- a/views/controls/button/custom_button.cc
+++ b/views/controls/button/custom_button.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2010 The Chromium Authors. All rights reserved.
+// Copyright (c) 2011 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -125,8 +125,8 @@ CustomButton::CustomButton(ButtonListener* listener)
hover_animation_->SetSlideDuration(kHoverFadeDurationMs);
}
-bool CustomButton::IsTriggerableEvent(const MouseEvent& e) {
- return (triggerable_event_flags_ & e.flags()) != 0;
+bool CustomButton::IsTriggerableEvent(const MouseEvent& event) {
+ return (triggerable_event_flags_ & event.flags()) != 0;
}
////////////////////////////////////////////////////////////////////////////////
@@ -143,9 +143,9 @@ bool CustomButton::AcceleratorPressed(const Accelerator& accelerator) {
return true;
}
-bool CustomButton::OnMousePressed(const MouseEvent& e) {
+bool CustomButton::OnMousePressed(const MouseEvent& event) {
if (state_ != BS_DISABLED) {
- if (ShouldEnterPushedState(e) && HitTest(e.location()))
+ if (ShouldEnterPushedState(event) && HitTest(event.location()))
SetState(BS_PUSHED);
if (request_focus_on_press_)
RequestFocus();
@@ -153,74 +153,74 @@ bool CustomButton::OnMousePressed(const MouseEvent& e) {
return true;
}
-bool CustomButton::OnMouseDragged(const MouseEvent& e) {
+bool CustomButton::OnMouseDragged(const MouseEvent& event) {
if (state_ != BS_DISABLED) {
- if (HitTest(e.location()))
- SetState(ShouldEnterPushedState(e) ? BS_PUSHED : BS_HOT);
+ if (HitTest(event.location()))
+ SetState(ShouldEnterPushedState(event) ? BS_PUSHED : BS_HOT);
else
SetState(BS_NORMAL);
}
return true;
}
-void CustomButton::OnMouseReleased(const MouseEvent& e, bool canceled) {
+void CustomButton::OnMouseReleased(const MouseEvent& event, bool canceled) {
// Starting a drag results in a MouseReleased, we need to ignore it.
if ((state_ == BS_DISABLED) || InDrag())
return;
- if (!HitTest(e.location())) {
+ if (!HitTest(event.location())) {
SetState(BS_NORMAL);
return;
}
SetState(BS_HOT);
- if (!canceled && IsTriggerableEvent(e)) {
- NotifyClick(e);
+ if (!canceled && IsTriggerableEvent(event)) {
+ NotifyClick(event);
// NOTE: We may be deleted at this point (by the listener's notification
// handler).
}
}
-void CustomButton::OnMouseEntered(const MouseEvent& e) {
+void CustomButton::OnMouseEntered(const MouseEvent& event) {
if (state_ != BS_DISABLED)
SetState(BS_HOT);
}
-void CustomButton::OnMouseMoved(const MouseEvent& e) {
+void CustomButton::OnMouseMoved(const MouseEvent& event) {
if (state_ != BS_DISABLED)
- SetState(HitTest(e.location()) ? BS_HOT : BS_NORMAL);
+ SetState(HitTest(event.location()) ? BS_HOT : BS_NORMAL);
}
-void CustomButton::OnMouseExited(const MouseEvent& e) {
+void CustomButton::OnMouseExited(const MouseEvent& event) {
// Starting a drag results in a MouseExited, we need to ignore it.
if (state_ != BS_DISABLED && !InDrag())
SetState(BS_NORMAL);
}
-bool CustomButton::OnKeyPressed(const KeyEvent& e) {
+bool CustomButton::OnKeyPressed(const KeyEvent& event) {
if (state_ == BS_DISABLED)
return false;
// Space sets button state to pushed. Enter clicks the button. This matches
// the Windows native behavior of buttons, where Space clicks the button on
// KeyRelease and Enter clicks the button on KeyPressed.
- if (e.key_code() == ui::VKEY_SPACE) {
+ if (event.key_code() == ui::VKEY_SPACE) {
SetState(BS_PUSHED);
- } else if (e.key_code() == ui::VKEY_RETURN) {
+ } else if (event.key_code() == ui::VKEY_RETURN) {
SetState(BS_NORMAL);
- NotifyClick(e);
+ NotifyClick(event);
} else {
return false;
}
return true;
}
-bool CustomButton::OnKeyReleased(const KeyEvent& e) {
- if ((state_ == BS_DISABLED) || (e.key_code() != ui::VKEY_SPACE))
+bool CustomButton::OnKeyReleased(const KeyEvent& event) {
+ if ((state_ == BS_DISABLED) || (event.key_code() != ui::VKEY_SPACE))
return false;
SetState(BS_NORMAL);
- NotifyClick(e);
+ NotifyClick(event);
return true;
}
@@ -271,8 +271,8 @@ void CustomButton::AnimationProgressed(const ui::Animation* animation) {
SchedulePaint();
}
-bool CustomButton::ShouldEnterPushedState(const MouseEvent& e) {
- return IsTriggerableEvent(e);
+bool CustomButton::ShouldEnterPushedState(const MouseEvent& event) {
+ return IsTriggerableEvent(event);
}
} // namespace views
diff --git a/views/controls/button/custom_button.h b/views/controls/button/custom_button.h
index 6dcabc9..3f6f22a 100644
--- a/views/controls/button/custom_button.h
+++ b/views/controls/button/custom_button.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2010 The Chromium Authors. All rights reserved.
+// Copyright (c) 2011 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -87,18 +87,18 @@ class CustomButton : public Button,
// Returns true if the event is one that can trigger notifying the listener.
// This implementation returns true if the left mouse button is down.
- virtual bool IsTriggerableEvent(const MouseEvent& e);
+ virtual bool IsTriggerableEvent(const MouseEvent& event);
// Overridden from View:
virtual bool AcceleratorPressed(const Accelerator& accelerator) OVERRIDE;
- virtual bool OnMousePressed(const MouseEvent& e) OVERRIDE;
- virtual bool OnMouseDragged(const MouseEvent& e) OVERRIDE;
- virtual void OnMouseReleased(const MouseEvent& e, bool canceled) OVERRIDE;
- virtual void OnMouseEntered(const MouseEvent& e) OVERRIDE;
- virtual void OnMouseMoved(const MouseEvent& e) OVERRIDE;
- virtual void OnMouseExited(const MouseEvent& e) OVERRIDE;
- virtual bool OnKeyPressed(const KeyEvent& e) OVERRIDE;
- virtual bool OnKeyReleased(const KeyEvent& e) OVERRIDE;
+ virtual bool OnMousePressed(const MouseEvent& event) OVERRIDE;
+ virtual bool OnMouseDragged(const MouseEvent& event) OVERRIDE;
+ virtual void OnMouseReleased(const MouseEvent& event, bool canceled) OVERRIDE;
+ virtual void OnMouseEntered(const MouseEvent& event) OVERRIDE;
+ virtual void OnMouseMoved(const MouseEvent& event) OVERRIDE;
+ virtual void OnMouseExited(const MouseEvent& event) OVERRIDE;
+ virtual bool OnKeyPressed(const KeyEvent& event) OVERRIDE;
+ virtual bool OnKeyReleased(const KeyEvent& event) OVERRIDE;
virtual void OnDragDone() OVERRIDE;
virtual void ShowContextMenu(const gfx::Point& p,
bool is_mouse_gesture) OVERRIDE;
@@ -114,8 +114,8 @@ class CustomButton : public Button,
// Returns true if the button should become pressed when the user
// holds the mouse down over the button. For this implementation,
- // we simply return IsTriggerableEvent(e).
- virtual bool ShouldEnterPushedState(const MouseEvent& e);
+ // we simply return IsTriggerableEvent(event).
+ virtual bool ShouldEnterPushedState(const MouseEvent& event);
// The button state (defined in implementation)
ButtonState state_;
diff --git a/views/controls/button/menu_button.cc b/views/controls/button/menu_button.cc
index a3859ba..822ca39 100644
--- a/views/controls/button/menu_button.cc
+++ b/views/controls/button/menu_button.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2010 The Chromium Authors. All rights reserved.
+// Copyright (c) 2011 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -188,13 +188,13 @@ bool MenuButton::Activate() {
return true;
}
-bool MenuButton::OnMousePressed(const MouseEvent& e) {
+bool MenuButton::OnMousePressed(const MouseEvent& event) {
RequestFocus();
if (state() != BS_DISABLED) {
// If we're draggable (GetDragOperations returns a non-zero value), then
// don't pop on press, instead wait for release.
- if (e.IsOnlyLeftMouseButton() && HitTest(e.location()) &&
- GetDragOperations(e.location()) == ui::DragDropTypes::DRAG_NONE) {
+ if (event.IsOnlyLeftMouseButton() && HitTest(event.location()) &&
+ GetDragOperations(event.location()) == ui::DragDropTypes::DRAG_NONE) {
TimeDelta delta = Time::Now() - menu_closed_time_;
int64 delta_in_milliseconds = delta.InMilliseconds();
if (delta_in_milliseconds > kMinimumTimeBetweenButtonClicks) {
@@ -205,23 +205,22 @@ bool MenuButton::OnMousePressed(const MouseEvent& e) {
return true;
}
-void MenuButton::OnMouseReleased(const MouseEvent& e,
- bool canceled) {
+void MenuButton::OnMouseReleased(const MouseEvent& event, bool canceled) {
// Explicitly test for left mouse button to show the menu. If we tested for
// !IsTriggerableEvent it could lead to a situation where we end up showing
// the menu and context menu (this would happen if the right button is not
// triggerable and there's a context menu).
- if (GetDragOperations(e.location()) != ui::DragDropTypes::DRAG_NONE &&
+ if (GetDragOperations(event.location()) != ui::DragDropTypes::DRAG_NONE &&
state() != BS_DISABLED && !canceled && !InDrag() &&
- e.IsOnlyLeftMouseButton() && HitTest(e.location())) {
+ event.IsOnlyLeftMouseButton() && HitTest(event.location())) {
Activate();
} else {
- TextButton::OnMouseReleased(e, canceled);
+ TextButton::OnMouseReleased(event, canceled);
}
}
-bool MenuButton::OnKeyPressed(const KeyEvent& e) {
- switch (e.key_code()) {
+bool MenuButton::OnKeyPressed(const KeyEvent& event) {
+ switch (event.key_code()) {
case ui::VKEY_SPACE:
case ui::VKEY_RETURN:
case ui::VKEY_UP:
@@ -237,7 +236,7 @@ bool MenuButton::OnKeyPressed(const KeyEvent& e) {
return false;
}
-bool MenuButton::OnKeyReleased(const KeyEvent& e) {
+bool MenuButton::OnKeyReleased(const KeyEvent& event) {
// Override CustomButton's implementation, which presses the button when
// you press space and clicks it when you release space. For a MenuButton
// we always activate the menu on key press.
diff --git a/views/controls/button/menu_button.h b/views/controls/button/menu_button.h
index eb5ca9c..d9622e4 100644
--- a/views/controls/button/menu_button.h
+++ b/views/controls/button/menu_button.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2010 The Chromium Authors. All rights reserved.
+// Copyright (c) 2011 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -51,17 +51,17 @@ class MenuButton : public TextButton {
// These methods are overriden to implement a simple push button
// behavior.
- virtual bool OnMousePressed(const MouseEvent& e);
- virtual void OnMouseReleased(const MouseEvent& e, bool canceled);
- virtual void OnMouseExited(const MouseEvent& event);
- virtual bool OnKeyPressed(const KeyEvent& e);
- virtual bool OnKeyReleased(const KeyEvent& e);
+ virtual bool OnMousePressed(const MouseEvent& event) OVERRIDE;
+ virtual void OnMouseReleased(const MouseEvent& event, bool canceled) OVERRIDE;
+ virtual void OnMouseExited(const MouseEvent& event) OVERRIDE;
+ virtual bool OnKeyPressed(const KeyEvent& event) OVERRIDE;
+ virtual bool OnKeyReleased(const KeyEvent& event) OVERRIDE;
// Accessibility accessors, overridden from View.
virtual void GetAccessibleState(ui::AccessibleViewState* state) OVERRIDE;
// Returns views/MenuButton.
- virtual std::string GetClassName() const;
+ virtual std::string GetClassName() const OVERRIDE;
// Accessors for menu_offset_.
const gfx::Point& menu_offset() const {