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

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

Issue 12330002: Add views::Button style enum for LabelButton [native] styling, etc. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Sync and merge. Created 7 years, 10 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/app_list/views/signin_view.cc ('k') | ui/views/controls/button/custom_button.h » ('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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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_BUTTON_H_ 5 #ifndef UI_VIEWS_CONTROLS_BUTTON_BUTTON_H_
6 #define UI_VIEWS_CONTROLS_BUTTON_BUTTON_H_ 6 #define UI_VIEWS_CONTROLS_BUTTON_BUTTON_H_
7 7
8 #include "ui/views/view.h" 8 #include "ui/views/view.h"
9 9
10 namespace views { 10 namespace views {
(...skipping 10 matching lines...) Expand all
21 protected: 21 protected:
22 virtual ~ButtonListener() {} 22 virtual ~ButtonListener() {}
23 }; 23 };
24 24
25 // A View representing a button. Depending on the specific type, the button 25 // A View representing a button. Depending on the specific type, the button
26 // could be implemented by a native control or custom rendered. 26 // could be implemented by a native control or custom rendered.
27 class VIEWS_EXPORT Button : public View { 27 class VIEWS_EXPORT Button : public View {
28 public: 28 public:
29 virtual ~Button(); 29 virtual ~Button();
30 30
31 // Button states for various button sub-types.
32 // TODO(msw): Add toggled state for checkboxes, radio buttons, etc.
33 enum ButtonState {
34 STATE_NORMAL = 0,
35 STATE_HOVERED,
36 STATE_PRESSED,
37 STATE_DISABLED,
38 STATE_COUNT,
39 };
40
41 // Button styles with associated images and border painters.
42 // TODO(msw): Add "Chrome Style", Checkbox, Radio, Menu, ComboBox, etc.
43 enum ButtonStyle {
44 STYLE_TEXTBUTTON = 0,
45 STYLE_NATIVE_TEXTBUTTON,
46 STYLE_COUNT,
47 };
48
31 void SetTooltipText(const string16& tooltip_text); 49 void SetTooltipText(const string16& tooltip_text);
32 50
33 int tag() const { return tag_; } 51 int tag() const { return tag_; }
34 void set_tag(int tag) { tag_ = tag; } 52 void set_tag(int tag) { tag_ = tag; }
35 53
36 void SetAccessibleName(const string16& name); 54 void SetAccessibleName(const string16& name);
37 55
38 // Overridden from View: 56 // Overridden from View:
39 virtual bool GetTooltipText(const gfx::Point& p, 57 virtual bool GetTooltipText(const gfx::Point& p,
40 string16* tooltip) const OVERRIDE; 58 string16* tooltip) const OVERRIDE;
(...skipping 21 matching lines...) Expand all
62 // The id tag associated with this button. Used to disambiguate buttons in 80 // The id tag associated with this button. Used to disambiguate buttons in
63 // the ButtonListener implementation. 81 // the ButtonListener implementation.
64 int tag_; 82 int tag_;
65 83
66 DISALLOW_COPY_AND_ASSIGN(Button); 84 DISALLOW_COPY_AND_ASSIGN(Button);
67 }; 85 };
68 86
69 } // namespace views 87 } // namespace views
70 88
71 #endif // UI_VIEWS_CONTROLS_BUTTON_BUTTON_H_ 89 #endif // UI_VIEWS_CONTROLS_BUTTON_BUTTON_H_
OLDNEW
« no previous file with comments | « ui/app_list/views/signin_view.cc ('k') | ui/views/controls/button/custom_button.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698