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