| 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 12 matching lines...) Expand all Loading... |
| 23 #include "ui/gfx/range/range.h" | 23 #include "ui/gfx/range/range.h" |
| 24 #include "ui/gfx/selection_model.h" | 24 #include "ui/gfx/selection_model.h" |
| 25 #include "ui/gfx/text_constants.h" | 25 #include "ui/gfx/text_constants.h" |
| 26 #include "ui/views/context_menu_controller.h" | 26 #include "ui/views/context_menu_controller.h" |
| 27 #include "ui/views/controls/textfield/textfield_model.h" | 27 #include "ui/views/controls/textfield/textfield_model.h" |
| 28 #include "ui/views/drag_controller.h" | 28 #include "ui/views/drag_controller.h" |
| 29 #include "ui/views/view.h" | 29 #include "ui/views/view.h" |
| 30 | 30 |
| 31 namespace views { | 31 namespace views { |
| 32 | 32 |
| 33 namespace test { | |
| 34 class WidgetTestInteractive; | |
| 35 } | |
| 36 | |
| 37 class MenuRunner; | 33 class MenuRunner; |
| 38 class Painter; | 34 class Painter; |
| 39 class TextfieldController; | 35 class TextfieldController; |
| 40 | 36 |
| 41 // A views/skia textfield implementation. No platform-specific code is used. | 37 // A views/skia textfield implementation. No platform-specific code is used. |
| 42 class VIEWS_EXPORT Textfield : public View, | 38 class VIEWS_EXPORT Textfield : public View, |
| 43 public TextfieldModel::Delegate, | 39 public TextfieldModel::Delegate, |
| 44 public ContextMenuController, | 40 public ContextMenuController, |
| 45 public DragController, | 41 public DragController, |
| 46 public ui::TouchEditable, | 42 public ui::TouchEditable, |
| (...skipping 243 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 290 protected: | 286 protected: |
| 291 // Returns the TextfieldModel's text/cursor/selection rendering model. | 287 // Returns the TextfieldModel's text/cursor/selection rendering model. |
| 292 gfx::RenderText* GetRenderText() const; | 288 gfx::RenderText* GetRenderText() const; |
| 293 | 289 |
| 294 gfx::Point last_click_location() const { return last_click_location_; } | 290 gfx::Point last_click_location() const { return last_click_location_; } |
| 295 | 291 |
| 296 // Get the text from the selection clipboard. | 292 // Get the text from the selection clipboard. |
| 297 virtual base::string16 GetSelectionClipboardText() const; | 293 virtual base::string16 GetSelectionClipboardText() const; |
| 298 | 294 |
| 299 private: | 295 private: |
| 300 friend class TextfieldTest; | 296 friend class TextfieldTestApi; |
| 301 friend class TouchSelectionControllerImplTest; | |
| 302 friend class test::WidgetTestInteractive; | |
| 303 | 297 |
| 304 // Handles a request to change the value of this text field from software | 298 // Handles a request to change the value of this text field from software |
| 305 // using an accessibility API (typically automation software, screen readers | 299 // using an accessibility API (typically automation software, screen readers |
| 306 // don't normally use this). Sets the value and clears the selection. | 300 // don't normally use this). Sets the value and clears the selection. |
| 307 void AccessibilitySetValue(const base::string16& new_value); | 301 void AccessibilitySetValue(const base::string16& new_value); |
| 308 | 302 |
| 309 // Updates the painted background color. | 303 // Updates the painted background color. |
| 310 void UpdateBackgroundColor(); | 304 void UpdateBackgroundColor(); |
| 311 | 305 |
| 312 // Does necessary updates when the text and/or cursor position changes. | 306 // Does necessary updates when the text and/or cursor position changes. |
| (...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 439 | 433 |
| 440 // Used to bind callback functions to this object. | 434 // Used to bind callback functions to this object. |
| 441 base::WeakPtrFactory<Textfield> weak_ptr_factory_; | 435 base::WeakPtrFactory<Textfield> weak_ptr_factory_; |
| 442 | 436 |
| 443 DISALLOW_COPY_AND_ASSIGN(Textfield); | 437 DISALLOW_COPY_AND_ASSIGN(Textfield); |
| 444 }; | 438 }; |
| 445 | 439 |
| 446 } // namespace views | 440 } // namespace views |
| 447 | 441 |
| 448 #endif // UI_VIEWS_CONTROLS_TEXTFIELD_TEXTFIELD_H_ | 442 #endif // UI_VIEWS_CONTROLS_TEXTFIELD_TEXTFIELD_H_ |
| OLD | NEW |