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 191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
202 | 202 |
203 // The transparent buttons to handle events and render buttons. These are | 203 // The transparent buttons to handle events and render buttons. These are |
204 // placed on top of this combobox as child views, accept event and manage the | 204 // placed on top of this combobox as child views, accept event and manage the |
205 // button states. These are not rendered but when |style_| is | 205 // button states. These are not rendered but when |style_| is |
206 // STYLE_NOTIFY_ON_CLICK, a Combobox renders the button images according to | 206 // STYLE_NOTIFY_ON_CLICK, a Combobox renders the button images according to |
207 // these button states. | 207 // these button states. |
208 // The base View takes the ownerships of these as child views. | 208 // The base View takes the ownerships of these as child views. |
209 CustomButton* text_button_; | 209 CustomButton* text_button_; |
210 CustomButton* arrow_button_; | 210 CustomButton* arrow_button_; |
211 | 211 |
| 212 // A child that indicates focus. |
| 213 View* focus_ring_; |
| 214 |
212 // Set while the dropdown is showing. Ensures the menu is closed if |this| is | 215 // Set while the dropdown is showing. Ensures the menu is closed if |this| is |
213 // destroyed. | 216 // destroyed. |
214 std::unique_ptr<MenuModelAdapter> menu_model_adapter_; | 217 std::unique_ptr<MenuModelAdapter> menu_model_adapter_; |
215 std::unique_ptr<MenuRunner> menu_runner_; | 218 std::unique_ptr<MenuRunner> menu_runner_; |
216 | 219 |
217 // The image to be drawn for this combobox's arrow. | 220 // The image to be drawn for this combobox's arrow. |
218 gfx::ImageSkia arrow_image_; | 221 gfx::ImageSkia arrow_image_; |
219 | 222 |
220 // When true, the size of contents is defined by the selected label. | 223 // When true, the size of contents is defined by the selected label. |
221 // Otherwise, it's defined by the widest label in the menu. If this is set to | 224 // Otherwise, it's defined by the widest label in the menu. If this is set to |
222 // true, the parent view must relayout in ChildPreferredSizeChanged(). | 225 // true, the parent view must relayout in ChildPreferredSizeChanged(). |
223 bool size_to_largest_label_; | 226 bool size_to_largest_label_; |
224 | 227 |
225 // Used for making calbacks. | 228 // Used for making calbacks. |
226 base::WeakPtrFactory<Combobox> weak_ptr_factory_; | 229 base::WeakPtrFactory<Combobox> weak_ptr_factory_; |
227 | 230 |
228 DISALLOW_COPY_AND_ASSIGN(Combobox); | 231 DISALLOW_COPY_AND_ASSIGN(Combobox); |
229 }; | 232 }; |
230 | 233 |
231 } // namespace views | 234 } // namespace views |
232 | 235 |
233 #endif // UI_VIEWS_CONTROLS_COMBOBOX_COMBOBOX_H_ | 236 #endif // UI_VIEWS_CONTROLS_COMBOBOX_COMBOBOX_H_ |
OLD | NEW |