| 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" | |
| 28 #include "content/browser/renderer_host/input/stylus_text_selector.h" | 27 #include "content/browser/renderer_host/input/stylus_text_selector.h" |
| 29 #include "content/browser/renderer_host/render_widget_host_view_base.h" | 28 #include "content/browser/renderer_host/render_widget_host_view_base.h" |
| 30 #include "content/browser/renderer_host/text_input_manager.h" | 29 #include "content/browser/renderer_host/text_input_manager.h" |
| 31 #include "content/common/content_export.h" | 30 #include "content/common/content_export.h" |
| 32 #include "content/public/browser/readback_types.h" | 31 #include "content/public/browser/readback_types.h" |
| 33 #include "gpu/command_buffer/common/mailbox.h" | 32 #include "gpu/command_buffer/common/mailbox.h" |
| 34 #include "third_party/skia/include/core/SkColor.h" | 33 #include "third_party/skia/include/core/SkColor.h" |
| 35 #include "ui/android/delegated_frame_host_android.h" | 34 #include "ui/android/delegated_frame_host_android.h" |
| 36 #include "ui/android/view_android.h" | 35 #include "ui/android/view_android.h" |
| 37 #include "ui/android/view_client.h" | 36 #include "ui/android/view_client.h" |
| 38 #include "ui/android/window_android_observer.h" | 37 #include "ui/android/window_android_observer.h" |
| 39 #include "ui/events/gesture_detection/filtered_gesture_provider.h" | 38 #include "ui/events/gesture_detection/filtered_gesture_provider.h" |
| 40 #include "ui/gfx/geometry/size.h" | 39 #include "ui/gfx/geometry/size.h" |
| 41 #include "ui/gfx/geometry/vector2d_f.h" | 40 #include "ui/gfx/geometry/vector2d_f.h" |
| 42 #include "ui/gfx/selection_bound.h" | 41 #include "ui/gfx/selection_bound.h" |
| 43 #include "ui/touch_selection/touch_selection_controller.h" | 42 #include "ui/touch_selection/touch_selection_controller.h" |
| 44 | 43 |
| 45 class GURL; | 44 class GURL; |
| 46 | 45 |
| 47 namespace ui { | 46 namespace ui { |
| 48 class MotionEventAndroid; | 47 class MotionEventAndroid; |
| 49 struct DidOverscrollParams; | 48 struct DidOverscrollParams; |
| 50 } | 49 } |
| 51 | 50 |
| 52 namespace content { | 51 namespace content { |
| 53 class ContentViewCoreImpl; | 52 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 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 215 const cc::BeginFrameArgs& LastUsedBeginFrameArgs() const override; | 215 const cc::BeginFrameArgs& LastUsedBeginFrameArgs() const override; |
| 216 void OnBeginFrameSourcePausedChanged(bool paused) override; | 216 void OnBeginFrameSourcePausedChanged(bool paused) override; |
| 217 | 217 |
| 218 // Non-virtual methods | 218 // Non-virtual methods |
| 219 void SetContentViewCore(ContentViewCoreImpl* content_view_core); | 219 void SetContentViewCore(ContentViewCoreImpl* content_view_core); |
| 220 SkColor GetCachedBackgroundColor() const; | 220 SkColor GetCachedBackgroundColor() const; |
| 221 void SendKeyEvent(const NativeWebKeyboardEvent& event); | 221 void SendKeyEvent(const NativeWebKeyboardEvent& event); |
| 222 void SendMouseEvent(const ui::MotionEventAndroid&, int action_button); | 222 void SendMouseEvent(const ui::MotionEventAndroid&, int action_button); |
| 223 void SendMouseWheelEvent(const blink::WebMouseWheelEvent& event); | 223 void SendMouseWheelEvent(const blink::WebMouseWheelEvent& event); |
| 224 void SendGestureEvent(const blink::WebGestureEvent& event); | 224 void SendGestureEvent(const blink::WebGestureEvent& event); |
| 225 void set_ime_adapter(ImeAdapterAndroid* ime_adapter) { |
| 226 ime_adapter_android_ = ime_adapter; |
| 227 } |
| 225 | 228 |
| 226 void OnStartContentIntent(const GURL& content_url, bool is_main_frame); | 229 void OnStartContentIntent(const GURL& content_url, bool is_main_frame); |
| 227 | 230 |
| 228 bool OnTouchEvent(const ui::MotionEvent& event); | 231 bool OnTouchEvent(const ui::MotionEvent& event); |
| 229 bool OnTouchHandleEvent(const ui::MotionEvent& event); | 232 bool OnTouchHandleEvent(const ui::MotionEvent& event); |
| 230 void ResetGestureDetection(); | 233 void ResetGestureDetection(); |
| 231 void SetDoubleTapSupportEnabled(bool enabled); | 234 void SetDoubleTapSupportEnabled(bool enabled); |
| 232 void SetMultiTouchZoomSupportEnabled(bool enabled); | 235 void SetMultiTouchZoomSupportEnabled(bool enabled); |
| 233 | 236 |
| 234 long GetNativeImeAdapter(); | |
| 235 | |
| 236 void WasResized(); | 237 void WasResized(); |
| 237 | 238 |
| 238 bool HasValidFrame() const; | 239 bool HasValidFrame() const; |
| 239 | 240 |
| 240 void MoveCaret(const gfx::Point& point); | 241 void MoveCaret(const gfx::Point& point); |
| 241 void ShowContextMenuAtPoint(const gfx::Point& point); | 242 void ShowContextMenuAtPoint(const gfx::Point& point); |
| 242 void DismissTextHandles(); | 243 void DismissTextHandles(); |
| 243 void SetTextHandlesTemporarilyHidden(bool hidden); | 244 void SetTextHandlesTemporarilyHidden(bool hidden); |
| 244 void OnShowUnhandledTapUIIfNeeded(int x_dip, int y_dip); | 245 void OnShowUnhandledTapUIIfNeeded(int x_dip, int y_dip); |
| 245 | 246 |
| (...skipping 14 matching lines...) Expand all Loading... |
| 260 RenderWidgetHostViewBase* updated_view, | 261 RenderWidgetHostViewBase* updated_view, |
| 261 bool did_change_state) override; | 262 bool did_change_state) override; |
| 262 void OnImeCompositionRangeChanged( | 263 void OnImeCompositionRangeChanged( |
| 263 TextInputManager* text_input_manager, | 264 TextInputManager* text_input_manager, |
| 264 RenderWidgetHostViewBase* updated_view) override; | 265 RenderWidgetHostViewBase* updated_view) override; |
| 265 void OnImeCancelComposition(TextInputManager* text_input_manager, | 266 void OnImeCancelComposition(TextInputManager* text_input_manager, |
| 266 RenderWidgetHostViewBase* updated_view) override; | 267 RenderWidgetHostViewBase* updated_view) override; |
| 267 void OnTextSelectionChanged(TextInputManager* text_input_manager, | 268 void OnTextSelectionChanged(TextInputManager* text_input_manager, |
| 268 RenderWidgetHostViewBase* updated_view) override; | 269 RenderWidgetHostViewBase* updated_view) override; |
| 269 | 270 |
| 270 ImeAdapterAndroid* ime_adapter_for_testing() { return &ime_adapter_android_; } | 271 ImeAdapterAndroid* ime_adapter_for_testing() { return ime_adapter_android_; } |
| 271 | 272 |
| 272 // Exposed for tests. | 273 // Exposed for tests. |
| 273 cc::SurfaceId SurfaceIdForTesting() const override; | 274 cc::SurfaceId SurfaceIdForTesting() const override; |
| 274 | 275 |
| 275 private: | 276 private: |
| 276 void RunAckCallbacks(); | 277 void RunAckCallbacks(); |
| 277 | 278 |
| 278 void CheckCompositorFrameSinkChanged(uint32_t compositor_frame_sink_id); | 279 void CheckCompositorFrameSinkChanged(uint32_t compositor_frame_sink_id); |
| 279 void SubmitCompositorFrame(cc::CompositorFrame frame_data); | 280 void SubmitCompositorFrame(cc::CompositorFrame frame_data); |
| 280 void SendReclaimCompositorResources(uint32_t compositor_frame_sink_id, | 281 void SendReclaimCompositorResources(uint32_t compositor_frame_sink_id, |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 343 bool is_window_visible_; | 344 bool is_window_visible_; |
| 344 bool is_window_activity_started_; | 345 bool is_window_activity_started_; |
| 345 | 346 |
| 346 // Used to customize behavior for virtual reality mode, such as the | 347 // Used to customize behavior for virtual reality mode, such as the |
| 347 // appearance of overscroll glow and the keyboard. | 348 // appearance of overscroll glow and the keyboard. |
| 348 bool is_in_vr_; | 349 bool is_in_vr_; |
| 349 | 350 |
| 350 // ContentViewCoreImpl is our interface to the view system. | 351 // ContentViewCoreImpl is our interface to the view system. |
| 351 ContentViewCoreImpl* content_view_core_; | 352 ContentViewCoreImpl* content_view_core_; |
| 352 | 353 |
| 353 ImeAdapterAndroid ime_adapter_android_; | 354 ImeAdapterAndroid* ime_adapter_android_; |
| 354 | 355 |
| 355 // Body background color of the underlying document. | 356 // Body background color of the underlying document. |
| 356 SkColor cached_background_color_; | 357 SkColor cached_background_color_; |
| 357 | 358 |
| 358 mutable ui::ViewAndroid view_; | 359 mutable ui::ViewAndroid view_; |
| 359 | 360 |
| 360 // Manages the Compositor Frames received from the renderer. | 361 // Manages the Compositor Frames received from the renderer. |
| 361 std::unique_ptr<ui::DelegatedFrameHostAndroid> delegated_frame_host_; | 362 std::unique_ptr<ui::DelegatedFrameHostAndroid> delegated_frame_host_; |
| 362 | 363 |
| 363 cc::ReturnedResourceArray surface_returned_resources_; | 364 cc::ReturnedResourceArray surface_returned_resources_; |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 403 float prev_bottom_shown_pix_; | 404 float prev_bottom_shown_pix_; |
| 404 | 405 |
| 405 base::WeakPtrFactory<RenderWidgetHostViewAndroid> weak_ptr_factory_; | 406 base::WeakPtrFactory<RenderWidgetHostViewAndroid> weak_ptr_factory_; |
| 406 | 407 |
| 407 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostViewAndroid); | 408 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostViewAndroid); |
| 408 }; | 409 }; |
| 409 | 410 |
| 410 } // namespace content | 411 } // namespace content |
| 411 | 412 |
| 412 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_ANDROID_H_ | 413 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_ANDROID_H_ |
| OLD | NEW |