| 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 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 78 | 78 |
| 79 // Set the accessible name of the combobox. | 79 // Set the accessible name of the combobox. |
| 80 void SetAccessibleName(const base::string16& name); | 80 void SetAccessibleName(const base::string16& name); |
| 81 | 81 |
| 82 // Visually marks the combobox as having an invalid value selected. | 82 // Visually marks the combobox as having an invalid value selected. |
| 83 // When invalid, it paints with white text on a red background. | 83 // When invalid, it paints with white text on a red background. |
| 84 // Callers are responsible for restoring validity with selection changes. | 84 // Callers are responsible for restoring validity with selection changes. |
| 85 void SetInvalid(bool invalid); | 85 void SetInvalid(bool invalid); |
| 86 bool invalid() const { return invalid_; } | 86 bool invalid() const { return invalid_; } |
| 87 | 87 |
| 88 // Returns the width of the arrow button component of the combobox: the arrow |
| 89 // button itself, and the padding on either side of it. |
| 90 int GetArrowButtonWidth() const; |
| 91 |
| 88 // Overridden from View: | 92 // Overridden from View: |
| 89 gfx::Size GetPreferredSize() const override; | 93 gfx::Size GetPreferredSize() const override; |
| 90 const char* GetClassName() const override; | 94 const char* GetClassName() const override; |
| 91 bool SkipDefaultKeyEventProcessing(const ui::KeyEvent& e) override; | 95 bool SkipDefaultKeyEventProcessing(const ui::KeyEvent& e) override; |
| 92 bool OnKeyPressed(const ui::KeyEvent& e) override; | 96 bool OnKeyPressed(const ui::KeyEvent& e) override; |
| 93 bool OnKeyReleased(const ui::KeyEvent& e) override; | 97 bool OnKeyReleased(const ui::KeyEvent& e) override; |
| 94 void OnPaint(gfx::Canvas* canvas) override; | 98 void OnPaint(gfx::Canvas* canvas) override; |
| 95 void OnFocus() override; | 99 void OnFocus() override; |
| 96 void OnBlur() override; | 100 void OnBlur() override; |
| 97 void GetAccessibleState(ui::AXViewState* state) override; | 101 void GetAccessibleState(ui::AXViewState* state) override; |
| (...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 201 | 205 |
| 202 // Used for making calbacks. | 206 // Used for making calbacks. |
| 203 base::WeakPtrFactory<Combobox> weak_ptr_factory_; | 207 base::WeakPtrFactory<Combobox> weak_ptr_factory_; |
| 204 | 208 |
| 205 DISALLOW_COPY_AND_ASSIGN(Combobox); | 209 DISALLOW_COPY_AND_ASSIGN(Combobox); |
| 206 }; | 210 }; |
| 207 | 211 |
| 208 } // namespace views | 212 } // namespace views |
| 209 | 213 |
| 210 #endif // UI_VIEWS_CONTROLS_COMBOBOX_COMBOBOX_H_ | 214 #endif // UI_VIEWS_CONTROLS_COMBOBOX_COMBOBOX_H_ |
| OLD | NEW |