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_TEXTFIELD_TEXTFIELD_H_ | 5 #ifndef UI_VIEWS_CONTROLS_TEXTFIELD_TEXTFIELD_H_ |
6 #define UI_VIEWS_CONTROLS_TEXTFIELD_TEXTFIELD_H_ | 6 #define UI_VIEWS_CONTROLS_TEXTFIELD_TEXTFIELD_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
(...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
195 int* formats, | 195 int* formats, |
196 std::set<ui::OSExchangeData::CustomFormat>* custom_formats) OVERRIDE; | 196 std::set<ui::OSExchangeData::CustomFormat>* custom_formats) OVERRIDE; |
197 virtual bool CanDrop(const ui::OSExchangeData& data) OVERRIDE; | 197 virtual bool CanDrop(const ui::OSExchangeData& data) OVERRIDE; |
198 virtual int OnDragUpdated(const ui::DropTargetEvent& event) OVERRIDE; | 198 virtual int OnDragUpdated(const ui::DropTargetEvent& event) OVERRIDE; |
199 virtual void OnDragExited() OVERRIDE; | 199 virtual void OnDragExited() OVERRIDE; |
200 virtual int OnPerformDrop(const ui::DropTargetEvent& event) OVERRIDE; | 200 virtual int OnPerformDrop(const ui::DropTargetEvent& event) OVERRIDE; |
201 virtual void OnDragDone() OVERRIDE; | 201 virtual void OnDragDone() OVERRIDE; |
202 virtual void GetAccessibleState(ui::AXViewState* state) OVERRIDE; | 202 virtual void GetAccessibleState(ui::AXViewState* state) OVERRIDE; |
203 virtual void OnBoundsChanged(const gfx::Rect& previous_bounds) OVERRIDE; | 203 virtual void OnBoundsChanged(const gfx::Rect& previous_bounds) OVERRIDE; |
204 virtual void OnEnabledChanged() OVERRIDE; | 204 virtual void OnEnabledChanged() OVERRIDE; |
205 virtual void ViewHierarchyChanged( | |
206 const ViewHierarchyChangedDetails& details) OVERRIDE; | |
207 virtual void OnPaint(gfx::Canvas* canvas) OVERRIDE; | 205 virtual void OnPaint(gfx::Canvas* canvas) OVERRIDE; |
208 virtual void OnFocus() OVERRIDE; | 206 virtual void OnFocus() OVERRIDE; |
209 virtual void OnBlur() OVERRIDE; | 207 virtual void OnBlur() OVERRIDE; |
210 virtual gfx::Point GetKeyboardContextMenuLocation() OVERRIDE; | 208 virtual gfx::Point GetKeyboardContextMenuLocation() OVERRIDE; |
211 virtual void OnNativeThemeChanged(const ui::NativeTheme* theme) OVERRIDE; | 209 virtual void OnNativeThemeChanged(const ui::NativeTheme* theme) OVERRIDE; |
212 | 210 |
213 // TextfieldModel::Delegate overrides: | 211 // TextfieldModel::Delegate overrides: |
214 virtual void OnCompositionTextConfirmedOrCleared() OVERRIDE; | 212 virtual void OnCompositionTextConfirmedOrCleared() OVERRIDE; |
215 | 213 |
216 // ContextMenuController overrides: | 214 // ContextMenuController overrides: |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
293 friend class TouchSelectionControllerImplTest; | 291 friend class TouchSelectionControllerImplTest; |
294 | 292 |
295 // Handles a request to change the value of this text field from software | 293 // Handles a request to change the value of this text field from software |
296 // using an accessibility API (typically automation software, screen readers | 294 // using an accessibility API (typically automation software, screen readers |
297 // don't normally use this). Sets the value and clears the selection. | 295 // don't normally use this). Sets the value and clears the selection. |
298 void AccessibilitySetValue(const base::string16& new_value); | 296 void AccessibilitySetValue(const base::string16& new_value); |
299 | 297 |
300 // Updates the painted background color. | 298 // Updates the painted background color. |
301 void UpdateBackgroundColor(); | 299 void UpdateBackgroundColor(); |
302 | 300 |
303 // Updates any colors that have not been explicitly set from the theme. | |
304 void UpdateColorsFromTheme(const ui::NativeTheme* theme); | |
305 | |
306 // Does necessary updates when the text and/or cursor position changes. | 301 // Does necessary updates when the text and/or cursor position changes. |
307 void UpdateAfterChange(bool text_changed, bool cursor_changed); | 302 void UpdateAfterChange(bool text_changed, bool cursor_changed); |
308 | 303 |
309 // A callback function to periodically update the cursor state. | 304 // A callback function to periodically update the cursor state. |
310 void UpdateCursor(); | 305 void UpdateCursor(); |
311 | 306 |
312 // Repaint the cursor. | 307 // Repaint the cursor. |
313 void RepaintCursor(); | 308 void RepaintCursor(); |
314 | 309 |
315 void PaintTextAndCursor(gfx::Canvas* canvas); | 310 void PaintTextAndCursor(gfx::Canvas* canvas); |
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
433 | 428 |
434 // Used to bind callback functions to this object. | 429 // Used to bind callback functions to this object. |
435 base::WeakPtrFactory<Textfield> weak_ptr_factory_; | 430 base::WeakPtrFactory<Textfield> weak_ptr_factory_; |
436 | 431 |
437 DISALLOW_COPY_AND_ASSIGN(Textfield); | 432 DISALLOW_COPY_AND_ASSIGN(Textfield); |
438 }; | 433 }; |
439 | 434 |
440 } // namespace views | 435 } // namespace views |
441 | 436 |
442 #endif // UI_VIEWS_CONTROLS_TEXTFIELD_TEXTFIELD_H_ | 437 #endif // UI_VIEWS_CONTROLS_TEXTFIELD_TEXTFIELD_H_ |
OLD | NEW |