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

Side by Side Diff: chrome/views/controls/button/custom_button.cc

Issue 42571: Reverting r12383, caused a build breakage on all platforms. (Closed) Base URL: svn://chrome-svn/chrome/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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/views/controls/button/custom_button.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/views/controls/button/custom_button.h" 5 #include "chrome/views/controls/button/custom_button.h"
6 6
7 #include "base/keyboard_codes.h" 7 #include "base/keyboard_codes.h"
8 #include "chrome/common/drag_drop_types.h" 8 #include "chrome/common/drag_drop_types.h"
9 #include "chrome/common/gfx/chrome_canvas.h" 9 #include "chrome/common/gfx/chrome_canvas.h"
10 #include "chrome/common/throb_animation.h" 10 #include "chrome/common/throb_animation.h"
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
75 bool CustomButton::IsFocusable() const { 75 bool CustomButton::IsFocusable() const {
76 return (state_ != BS_DISABLED) && View::IsFocusable(); 76 return (state_ != BS_DISABLED) && View::IsFocusable();
77 } 77 }
78 78
79 //////////////////////////////////////////////////////////////////////////////// 79 ////////////////////////////////////////////////////////////////////////////////
80 // CustomButton, protected: 80 // CustomButton, protected:
81 81
82 CustomButton::CustomButton(ButtonListener* listener) 82 CustomButton::CustomButton(ButtonListener* listener)
83 : Button(listener), 83 : Button(listener),
84 state_(BS_NORMAL), 84 state_(BS_NORMAL),
85 animate_on_state_change_(true), 85 animate_on_state_change_(true) {
86 triggerable_event_flags_(MouseEvent::EF_LEFT_BUTTON_DOWN) {
87 hover_animation_.reset(new ThrobAnimation(this)); 86 hover_animation_.reset(new ThrobAnimation(this));
88 hover_animation_->SetSlideDuration(kHoverFadeDurationMs); 87 hover_animation_->SetSlideDuration(kHoverFadeDurationMs);
89 } 88 }
90 89
91 bool CustomButton::IsTriggerableEvent(const MouseEvent& e) { 90 bool CustomButton::IsTriggerableEvent(const MouseEvent& e) {
92 return (triggerable_event_flags_ & e.GetFlags()) != 0; 91 return e.IsLeftMouseButton();
93 } 92 }
94 93
95 //////////////////////////////////////////////////////////////////////////////// 94 ////////////////////////////////////////////////////////////////////////////////
96 // CustomButton, View overrides (protected): 95 // CustomButton, View overrides (protected):
97 96
98 bool CustomButton::AcceleratorPressed(const Accelerator& accelerator) { 97 bool CustomButton::AcceleratorPressed(const Accelerator& accelerator) {
99 if (enabled_) { 98 if (enabled_) {
100 SetState(BS_NORMAL); 99 SetState(BS_NORMAL);
101 NotifyClick(0); 100 NotifyClick(0);
102 return true; 101 return true;
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after
236 235
237 bool CustomButton::IsHighlighted() const { 236 bool CustomButton::IsHighlighted() const {
238 return state_ == BS_HOT; 237 return state_ == BS_HOT;
239 } 238 }
240 239
241 bool CustomButton::IsPushed() const { 240 bool CustomButton::IsPushed() const {
242 return state_ == BS_PUSHED; 241 return state_ == BS_PUSHED;
243 } 242 }
244 243
245 } // namespace views 244 } // namespace views
OLDNEW
« no previous file with comments | « chrome/views/controls/button/custom_button.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698