OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 VIEWS_CONTROLS_BUTTON_NATIVE_BUTTON_H_ | 5 #ifndef VIEWS_CONTROLS_BUTTON_NATIVE_BUTTON_H_ |
6 #define VIEWS_CONTROLS_BUTTON_NATIVE_BUTTON_H_ | 6 #define VIEWS_CONTROLS_BUTTON_NATIVE_BUTTON_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 // TODO(avi): remove when not needed | 9 // TODO(avi): remove when not needed |
10 #include "base/utf_string_conversions.h" | 10 #include "base/utf_string_conversions.h" |
(...skipping 26 matching lines...) Expand all Loading... |
37 | 37 |
38 // Sets/Gets whether or not the button appears and behaves as the default | 38 // Sets/Gets whether or not the button appears and behaves as the default |
39 // button in its current context. | 39 // button in its current context. |
40 void SetIsDefault(bool default_button); | 40 void SetIsDefault(bool default_button); |
41 bool is_default() const { return is_default_; } | 41 bool is_default() const { return is_default_; } |
42 | 42 |
43 // Sets/Gets whether or not pressing this button requires elevation. | 43 // Sets/Gets whether or not pressing this button requires elevation. |
44 void SetNeedElevation(bool need_elevation); | 44 void SetNeedElevation(bool need_elevation); |
45 bool need_elevation() const { return need_elevation_; } | 45 bool need_elevation() const { return need_elevation_; } |
46 | 46 |
47 // Sets whether or not the button appears as the default button. This does | |
48 // not make it behave as the default (i.e. no enter key accelerator is | |
49 // registered, use SetIsDefault for that). | |
50 void SetAppearsAsDefault(bool default_button); | |
51 | |
52 void set_ignore_minimum_size(bool ignore_minimum_size) { | 47 void set_ignore_minimum_size(bool ignore_minimum_size) { |
53 ignore_minimum_size_ = ignore_minimum_size; | 48 ignore_minimum_size_ = ignore_minimum_size; |
54 } | 49 } |
55 | 50 |
56 // Called by the wrapper when the actual wrapped native button was pressed. | 51 // Called by the wrapper when the actual wrapped native button was pressed. |
57 void ButtonPressed(); | 52 void ButtonPressed(); |
58 | 53 |
59 // Overridden from View: | 54 // Overridden from View: |
60 virtual gfx::Size GetPreferredSize(); | 55 virtual gfx::Size GetPreferredSize(); |
61 virtual void Layout(); | 56 virtual void Layout(); |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
99 // True if the button should ignore the minimum size for the platform. Default | 94 // True if the button should ignore the minimum size for the platform. Default |
100 // is false. Set to true to create narrower buttons. | 95 // is false. Set to true to create narrower buttons. |
101 bool ignore_minimum_size_; | 96 bool ignore_minimum_size_; |
102 | 97 |
103 DISALLOW_COPY_AND_ASSIGN(NativeButton); | 98 DISALLOW_COPY_AND_ASSIGN(NativeButton); |
104 }; | 99 }; |
105 | 100 |
106 } // namespace views | 101 } // namespace views |
107 | 102 |
108 #endif // VIEWS_CONTROLS_BUTTON_NATIVE_BUTTON_H_ | 103 #endif // VIEWS_CONTROLS_BUTTON_NATIVE_BUTTON_H_ |
OLD | NEW |