summaryrefslogtreecommitdiffstats
path: root/views/controls/button/custom_button.cc
diff options
context:
space:
mode:
authorben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-02-10 04:56:36 +0000
committerben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-02-10 04:56:36 +0000
commit8d577a70f6e6d2e47f0ac32f8606e489a7a77998 (patch)
tree48eae3f525e0323362db629efa2589e70a5a4e49 /views/controls/button/custom_button.cc
parent8fb0ecf45b286845fd2004a157a294d7e3ca7a39 (diff)
downloadchromium_src-8d577a70f6e6d2e47f0ac32f8606e489a7a77998.zip
chromium_src-8d577a70f6e6d2e47f0ac32f8606e489a7a77998.tar.gz
chromium_src-8d577a70f6e6d2e47f0ac32f8606e489a7a77998.tar.bz2
Migrate Event API methods to Google Style.
Re-landing, moving the bits Mac uses to ui/base/events.h BUG=72040 TEST=none TBR=sky Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=74377 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@74408 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'views/controls/button/custom_button.cc')
-rw-r--r--views/controls/button/custom_button.cc12
1 files changed, 6 insertions, 6 deletions
diff --git a/views/controls/button/custom_button.cc b/views/controls/button/custom_button.cc
index 56abaeb..cf2f752 100644
--- a/views/controls/button/custom_button.cc
+++ b/views/controls/button/custom_button.cc
@@ -118,14 +118,14 @@ CustomButton::CustomButton(ButtonListener* listener)
state_(BS_NORMAL),
animate_on_state_change_(true),
is_throbbing_(false),
- triggerable_event_flags_(MouseEvent::EF_LEFT_BUTTON_DOWN),
+ triggerable_event_flags_(ui::EF_LEFT_BUTTON_DOWN),
request_focus_on_press_(true) {
hover_animation_.reset(new ui::ThrobAnimation(this));
hover_animation_->SetSlideDuration(kHoverFadeDurationMs);
}
bool CustomButton::IsTriggerableEvent(const MouseEvent& e) {
- return (triggerable_event_flags_ & e.GetFlags()) != 0;
+ return (triggerable_event_flags_ & e.flags()) != 0;
}
////////////////////////////////////////////////////////////////////////////////
@@ -136,7 +136,7 @@ bool CustomButton::AcceleratorPressed(const Accelerator& accelerator) {
return false;
SetState(BS_NORMAL);
- KeyEvent key_event(Event::ET_KEY_RELEASED, accelerator.GetKeyCode(),
+ KeyEvent key_event(ui::ET_KEY_RELEASED, accelerator.GetKeyCode(),
accelerator.modifiers(), 0, 0);
NotifyClick(key_event);
return true;
@@ -203,9 +203,9 @@ bool CustomButton::OnKeyPressed(const KeyEvent& e) {
// 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.GetKeyCode() == ui::VKEY_SPACE) {
+ if (e.key_code() == ui::VKEY_SPACE) {
SetState(BS_PUSHED);
- } else if (e.GetKeyCode() == ui::VKEY_RETURN) {
+ } else if (e.key_code() == ui::VKEY_RETURN) {
SetState(BS_NORMAL);
NotifyClick(e);
} else {
@@ -215,7 +215,7 @@ bool CustomButton::OnKeyPressed(const KeyEvent& e) {
}
bool CustomButton::OnKeyReleased(const KeyEvent& e) {
- if ((state_ == BS_DISABLED) || (e.GetKeyCode() != ui::VKEY_SPACE))
+ if ((state_ == BS_DISABLED) || (e.key_code() != ui::VKEY_SPACE))
return false;
SetState(BS_NORMAL);