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

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

Issue 2607923002: MacViews: Handle Space and Return keys correctly for Buttons. (Closed)
Patch Set: Address review. Created 3 years, 11 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
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 7
8 #include <memory> 8 #include <memory>
9 9
10 #include "base/macros.h" 10 #include "base/macros.h"
(...skipping 11 matching lines...) Expand all
22 // part of the focus chain, unless in accessibility mode. Call 22 // part of the focus chain, unless in accessibility mode. Call
23 // SetFocusForPlatform() to make it part of the focus chain. 23 // SetFocusForPlatform() to make it part of the focus chain.
24 class VIEWS_EXPORT CustomButton : public Button, public gfx::AnimationDelegate { 24 class VIEWS_EXPORT CustomButton : public Button, public gfx::AnimationDelegate {
25 public: 25 public:
26 // An enum describing the events on which a button should notify its listener. 26 // An enum describing the events on which a button should notify its listener.
27 enum NotifyAction { 27 enum NotifyAction {
28 NOTIFY_ON_PRESS, 28 NOTIFY_ON_PRESS,
29 NOTIFY_ON_RELEASE, 29 NOTIFY_ON_RELEASE,
30 }; 30 };
31 31
32 // An enum describing the events on which a button should be clicked for a
33 // given key event.
34 enum ClickAction {
35 CLICK_ON_PRESS,
tapted 2017/01/05 00:34:41 I toyed with buttons a bit manually, and realised
karandeepb 2017/01/05 10:50:08 Done.
36 CLICK_ON_RELEASE,
37 CLICK_NONE,
38 };
39
32 // The menu button's class name. 40 // The menu button's class name.
33 static const char kViewClassName[]; 41 static const char kViewClassName[];
34 42
35 static const CustomButton* AsCustomButton(const View* view); 43 static const CustomButton* AsCustomButton(const View* view);
36 static CustomButton* AsCustomButton(View* view); 44 static CustomButton* AsCustomButton(View* view);
37 45
38 ~CustomButton() override; 46 ~CustomButton() override;
39 47
40 // Get/sets the current display state of the button. 48 // Get/sets the current display state of the button.
41 ButtonState state() const { return state_; } 49 ButtonState state() const { return state_; }
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after
193 201
194 // The color of the ripple and hover. 202 // The color of the ripple and hover.
195 SkColor ink_drop_base_color_; 203 SkColor ink_drop_base_color_;
196 204
197 DISALLOW_COPY_AND_ASSIGN(CustomButton); 205 DISALLOW_COPY_AND_ASSIGN(CustomButton);
198 }; 206 };
199 207
200 } // namespace views 208 } // namespace views
201 209
202 #endif // UI_VIEWS_CONTROLS_BUTTON_CUSTOM_BUTTON_H_ 210 #endif // UI_VIEWS_CONTROLS_BUTTON_CUSTOM_BUTTON_H_
OLDNEW
« no previous file with comments | « no previous file | ui/views/controls/button/custom_button.cc » ('j') | ui/views/controls/button/custom_button_unittest.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698