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 <stddef.h> | 8 #include <stddef.h> |
9 #include <stdint.h> | 9 #include <stdint.h> |
10 | 10 |
(...skipping 10 matching lines...) Expand all Loading... | |
21 #include "ui/base/ime/text_input_type.h" | 21 #include "ui/base/ime/text_input_type.h" |
22 #include "ui/base/models/simple_menu_model.h" | 22 #include "ui/base/models/simple_menu_model.h" |
23 #include "ui/base/touch/touch_editing_controller.h" | 23 #include "ui/base/touch/touch_editing_controller.h" |
24 #include "ui/events/keycodes/keyboard_codes.h" | 24 #include "ui/events/keycodes/keyboard_codes.h" |
25 #include "ui/gfx/font_list.h" | 25 #include "ui/gfx/font_list.h" |
26 #include "ui/gfx/range/range.h" | 26 #include "ui/gfx/range/range.h" |
27 #include "ui/gfx/selection_model.h" | 27 #include "ui/gfx/selection_model.h" |
28 #include "ui/gfx/text_constants.h" | 28 #include "ui/gfx/text_constants.h" |
29 #include "ui/views/context_menu_controller.h" | 29 #include "ui/views/context_menu_controller.h" |
30 #include "ui/views/controls/textfield/textfield_model.h" | 30 #include "ui/views/controls/textfield/textfield_model.h" |
31 #include "ui/views/controls/views_text_services_context_menu.h" | |
tapted
2016/12/13 05:11:24
nit: forward declare?
spqchan
2016/12/15 23:29:01
Done.
| |
31 #include "ui/views/drag_controller.h" | 32 #include "ui/views/drag_controller.h" |
32 #include "ui/views/selection_controller.h" | 33 #include "ui/views/selection_controller.h" |
33 #include "ui/views/selection_controller_delegate.h" | 34 #include "ui/views/selection_controller_delegate.h" |
34 #include "ui/views/view.h" | 35 #include "ui/views/view.h" |
35 #include "ui/views/word_lookup_client.h" | 36 #include "ui/views/word_lookup_client.h" |
36 | 37 |
37 namespace views { | 38 namespace views { |
38 | 39 |
39 class MenuRunner; | 40 class MenuRunner; |
40 class TextfieldController; | 41 class TextfieldController; |
(...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
263 ui::OSExchangeData* data) override; | 264 ui::OSExchangeData* data) override; |
264 int GetDragOperationsForView(View* sender, const gfx::Point& p) override; | 265 int GetDragOperationsForView(View* sender, const gfx::Point& p) override; |
265 bool CanStartDragForView(View* sender, | 266 bool CanStartDragForView(View* sender, |
266 const gfx::Point& press_pt, | 267 const gfx::Point& press_pt, |
267 const gfx::Point& p) override; | 268 const gfx::Point& p) override; |
268 | 269 |
269 // WordLookupClient overrides: | 270 // WordLookupClient overrides: |
270 bool GetDecoratedWordAtPoint(const gfx::Point& point, | 271 bool GetDecoratedWordAtPoint(const gfx::Point& point, |
271 gfx::DecoratedText* decorated_word, | 272 gfx::DecoratedText* decorated_word, |
272 gfx::Point* baseline_point) override; | 273 gfx::Point* baseline_point) override; |
274 bool GetDecoratedTextFromSelection(gfx::DecoratedText* decorated_text, | |
275 gfx::Point* baseline_point) override; | |
273 | 276 |
274 // SelectionControllerDelegate overrides: | 277 // SelectionControllerDelegate overrides: |
275 bool HasTextBeingDragged() const override; | 278 bool HasTextBeingDragged() const override; |
276 | 279 |
277 // ui::TouchEditable overrides: | 280 // ui::TouchEditable overrides: |
278 void SelectRect(const gfx::Point& start, const gfx::Point& end) override; | 281 void SelectRect(const gfx::Point& start, const gfx::Point& end) override; |
279 void MoveCaretTo(const gfx::Point& point) override; | 282 void MoveCaretTo(const gfx::Point& point) override; |
280 void GetSelectionEndPoints(gfx::SelectionBound* anchor, | 283 void GetSelectionEndPoints(gfx::SelectionBound* anchor, |
281 gfx::SelectionBound* focus) override; | 284 gfx::SelectionBound* focus) override; |
282 gfx::Rect GetBounds() override; | 285 gfx::Rect GetBounds() override; |
(...skipping 235 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
518 | 521 |
519 // Tracks if touch editing handles are hidden because user has started | 522 // Tracks if touch editing handles are hidden because user has started |
520 // scrolling. If |true|, handles are shown after scrolling ends. | 523 // scrolling. If |true|, handles are shown after scrolling ends. |
521 bool touch_handles_hidden_due_to_scroll_; | 524 bool touch_handles_hidden_due_to_scroll_; |
522 | 525 |
523 // True if this textfield should use a focus ring to indicate focus. | 526 // True if this textfield should use a focus ring to indicate focus. |
524 bool use_focus_ring_; | 527 bool use_focus_ring_; |
525 | 528 |
526 // Context menu related members. | 529 // Context menu related members. |
527 std::unique_ptr<ui::SimpleMenuModel> context_menu_contents_; | 530 std::unique_ptr<ui::SimpleMenuModel> context_menu_contents_; |
531 std::unique_ptr<ViewsTextServicesContextMenu> text_services_context_menu_; | |
528 std::unique_ptr<views::MenuRunner> context_menu_runner_; | 532 std::unique_ptr<views::MenuRunner> context_menu_runner_; |
529 | 533 |
530 // Used to bind callback functions to this object. | 534 // Used to bind callback functions to this object. |
531 base::WeakPtrFactory<Textfield> weak_ptr_factory_; | 535 base::WeakPtrFactory<Textfield> weak_ptr_factory_; |
532 | 536 |
533 DISALLOW_COPY_AND_ASSIGN(Textfield); | 537 DISALLOW_COPY_AND_ASSIGN(Textfield); |
534 }; | 538 }; |
535 | 539 |
536 } // namespace views | 540 } // namespace views |
537 | 541 |
538 #endif // UI_VIEWS_CONTROLS_TEXTFIELD_TEXTFIELD_H_ | 542 #endif // UI_VIEWS_CONTROLS_TEXTFIELD_TEXTFIELD_H_ |
OLD | NEW |