OLD | NEW |
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_COMBOBOX_COMBOBOX_H_ | 5 #ifndef UI_VIEWS_CONTROLS_COMBOBOX_COMBOBOX_H_ |
6 #define UI_VIEWS_CONTROLS_COMBOBOX_COMBOBOX_H_ | 6 #define UI_VIEWS_CONTROLS_COMBOBOX_COMBOBOX_H_ |
7 | 7 |
8 #include "base/macros.h" | 8 #include "base/macros.h" |
9 #include "base/memory/weak_ptr.h" | 9 #include "base/memory/weak_ptr.h" |
10 #include "base/strings/string16.h" | 10 #include "base/strings/string16.h" |
(...skipping 18 matching lines...) Expand all Loading... |
29 class ComboboxListener; | 29 class ComboboxListener; |
30 class CustomButton; | 30 class CustomButton; |
31 class MenuRunner; | 31 class MenuRunner; |
32 class Painter; | 32 class Painter; |
33 class PrefixSelector; | 33 class PrefixSelector; |
34 | 34 |
35 // A non-editable combobox (aka a drop-down list or selector). | 35 // A non-editable combobox (aka a drop-down list or selector). |
36 // Combobox has two distinct parts, the drop down arrow and the text. Combobox | 36 // Combobox has two distinct parts, the drop down arrow and the text. Combobox |
37 // offers two distinct behaviors: | 37 // offers two distinct behaviors: |
38 // * STYLE_NORMAL: typical combobox, clicking on the text and/or button shows | 38 // * STYLE_NORMAL: typical combobox, clicking on the text and/or button shows |
39 // the drop down, arrow keys change selection, selected index can be changed by | 39 // the drop down, arrow keys change selection or show the menu depending on |
40 // the user to something other than the first item. | 40 // the platform, selected index can be changed by the user to something other |
| 41 // than the first item. |
41 // * STYLE_ACTION: clicking on the text notifies the listener. The menu can be | 42 // * STYLE_ACTION: clicking on the text notifies the listener. The menu can be |
42 // shown only by clicking on the arrow. The selected index is always reverted to | 43 // shown only by clicking on the arrow, except on Mac where it can be shown |
43 // 0 after the listener is notified. | 44 // through the keyboard. The selected index is always reverted to 0 after the |
| 45 // listener is notified. |
44 class VIEWS_EXPORT Combobox : public View, | 46 class VIEWS_EXPORT Combobox : public View, |
45 public PrefixDelegate, | 47 public PrefixDelegate, |
46 public ButtonListener { | 48 public ButtonListener { |
47 public: | 49 public: |
48 // The style of the combobox. | 50 // The style of the combobox. |
49 enum Style { | 51 enum Style { |
50 STYLE_NORMAL, | 52 STYLE_NORMAL, |
51 STYLE_ACTION, | 53 STYLE_ACTION, |
52 }; | 54 }; |
53 | 55 |
(...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
222 | 224 |
223 // Used for making calbacks. | 225 // Used for making calbacks. |
224 base::WeakPtrFactory<Combobox> weak_ptr_factory_; | 226 base::WeakPtrFactory<Combobox> weak_ptr_factory_; |
225 | 227 |
226 DISALLOW_COPY_AND_ASSIGN(Combobox); | 228 DISALLOW_COPY_AND_ASSIGN(Combobox); |
227 }; | 229 }; |
228 | 230 |
229 } // namespace views | 231 } // namespace views |
230 | 232 |
231 #endif // UI_VIEWS_CONTROLS_COMBOBOX_COMBOBOX_H_ | 233 #endif // UI_VIEWS_CONTROLS_COMBOBOX_COMBOBOX_H_ |
OLD | NEW |