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

Side by Side Diff: ui/views/controls/button/custom_button.h

Issue 10546104: Make IsTriggerableEvent take Event objects and use it to verify whether tap events should trigger. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Pass Event to ShouldEnterPushedState. Created 8 years, 6 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 | « ui/views/controls/button/button_dropdown.cc ('k') | ui/views/controls/button/custom_button.cc » ('j') | 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) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 #ifndef UI_VIEWS_CONTROLS_BUTTON_CUSTOM_BUTTON_H_ 5 #ifndef UI_VIEWS_CONTROLS_BUTTON_CUSTOM_BUTTON_H_
6 #define UI_VIEWS_CONTROLS_BUTTON_CUSTOM_BUTTON_H_ 6 #define UI_VIEWS_CONTROLS_BUTTON_CUSTOM_BUTTON_H_
7 #pragma once 7 #pragma once
8 8
9 #include "ui/base/animation/animation_delegate.h" 9 #include "ui/base/animation/animation_delegate.h"
10 #include "ui/base/events.h" 10 #include "ui/base/events.h"
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
103 explicit CustomButton(ButtonListener* listener); 103 explicit CustomButton(ButtonListener* listener);
104 104
105 // Invoked from SetState() when SetState() is passed a value that differs from 105 // Invoked from SetState() when SetState() is passed a value that differs from
106 // the current state. CustomButton's implementation of StateChanged() does 106 // the current state. CustomButton's implementation of StateChanged() does
107 // nothing; this method is provided for subclasses that wish to do something 107 // nothing; this method is provided for subclasses that wish to do something
108 // on state changes. 108 // on state changes.
109 virtual void StateChanged(); 109 virtual void StateChanged();
110 110
111 // Returns true if the event is one that can trigger notifying the listener. 111 // Returns true if the event is one that can trigger notifying the listener.
112 // This implementation returns true if the left mouse button is down. 112 // This implementation returns true if the left mouse button is down.
113 virtual bool IsTriggerableEvent(const MouseEvent& event); 113 virtual bool IsTriggerableEvent(const Event& event);
114 114
115 // Returns true if the button should become pressed when the user 115 // Returns true if the button should become pressed when the user
116 // holds the mouse down over the button. For this implementation, 116 // holds the mouse down over the button. For this implementation,
117 // we simply return IsTriggerableEvent(event). 117 // we simply return IsTriggerableEvent(event).
118 virtual bool ShouldEnterPushedState(const MouseEvent& event); 118 virtual bool ShouldEnterPushedState(const Event& event);
119 119
120 // Overridden from View: 120 // Overridden from View:
121 virtual void ViewHierarchyChanged(bool is_add, 121 virtual void ViewHierarchyChanged(bool is_add,
122 View* parent, 122 View* parent,
123 View* child) OVERRIDE; 123 View* child) OVERRIDE;
124 virtual void OnBlur() OVERRIDE; 124 virtual void OnBlur() OVERRIDE;
125 125
126 // The button state (defined in implementation) 126 // The button state (defined in implementation)
127 ButtonState state_; 127 ButtonState state_;
128 128
(...skipping 12 matching lines...) Expand all
141 141
142 // See description above setter. 142 // See description above setter.
143 bool request_focus_on_press_; 143 bool request_focus_on_press_;
144 144
145 DISALLOW_COPY_AND_ASSIGN(CustomButton); 145 DISALLOW_COPY_AND_ASSIGN(CustomButton);
146 }; 146 };
147 147
148 } // namespace views 148 } // namespace views
149 149
150 #endif // UI_VIEWS_CONTROLS_BUTTON_CUSTOM_BUTTON_H_ 150 #endif // UI_VIEWS_CONTROLS_BUTTON_CUSTOM_BUTTON_H_
OLDNEW
« no previous file with comments | « ui/views/controls/button/button_dropdown.cc ('k') | ui/views/controls/button/custom_button.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698