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/memory/weak_ptr.h" | 10 #include "base/memory/weak_ptr.h" |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
86 // Set the accessible name of the combobox. | 86 // Set the accessible name of the combobox. |
87 void SetAccessibleName(const base::string16& name); | 87 void SetAccessibleName(const base::string16& name); |
88 | 88 |
89 // Visually marks the combobox as having an invalid value selected. | 89 // Visually marks the combobox as having an invalid value selected. |
90 // When invalid, it paints with white text on a red background. | 90 // When invalid, it paints with white text on a red background. |
91 // Callers are responsible for restoring validity with selection changes. | 91 // Callers are responsible for restoring validity with selection changes. |
92 void SetInvalid(bool invalid); | 92 void SetInvalid(bool invalid); |
93 bool invalid() const { return invalid_; } | 93 bool invalid() const { return invalid_; } |
94 | 94 |
95 // Overridden from View: | 95 // Overridden from View: |
96 virtual gfx::Size GetPreferredSize() const OVERRIDE; | 96 virtual gfx::Size GetPreferredSize() const override; |
97 virtual const char* GetClassName() const OVERRIDE; | 97 virtual const char* GetClassName() const override; |
98 virtual bool SkipDefaultKeyEventProcessing(const ui::KeyEvent& e) OVERRIDE; | 98 virtual bool SkipDefaultKeyEventProcessing(const ui::KeyEvent& e) override; |
99 virtual bool OnKeyPressed(const ui::KeyEvent& e) OVERRIDE; | 99 virtual bool OnKeyPressed(const ui::KeyEvent& e) override; |
100 virtual bool OnKeyReleased(const ui::KeyEvent& e) OVERRIDE; | 100 virtual bool OnKeyReleased(const ui::KeyEvent& e) override; |
101 virtual void OnPaint(gfx::Canvas* canvas) OVERRIDE; | 101 virtual void OnPaint(gfx::Canvas* canvas) override; |
102 virtual void OnFocus() OVERRIDE; | 102 virtual void OnFocus() override; |
103 virtual void OnBlur() OVERRIDE; | 103 virtual void OnBlur() override; |
104 virtual void GetAccessibleState(ui::AXViewState* state) OVERRIDE; | 104 virtual void GetAccessibleState(ui::AXViewState* state) override; |
105 virtual ui::TextInputClient* GetTextInputClient() OVERRIDE; | 105 virtual ui::TextInputClient* GetTextInputClient() override; |
106 virtual void Layout() OVERRIDE; | 106 virtual void Layout() override; |
107 | 107 |
108 // Overridden from MenuDelegate: | 108 // Overridden from MenuDelegate: |
109 virtual bool IsItemChecked(int id) const OVERRIDE; | 109 virtual bool IsItemChecked(int id) const override; |
110 virtual bool IsCommandEnabled(int id) const OVERRIDE; | 110 virtual bool IsCommandEnabled(int id) const override; |
111 virtual void ExecuteCommand(int id) OVERRIDE; | 111 virtual void ExecuteCommand(int id) override; |
112 virtual bool GetAccelerator(int id, | 112 virtual bool GetAccelerator(int id, |
113 ui::Accelerator* accelerator) const OVERRIDE; | 113 ui::Accelerator* accelerator) const override; |
114 | 114 |
115 // Overridden from PrefixDelegate: | 115 // Overridden from PrefixDelegate: |
116 virtual int GetRowCount() OVERRIDE; | 116 virtual int GetRowCount() override; |
117 virtual int GetSelectedRow() OVERRIDE; | 117 virtual int GetSelectedRow() override; |
118 virtual void SetSelectedRow(int row) OVERRIDE; | 118 virtual void SetSelectedRow(int row) override; |
119 virtual base::string16 GetTextForRow(int row) OVERRIDE; | 119 virtual base::string16 GetTextForRow(int row) override; |
120 | 120 |
121 // Overriden from ComboboxModelObserver: | 121 // Overriden from ComboboxModelObserver: |
122 virtual void OnComboboxModelChanged(ui::ComboboxModel* model) OVERRIDE; | 122 virtual void OnComboboxModelChanged(ui::ComboboxModel* model) override; |
123 | 123 |
124 // Overriden from ButtonListener: | 124 // Overriden from ButtonListener: |
125 virtual void ButtonPressed(Button* sender, const ui::Event& event) OVERRIDE; | 125 virtual void ButtonPressed(Button* sender, const ui::Event& event) override; |
126 | 126 |
127 private: | 127 private: |
128 FRIEND_TEST_ALL_PREFIXES(ComboboxTest, Click); | 128 FRIEND_TEST_ALL_PREFIXES(ComboboxTest, Click); |
129 FRIEND_TEST_ALL_PREFIXES(ComboboxTest, ClickButDisabled); | 129 FRIEND_TEST_ALL_PREFIXES(ComboboxTest, ClickButDisabled); |
130 FRIEND_TEST_ALL_PREFIXES(ComboboxTest, NotifyOnClickWithMouse); | 130 FRIEND_TEST_ALL_PREFIXES(ComboboxTest, NotifyOnClickWithMouse); |
131 FRIEND_TEST_ALL_PREFIXES(ComboboxTest, ContentWidth); | 131 FRIEND_TEST_ALL_PREFIXES(ComboboxTest, ContentWidth); |
132 | 132 |
133 // Updates the combobox's content from its model. | 133 // Updates the combobox's content from its model. |
134 void UpdateFromModel(); | 134 void UpdateFromModel(); |
135 | 135 |
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
224 | 224 |
225 // Used for making calbacks. | 225 // Used for making calbacks. |
226 base::WeakPtrFactory<Combobox> weak_ptr_factory_; | 226 base::WeakPtrFactory<Combobox> weak_ptr_factory_; |
227 | 227 |
228 DISALLOW_COPY_AND_ASSIGN(Combobox); | 228 DISALLOW_COPY_AND_ASSIGN(Combobox); |
229 }; | 229 }; |
230 | 230 |
231 } // namespace views | 231 } // namespace views |
232 | 232 |
233 #endif // UI_VIEWS_CONTROLS_COMBOBOX_COMBOBOX_H_ | 233 #endif // UI_VIEWS_CONTROLS_COMBOBOX_COMBOBOX_H_ |
OLD | NEW |