Chromium Code Reviews| 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 <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/time/time.h" | 10 #include "base/time/time.h" |
| (...skipping 18 matching lines...) Expand all Loading... | |
| 29 class ComboboxListener; | 29 class ComboboxListener; |
| 30 class ComboboxMenuRunner; | 30 class ComboboxMenuRunner; |
| 31 class CustomButton; | 31 class CustomButton; |
| 32 class FocusableBorder; | 32 class FocusableBorder; |
| 33 class MenuRunner; | 33 class MenuRunner; |
| 34 class MenuRunnerHandler; | 34 class MenuRunnerHandler; |
| 35 class Painter; | 35 class Painter; |
| 36 class PrefixSelector; | 36 class PrefixSelector; |
| 37 | 37 |
| 38 // A non-editable combobox (aka a drop-down list or selector). | 38 // A non-editable combobox (aka a drop-down list or selector). |
| 39 // Combobox has two distinct parts, the drop down arrow and the text. When the | 39 // Combobox has two distinct parts, the drop down arrow and the text. When the |
|
sky
2014/01/24 17:05:39
I think you've convinced me that for the style you
hajimehoshi
2014/01/24 18:07:09
Patch #3: The selected index is not cared.
Patch #
| |
| 40 // user clicks on the text the drop down is either shown | 40 // user clicks on the text the drop down is either shown |
| 41 // (STYLE_SHOW_DROP_DOWN_ON_CLICK) or the listener is notified | 41 // (STYLE_SHOW_DROP_DOWN_ON_CLICK) or the listener is notified |
| 42 // (STYLE_NOTIFY_ON_CLICK). | 42 // (STYLE_NOTIFY_ON_CLICK). |
| 43 class VIEWS_EXPORT Combobox : public MenuDelegate, | 43 class VIEWS_EXPORT Combobox : public MenuDelegate, |
| 44 public PrefixDelegate, | 44 public PrefixDelegate, |
| 45 public ui::ComboboxModelObserver, | 45 public ui::ComboboxModelObserver, |
| 46 public ButtonListener { | 46 public ButtonListener { |
| 47 public: | 47 public: |
| 48 // The style of the combobox. | 48 // The style of the combobox. |
| 49 enum Style { | 49 enum Style { |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 114 | 114 |
| 115 // Overriden from ComboboxModelObserver: | 115 // Overriden from ComboboxModelObserver: |
| 116 virtual void OnComboboxModelChanged(ui::ComboboxModel* model) OVERRIDE; | 116 virtual void OnComboboxModelChanged(ui::ComboboxModel* model) OVERRIDE; |
| 117 | 117 |
| 118 // Overriden from ButtonListener: | 118 // Overriden from ButtonListener: |
| 119 virtual void ButtonPressed(Button* sender, const ui::Event& event) OVERRIDE; | 119 virtual void ButtonPressed(Button* sender, const ui::Event& event) OVERRIDE; |
| 120 | 120 |
| 121 private: | 121 private: |
| 122 FRIEND_TEST_ALL_PREFIXES(ComboboxTest, Click); | 122 FRIEND_TEST_ALL_PREFIXES(ComboboxTest, Click); |
| 123 FRIEND_TEST_ALL_PREFIXES(ComboboxTest, NotifyOnClickWithMouse); | 123 FRIEND_TEST_ALL_PREFIXES(ComboboxTest, NotifyOnClickWithMouse); |
| 124 FRIEND_TEST_ALL_PREFIXES(ComboboxTest, ContentWidth); | |
| 124 | 125 |
| 125 // Updates the combobox's content from its model. | 126 // Updates the combobox's content from its model. |
| 126 void UpdateFromModel(); | 127 void UpdateFromModel(); |
| 127 | 128 |
| 128 // Updates the border according to the current state. | 129 // Updates the border according to the current state. |
| 129 void UpdateBorder(); | 130 void UpdateBorder(); |
| 130 | 131 |
| 131 // Given bounds within our View, this helper mirrors the bounds if necessary. | 132 // Given bounds within our View, this helper mirrors the bounds if necessary. |
| 132 void AdjustBoundsForRTLUI(gfx::Rect* rect) const; | 133 void AdjustBoundsForRTLUI(gfx::Rect* rect) const; |
| 133 | 134 |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 208 // The base View takes the ownerships of these as child views. | 209 // The base View takes the ownerships of these as child views. |
| 209 CustomButton* text_button_; | 210 CustomButton* text_button_; |
| 210 CustomButton* arrow_button_; | 211 CustomButton* arrow_button_; |
| 211 | 212 |
| 212 DISALLOW_COPY_AND_ASSIGN(Combobox); | 213 DISALLOW_COPY_AND_ASSIGN(Combobox); |
| 213 }; | 214 }; |
| 214 | 215 |
| 215 } // namespace views | 216 } // namespace views |
| 216 | 217 |
| 217 #endif // UI_VIEWS_CONTROLS_COMBOBOX_COMBOBOX_H_ | 218 #endif // UI_VIEWS_CONTROLS_COMBOBOX_COMBOBOX_H_ |
| OLD | NEW |