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 CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_ANDROID_H_ | 5 #ifndef CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_ANDROID_H_ |
6 #define CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_ANDROID_H_ | 6 #define CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_ANDROID_H_ |
7 | 7 |
8 #include <stddef.h> | 8 #include <stddef.h> |
9 #include <stdint.h> | 9 #include <stdint.h> |
10 | 10 |
11 #include <map> | 11 #include <map> |
12 #include <memory> | 12 #include <memory> |
13 #include <queue> | 13 #include <queue> |
14 | 14 |
15 #include "base/callback.h" | 15 #include "base/callback.h" |
16 #include "base/compiler_specific.h" | 16 #include "base/compiler_specific.h" |
17 #include "base/i18n/rtl.h" | 17 #include "base/i18n/rtl.h" |
18 #include "base/macros.h" | 18 #include "base/macros.h" |
19 #include "base/memory/weak_ptr.h" | 19 #include "base/memory/weak_ptr.h" |
20 #include "base/process/process.h" | 20 #include "base/process/process.h" |
21 #include "cc/input/selection.h" | 21 #include "cc/input/selection.h" |
22 #include "cc/output/begin_frame_args.h" | 22 #include "cc/output/begin_frame_args.h" |
23 #include "cc/scheduler/begin_frame_source.h" | 23 #include "cc/scheduler/begin_frame_source.h" |
24 #include "content/browser/accessibility/browser_accessibility_manager.h" | 24 #include "content/browser/accessibility/browser_accessibility_manager.h" |
25 #include "content/browser/android/content_view_core_impl_observer.h" | 25 #include "content/browser/android/content_view_core_impl_observer.h" |
26 #include "content/browser/renderer_host/delegated_frame_evictor.h" | 26 #include "content/browser/renderer_host/delegated_frame_evictor.h" |
| 27 #include "content/browser/renderer_host/ime_adapter_android.h" |
27 #include "content/browser/renderer_host/input/stylus_text_selector.h" | 28 #include "content/browser/renderer_host/input/stylus_text_selector.h" |
28 #include "content/browser/renderer_host/render_widget_host_view_base.h" | 29 #include "content/browser/renderer_host/render_widget_host_view_base.h" |
29 #include "content/browser/renderer_host/text_input_manager.h" | 30 #include "content/browser/renderer_host/text_input_manager.h" |
30 #include "content/common/content_export.h" | 31 #include "content/common/content_export.h" |
31 #include "content/public/browser/readback_types.h" | 32 #include "content/public/browser/readback_types.h" |
32 #include "gpu/command_buffer/common/mailbox.h" | 33 #include "gpu/command_buffer/common/mailbox.h" |
33 #include "third_party/skia/include/core/SkColor.h" | 34 #include "third_party/skia/include/core/SkColor.h" |
34 #include "ui/android/delegated_frame_host_android.h" | 35 #include "ui/android/delegated_frame_host_android.h" |
35 #include "ui/android/view_android.h" | 36 #include "ui/android/view_android.h" |
36 #include "ui/android/view_client.h" | 37 #include "ui/android/view_client.h" |
37 #include "ui/android/window_android_observer.h" | 38 #include "ui/android/window_android_observer.h" |
38 #include "ui/events/gesture_detection/filtered_gesture_provider.h" | 39 #include "ui/events/gesture_detection/filtered_gesture_provider.h" |
39 #include "ui/gfx/geometry/size.h" | 40 #include "ui/gfx/geometry/size.h" |
40 #include "ui/gfx/geometry/vector2d_f.h" | 41 #include "ui/gfx/geometry/vector2d_f.h" |
41 #include "ui/gfx/selection_bound.h" | 42 #include "ui/gfx/selection_bound.h" |
42 #include "ui/touch_selection/touch_selection_controller.h" | 43 #include "ui/touch_selection/touch_selection_controller.h" |
43 | 44 |
44 class GURL; | 45 class GURL; |
45 | 46 |
46 namespace ui { | 47 namespace ui { |
47 class MotionEventAndroid; | 48 class MotionEventAndroid; |
48 struct DidOverscrollParams; | 49 struct DidOverscrollParams; |
49 } | 50 } |
50 | 51 |
51 namespace content { | 52 namespace content { |
52 class ContentViewCoreImpl; | 53 class ContentViewCoreImpl; |
53 class ImeAdapterAndroid; | |
54 class OverscrollControllerAndroid; | 54 class OverscrollControllerAndroid; |
55 class RenderWidgetHost; | 55 class RenderWidgetHost; |
56 class RenderWidgetHostImpl; | 56 class RenderWidgetHostImpl; |
57 class SynchronousCompositorHost; | 57 class SynchronousCompositorHost; |
58 class SynchronousCompositorClient; | 58 class SynchronousCompositorClient; |
59 struct NativeWebKeyboardEvent; | 59 struct NativeWebKeyboardEvent; |
60 | 60 |
61 // ----------------------------------------------------------------------------- | 61 // ----------------------------------------------------------------------------- |
62 // See comments in render_widget_host_view.h about this class and its members. | 62 // See comments in render_widget_host_view.h about this class and its members. |
63 // ----------------------------------------------------------------------------- | 63 // ----------------------------------------------------------------------------- |
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
217 const cc::BeginFrameArgs& LastUsedBeginFrameArgs() const override; | 217 const cc::BeginFrameArgs& LastUsedBeginFrameArgs() const override; |
218 void OnBeginFrameSourcePausedChanged(bool paused) override; | 218 void OnBeginFrameSourcePausedChanged(bool paused) override; |
219 | 219 |
220 // Non-virtual methods | 220 // Non-virtual methods |
221 void SetContentViewCore(ContentViewCoreImpl* content_view_core); | 221 void SetContentViewCore(ContentViewCoreImpl* content_view_core); |
222 SkColor GetCachedBackgroundColor() const; | 222 SkColor GetCachedBackgroundColor() const; |
223 void SendKeyEvent(const NativeWebKeyboardEvent& event); | 223 void SendKeyEvent(const NativeWebKeyboardEvent& event); |
224 void SendMouseEvent(const ui::MotionEventAndroid&, int action_button); | 224 void SendMouseEvent(const ui::MotionEventAndroid&, int action_button); |
225 void SendMouseWheelEvent(const blink::WebMouseWheelEvent& event); | 225 void SendMouseWheelEvent(const blink::WebMouseWheelEvent& event); |
226 void SendGestureEvent(const blink::WebGestureEvent& event); | 226 void SendGestureEvent(const blink::WebGestureEvent& event); |
227 void set_ime_adapter(ImeAdapterAndroid* ime_adapter) { | |
228 ime_adapter_android_ = ime_adapter; | |
229 } | |
230 | 227 |
231 void OnStartContentIntent(const GURL& content_url, bool is_main_frame); | 228 void OnStartContentIntent(const GURL& content_url, bool is_main_frame); |
232 | 229 |
233 bool OnTouchEvent(const ui::MotionEvent& event); | 230 bool OnTouchEvent(const ui::MotionEvent& event); |
234 bool OnTouchHandleEvent(const ui::MotionEvent& event); | 231 bool OnTouchHandleEvent(const ui::MotionEvent& event); |
235 void ResetGestureDetection(); | 232 void ResetGestureDetection(); |
236 void SetDoubleTapSupportEnabled(bool enabled); | 233 void SetDoubleTapSupportEnabled(bool enabled); |
237 void SetMultiTouchZoomSupportEnabled(bool enabled); | 234 void SetMultiTouchZoomSupportEnabled(bool enabled); |
238 | 235 |
| 236 long GetNativeImeAdapter(); |
| 237 |
239 void WasResized(); | 238 void WasResized(); |
240 | 239 |
241 bool HasValidFrame() const; | 240 bool HasValidFrame() const; |
242 | 241 |
243 void MoveCaret(const gfx::Point& point); | 242 void MoveCaret(const gfx::Point& point); |
244 void ShowContextMenuAtPoint(const gfx::Point& point); | 243 void ShowContextMenuAtPoint(const gfx::Point& point); |
245 void DismissTextHandles(); | 244 void DismissTextHandles(); |
246 void SetTextHandlesTemporarilyHidden(bool hidden); | 245 void SetTextHandlesTemporarilyHidden(bool hidden); |
247 void OnShowUnhandledTapUIIfNeeded(int x_dip, int y_dip); | 246 void OnShowUnhandledTapUIIfNeeded(int x_dip, int y_dip); |
248 | 247 |
(...skipping 14 matching lines...) Expand all Loading... |
263 RenderWidgetHostViewBase* updated_view, | 262 RenderWidgetHostViewBase* updated_view, |
264 bool did_change_state) override; | 263 bool did_change_state) override; |
265 void OnImeCompositionRangeChanged( | 264 void OnImeCompositionRangeChanged( |
266 TextInputManager* text_input_manager, | 265 TextInputManager* text_input_manager, |
267 RenderWidgetHostViewBase* updated_view) override; | 266 RenderWidgetHostViewBase* updated_view) override; |
268 void OnImeCancelComposition(TextInputManager* text_input_manager, | 267 void OnImeCancelComposition(TextInputManager* text_input_manager, |
269 RenderWidgetHostViewBase* updated_view) override; | 268 RenderWidgetHostViewBase* updated_view) override; |
270 void OnTextSelectionChanged(TextInputManager* text_input_manager, | 269 void OnTextSelectionChanged(TextInputManager* text_input_manager, |
271 RenderWidgetHostViewBase* updated_view) override; | 270 RenderWidgetHostViewBase* updated_view) override; |
272 | 271 |
273 ImeAdapterAndroid* ime_adapter_for_testing() { return ime_adapter_android_; } | 272 ImeAdapterAndroid* ime_adapter_for_testing() { return &ime_adapter_android_; } |
274 | 273 |
275 // Exposed for tests. | 274 // Exposed for tests. |
276 cc::SurfaceId SurfaceIdForTesting() const override; | 275 cc::SurfaceId SurfaceIdForTesting() const override; |
277 | 276 |
278 private: | 277 private: |
279 void RunAckCallbacks(); | 278 void RunAckCallbacks(); |
280 | 279 |
281 void SendReclaimCompositorResources(bool is_swap_ack); | 280 void SendReclaimCompositorResources(bool is_swap_ack); |
282 | 281 |
283 void OnFrameMetadataUpdated(const cc::CompositorFrameMetadata& frame_metadata, | 282 void OnFrameMetadataUpdated(const cc::CompositorFrameMetadata& frame_metadata, |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
338 bool is_window_visible_; | 337 bool is_window_visible_; |
339 bool is_window_activity_started_; | 338 bool is_window_activity_started_; |
340 | 339 |
341 // Used to customize behavior for virtual reality mode, such as the | 340 // Used to customize behavior for virtual reality mode, such as the |
342 // appearance of overscroll glow and the keyboard. | 341 // appearance of overscroll glow and the keyboard. |
343 bool is_in_vr_; | 342 bool is_in_vr_; |
344 | 343 |
345 // ContentViewCoreImpl is our interface to the view system. | 344 // ContentViewCoreImpl is our interface to the view system. |
346 ContentViewCoreImpl* content_view_core_; | 345 ContentViewCoreImpl* content_view_core_; |
347 | 346 |
348 ImeAdapterAndroid* ime_adapter_android_; | 347 ImeAdapterAndroid ime_adapter_android_; |
349 | 348 |
350 // Body background color of the underlying document. | 349 // Body background color of the underlying document. |
351 SkColor cached_background_color_; | 350 SkColor cached_background_color_; |
352 | 351 |
353 mutable ui::ViewAndroid view_; | 352 mutable ui::ViewAndroid view_; |
354 | 353 |
355 // Manages the Compositor Frames received from the renderer. | 354 // Manages the Compositor Frames received from the renderer. |
356 std::unique_ptr<ui::DelegatedFrameHostAndroid> delegated_frame_host_; | 355 std::unique_ptr<ui::DelegatedFrameHostAndroid> delegated_frame_host_; |
357 | 356 |
358 cc::ReturnedResourceArray surface_returned_resources_; | 357 cc::ReturnedResourceArray surface_returned_resources_; |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
395 float prev_bottom_shown_pix_; | 394 float prev_bottom_shown_pix_; |
396 | 395 |
397 base::WeakPtrFactory<RenderWidgetHostViewAndroid> weak_ptr_factory_; | 396 base::WeakPtrFactory<RenderWidgetHostViewAndroid> weak_ptr_factory_; |
398 | 397 |
399 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostViewAndroid); | 398 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostViewAndroid); |
400 }; | 399 }; |
401 | 400 |
402 } // namespace content | 401 } // namespace content |
403 | 402 |
404 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_ANDROID_H_ | 403 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_ANDROID_H_ |
OLD | NEW |