OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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 CONTENT_BROWSER_WEB_CONTENTS_TOUCH_EDITABLE_IMPL_AURA_H_ | 5 #ifndef CONTENT_BROWSER_WEB_CONTENTS_TOUCH_EDITABLE_IMPL_AURA_H_ |
6 #define CONTENT_BROWSER_WEB_CONTENTS_TOUCH_EDITABLE_IMPL_AURA_H_ | 6 #define CONTENT_BROWSER_WEB_CONTENTS_TOUCH_EDITABLE_IMPL_AURA_H_ |
7 | 7 |
8 #include <deque> | 8 #include <deque> |
9 #include <map> | 9 #include <map> |
10 #include <queue> | 10 #include <queue> |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
43 | 43 |
44 // Overridden from RenderWidgetHostViewAura::TouchEditingClient. | 44 // Overridden from RenderWidgetHostViewAura::TouchEditingClient. |
45 virtual void StartTouchEditing() OVERRIDE; | 45 virtual void StartTouchEditing() OVERRIDE; |
46 virtual void EndTouchEditing(bool quick) OVERRIDE; | 46 virtual void EndTouchEditing(bool quick) OVERRIDE; |
47 virtual void OnSelectionOrCursorChanged(const gfx::Rect& anchor, | 47 virtual void OnSelectionOrCursorChanged(const gfx::Rect& anchor, |
48 const gfx::Rect& focus) OVERRIDE; | 48 const gfx::Rect& focus) OVERRIDE; |
49 virtual void OnTextInputTypeChanged(ui::TextInputType type) OVERRIDE; | 49 virtual void OnTextInputTypeChanged(ui::TextInputType type) OVERRIDE; |
50 virtual bool HandleInputEvent(const ui::Event* event) OVERRIDE; | 50 virtual bool HandleInputEvent(const ui::Event* event) OVERRIDE; |
51 virtual void GestureEventAck(int gesture_event_type) OVERRIDE; | 51 virtual void GestureEventAck(int gesture_event_type) OVERRIDE; |
52 virtual void OnViewDestroyed() OVERRIDE; | 52 virtual void OnViewDestroyed() OVERRIDE; |
| 53 virtual void SetContextMenuRenderFrameID(int render_process_id, |
| 54 int render_frame_id) OVERRIDE; |
53 | 55 |
54 // Overridden from ui::TouchEditable: | 56 // Overridden from ui::TouchEditable: |
55 virtual void SelectRect(const gfx::Point& start, | 57 virtual void SelectRect(const gfx::Point& start, |
56 const gfx::Point& end) OVERRIDE; | 58 const gfx::Point& end) OVERRIDE; |
57 virtual void MoveCaretTo(const gfx::Point& point) OVERRIDE; | 59 virtual void MoveCaretTo(const gfx::Point& point) OVERRIDE; |
58 virtual void GetSelectionEndPoints(gfx::Rect* p1, gfx::Rect* p2) OVERRIDE; | 60 virtual void GetSelectionEndPoints(gfx::Rect* p1, gfx::Rect* p2) OVERRIDE; |
59 virtual gfx::Rect GetBounds() OVERRIDE; | 61 virtual gfx::Rect GetBounds() OVERRIDE; |
60 virtual gfx::NativeView GetNativeView() const OVERRIDE; | 62 virtual gfx::NativeView GetNativeView() const OVERRIDE; |
61 virtual void ConvertPointToScreen(gfx::Point* point) OVERRIDE; | 63 virtual void ConvertPointToScreen(gfx::Point* point) OVERRIDE; |
62 virtual void ConvertPointFromScreen(gfx::Point* point) OVERRIDE; | 64 virtual void ConvertPointFromScreen(gfx::Point* point) OVERRIDE; |
(...skipping 17 matching lines...) Expand all Loading... |
80 // Rectangles for the selection anchor and focus. | 82 // Rectangles for the selection anchor and focus. |
81 gfx::Rect selection_anchor_rect_; | 83 gfx::Rect selection_anchor_rect_; |
82 gfx::Rect selection_focus_rect_; | 84 gfx::Rect selection_focus_rect_; |
83 | 85 |
84 // The current text input type. | 86 // The current text input type. |
85 ui::TextInputType text_input_type_; | 87 ui::TextInputType text_input_type_; |
86 | 88 |
87 RenderWidgetHostViewAura* rwhva_; | 89 RenderWidgetHostViewAura* rwhva_; |
88 scoped_ptr<ui::TouchSelectionController> touch_selection_controller_; | 90 scoped_ptr<ui::TouchSelectionController> touch_selection_controller_; |
89 | 91 |
| 92 // The IDs of the RenderFrameHost where the context menu is over. |
| 93 int menu_render_process_id_; |
| 94 int menu_render_frame_id_; |
| 95 |
90 // True if |rwhva_| is currently handling a gesture that could result in a | 96 // True if |rwhva_| is currently handling a gesture that could result in a |
91 // change in selection (long press, double tap or triple tap). | 97 // change in selection (long press, double tap or triple tap). |
92 bool selection_gesture_in_process_; | 98 bool selection_gesture_in_process_; |
93 | 99 |
94 // Set to true if handles are hidden when user is scrolling. Used to determine | 100 // Set to true if handles are hidden when user is scrolling. Used to determine |
95 // whether to re-show handles after a scrolling session. | 101 // whether to re-show handles after a scrolling session. |
96 bool handles_hidden_due_to_scroll_; | 102 bool handles_hidden_due_to_scroll_; |
97 | 103 |
98 // Keeps track of when the user is scrolling. | 104 // Keeps track of when the user is scrolling. |
99 bool scroll_in_progress_; | 105 bool scroll_in_progress_; |
100 | 106 |
101 // Set to true when the page starts an overscroll. | 107 // Set to true when the page starts an overscroll. |
102 bool overscroll_in_progress_; | 108 bool overscroll_in_progress_; |
103 | 109 |
104 // Used to track if the current tap gesture is on a focused textfield. | 110 // Used to track if the current tap gesture is on a focused textfield. |
105 bool is_tap_on_focused_textfield_; | 111 bool is_tap_on_focused_textfield_; |
106 | 112 |
107 // When we receive ack for a ET_GESTURE_TAP, we do not know if the ack is for | 113 // When we receive ack for a ET_GESTURE_TAP, we do not know if the ack is for |
108 // a tap or a double tap (we only get the event type in the ack). So we have | 114 // a tap or a double tap (we only get the event type in the ack). So we have |
109 // this queue to keep track of the the tap count so that we can distinguish | 115 // this queue to keep track of the the tap count so that we can distinguish |
110 // between double and single tap when we get the ack. | 116 // between double and single tap when we get the ack. |
111 std::queue<int> tap_gesture_tap_count_queue_; | 117 std::queue<int> tap_gesture_tap_count_queue_; |
112 | 118 |
113 DISALLOW_COPY_AND_ASSIGN(TouchEditableImplAura); | 119 DISALLOW_COPY_AND_ASSIGN(TouchEditableImplAura); |
114 }; | 120 }; |
115 | 121 |
116 } // namespace content | 122 } // namespace content |
117 | 123 |
118 #endif // CONTENT_BROWSER_WEB_CONTENTS_TOUCH_EDITABLE_IMPL_AURA_H_ | 124 #endif // CONTENT_BROWSER_WEB_CONTENTS_TOUCH_EDITABLE_IMPL_AURA_H_ |
OLD | NEW |