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" |
11 #include "base/compiler_specific.h" | 11 #include "base/compiler_specific.h" |
12 #include "base/memory/scoped_ptr.h" | 12 #include "base/memory/scoped_ptr.h" |
13 #include "base/memory/weak_ptr.h" | 13 #include "base/memory/weak_ptr.h" |
14 #include "base/strings/string16.h" | 14 #include "base/strings/string16.h" |
15 #include "base/timer/timer.h" | 15 #include "base/timer/timer.h" |
16 #include "testing/gtest/include/gtest/gtest_prod.h" | |
16 #include "third_party/skia/include/core/SkColor.h" | 17 #include "third_party/skia/include/core/SkColor.h" |
17 #include "ui/base/ime/text_input_client.h" | 18 #include "ui/base/ime/text_input_client.h" |
18 #include "ui/base/ime/text_input_type.h" | 19 #include "ui/base/ime/text_input_type.h" |
19 #include "ui/base/models/simple_menu_model.h" | 20 #include "ui/base/models/simple_menu_model.h" |
20 #include "ui/base/touch/touch_editing_controller.h" | 21 #include "ui/base/touch/touch_editing_controller.h" |
21 #include "ui/events/keycodes/keyboard_codes.h" | 22 #include "ui/events/keycodes/keyboard_codes.h" |
22 #include "ui/gfx/font_list.h" | 23 #include "ui/gfx/font_list.h" |
23 #include "ui/gfx/range/range.h" | 24 #include "ui/gfx/range/range.h" |
24 #include "ui/gfx/selection_model.h" | 25 #include "ui/gfx/selection_model.h" |
25 #include "ui/gfx/text_constants.h" | 26 #include "ui/gfx/text_constants.h" |
26 #include "ui/views/context_menu_controller.h" | 27 #include "ui/views/context_menu_controller.h" |
27 #include "ui/views/controls/textfield/textfield_model.h" | 28 #include "ui/views/controls/textfield/textfield_model.h" |
28 #include "ui/views/drag_controller.h" | 29 #include "ui/views/drag_controller.h" |
29 #include "ui/views/view.h" | 30 #include "ui/views/view.h" |
30 | 31 |
32 class OmniboxViewViewsTest; | |
33 | |
31 namespace views { | 34 namespace views { |
32 | 35 |
33 namespace test { | 36 namespace test { |
34 class WidgetTestInteractive; | 37 class WidgetTestInteractive; |
35 } | 38 } |
36 | 39 |
37 class MenuRunner; | 40 class MenuRunner; |
38 class Painter; | 41 class Painter; |
39 class TextfieldController; | 42 class TextfieldController; |
40 | 43 |
(...skipping 252 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
293 | 296 |
294 gfx::Point last_click_location() const { return last_click_location_; } | 297 gfx::Point last_click_location() const { return last_click_location_; } |
295 | 298 |
296 // Get the text from the selection clipboard. | 299 // Get the text from the selection clipboard. |
297 virtual base::string16 GetSelectionClipboardText() const; | 300 virtual base::string16 GetSelectionClipboardText() const; |
298 | 301 |
299 private: | 302 private: |
300 friend class TextfieldTest; | 303 friend class TextfieldTest; |
301 friend class TouchSelectionControllerImplTest; | 304 friend class TouchSelectionControllerImplTest; |
302 friend class test::WidgetTestInteractive; | 305 friend class test::WidgetTestInteractive; |
306 friend class ::OmniboxViewViewsTest; | |
sky
2014/05/20 20:58:14
Ick. How about exposing a class, only compiled in
mohsen
2014/05/21 14:47:49
Done.
| |
303 | 307 |
304 // Handles a request to change the value of this text field from software | 308 // Handles a request to change the value of this text field from software |
305 // using an accessibility API (typically automation software, screen readers | 309 // using an accessibility API (typically automation software, screen readers |
306 // don't normally use this). Sets the value and clears the selection. | 310 // don't normally use this). Sets the value and clears the selection. |
307 void AccessibilitySetValue(const base::string16& new_value); | 311 void AccessibilitySetValue(const base::string16& new_value); |
308 | 312 |
309 // Updates the painted background color. | 313 // Updates the painted background color. |
310 void UpdateBackgroundColor(); | 314 void UpdateBackgroundColor(); |
311 | 315 |
312 // Does necessary updates when the text and/or cursor position changes. | 316 // 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 | 443 |
440 // Used to bind callback functions to this object. | 444 // Used to bind callback functions to this object. |
441 base::WeakPtrFactory<Textfield> weak_ptr_factory_; | 445 base::WeakPtrFactory<Textfield> weak_ptr_factory_; |
442 | 446 |
443 DISALLOW_COPY_AND_ASSIGN(Textfield); | 447 DISALLOW_COPY_AND_ASSIGN(Textfield); |
444 }; | 448 }; |
445 | 449 |
446 } // namespace views | 450 } // namespace views |
447 | 451 |
448 #endif // UI_VIEWS_CONTROLS_TEXTFIELD_TEXTFIELD_H_ | 452 #endif // UI_VIEWS_CONTROLS_TEXTFIELD_TEXTFIELD_H_ |
OLD | NEW |