| 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 "content/browser/accessibility/browser_accessibility_manager.h" | 23 #include "content/browser/accessibility/browser_accessibility_manager.h" |
| 24 #include "content/browser/android/content_view_core_impl_observer.h" | 24 #include "content/browser/android/content_view_core_impl_observer.h" |
| 25 #include "content/browser/renderer_host/delegated_frame_evictor.h" | 25 #include "content/browser/renderer_host/delegated_frame_evictor.h" |
| 26 #include "content/browser/renderer_host/ime_adapter_android.h" | 26 #include "content/browser/renderer_host/ime_adapter_android.h" |
| 27 #include "content/browser/renderer_host/input/stylus_text_selector.h" | 27 #include "content/browser/renderer_host/input/stylus_text_selector.h" |
| 28 #include "content/browser/renderer_host/render_widget_host_view_base.h" | 28 #include "content/browser/renderer_host/render_widget_host_view_base.h" |
| 29 #include "content/browser/renderer_host/text_input_manager.h" |
| 29 #include "content/common/content_export.h" | 30 #include "content/common/content_export.h" |
| 30 #include "content/public/browser/readback_types.h" | 31 #include "content/public/browser/readback_types.h" |
| 31 #include "gpu/command_buffer/common/mailbox.h" | 32 #include "gpu/command_buffer/common/mailbox.h" |
| 32 #include "third_party/skia/include/core/SkColor.h" | 33 #include "third_party/skia/include/core/SkColor.h" |
| 33 #include "ui/android/view_android.h" | 34 #include "ui/android/view_android.h" |
| 34 #include "ui/android/window_android_observer.h" | 35 #include "ui/android/window_android_observer.h" |
| 35 #include "ui/events/android/motion_event_android.h" | 36 #include "ui/events/android/motion_event_android.h" |
| 36 #include "ui/events/gesture_detection/filtered_gesture_provider.h" | 37 #include "ui/events/gesture_detection/filtered_gesture_provider.h" |
| 37 #include "ui/gfx/geometry/size.h" | 38 #include "ui/gfx/geometry/size.h" |
| 38 #include "ui/gfx/geometry/vector2d_f.h" | 39 #include "ui/gfx/geometry/vector2d_f.h" |
| (...skipping 19 matching lines...) Expand all Loading... |
| 58 } | 59 } |
| 59 | 60 |
| 60 namespace content { | 61 namespace content { |
| 61 class ContentViewCoreImpl; | 62 class ContentViewCoreImpl; |
| 62 class OverscrollControllerAndroid; | 63 class OverscrollControllerAndroid; |
| 63 class RenderWidgetHost; | 64 class RenderWidgetHost; |
| 64 class RenderWidgetHostImpl; | 65 class RenderWidgetHostImpl; |
| 65 class SynchronousCompositorHost; | 66 class SynchronousCompositorHost; |
| 66 class SynchronousCompositorClient; | 67 class SynchronousCompositorClient; |
| 67 struct NativeWebKeyboardEvent; | 68 struct NativeWebKeyboardEvent; |
| 68 struct TextInputState; | |
| 69 | 69 |
| 70 // ----------------------------------------------------------------------------- | 70 // ----------------------------------------------------------------------------- |
| 71 // See comments in render_widget_host_view.h about this class and its members. | 71 // See comments in render_widget_host_view.h about this class and its members. |
| 72 // ----------------------------------------------------------------------------- | 72 // ----------------------------------------------------------------------------- |
| 73 class CONTENT_EXPORT RenderWidgetHostViewAndroid | 73 class CONTENT_EXPORT RenderWidgetHostViewAndroid |
| 74 : public RenderWidgetHostViewBase, | 74 : public RenderWidgetHostViewBase, |
| 75 public ui::GestureProviderClient, | 75 public ui::GestureProviderClient, |
| 76 public ui::WindowAndroidObserver, | 76 public ui::WindowAndroidObserver, |
| 77 public DelegatedFrameEvictorClient, | 77 public DelegatedFrameEvictorClient, |
| 78 public StylusTextSelectorClient, | 78 public StylusTextSelectorClient, |
| 79 public ui::TouchSelectionControllerClient, | 79 public ui::TouchSelectionControllerClient, |
| 80 public content::ContentViewCoreImplObserver { | 80 public content::ContentViewCoreImplObserver, |
| 81 public content::TextInputManager::Observer { |
| 81 public: | 82 public: |
| 82 RenderWidgetHostViewAndroid(RenderWidgetHostImpl* widget, | 83 RenderWidgetHostViewAndroid(RenderWidgetHostImpl* widget, |
| 83 ContentViewCoreImpl* content_view_core); | 84 ContentViewCoreImpl* content_view_core); |
| 84 ~RenderWidgetHostViewAndroid() override; | 85 ~RenderWidgetHostViewAndroid() override; |
| 85 | 86 |
| 86 void Blur(); | 87 void Blur(); |
| 87 | 88 |
| 88 // RenderWidgetHostView implementation. | 89 // RenderWidgetHostView implementation. |
| 89 bool OnMessageReceived(const IPC::Message& msg) override; | 90 bool OnMessageReceived(const IPC::Message& msg) override; |
| 90 void InitAsChild(gfx::NativeView parent_view) override; | 91 void InitAsChild(gfx::NativeView parent_view) override; |
| (...skipping 13 matching lines...) Expand all Loading... |
| 104 void Hide() override; | 105 void Hide() override; |
| 105 bool IsShowing() override; | 106 bool IsShowing() override; |
| 106 gfx::Rect GetViewBounds() const override; | 107 gfx::Rect GetViewBounds() const override; |
| 107 gfx::Size GetVisibleViewportSize() const override; | 108 gfx::Size GetVisibleViewportSize() const override; |
| 108 gfx::Size GetPhysicalBackingSize() const override; | 109 gfx::Size GetPhysicalBackingSize() const override; |
| 109 bool DoBrowserControlsShrinkBlinkSize() const override; | 110 bool DoBrowserControlsShrinkBlinkSize() const override; |
| 110 float GetTopControlsHeight() const override; | 111 float GetTopControlsHeight() const override; |
| 111 float GetBottomControlsHeight() const override; | 112 float GetBottomControlsHeight() const override; |
| 112 void UpdateCursor(const WebCursor& cursor) override; | 113 void UpdateCursor(const WebCursor& cursor) override; |
| 113 void SetIsLoading(bool is_loading) override; | 114 void SetIsLoading(bool is_loading) override; |
| 114 void TextInputStateChanged(const TextInputState& params) override; | |
| 115 void ImeCancelComposition() override; | 115 void ImeCancelComposition() override; |
| 116 void ImeCompositionRangeChanged( | 116 void ImeCompositionRangeChanged( |
| 117 const gfx::Range& range, | 117 const gfx::Range& range, |
| 118 const std::vector<gfx::Rect>& character_bounds) override; | 118 const std::vector<gfx::Rect>& character_bounds) override; |
| 119 void FocusedNodeChanged(bool is_editable_node, | 119 void FocusedNodeChanged(bool is_editable_node, |
| 120 const gfx::Rect& node_bounds_in_screen) override; | 120 const gfx::Rect& node_bounds_in_screen) override; |
| 121 void RenderProcessGone(base::TerminationStatus status, | 121 void RenderProcessGone(base::TerminationStatus status, |
| 122 int error_code) override; | 122 int error_code) override; |
| 123 void Destroy() override; | 123 void Destroy() override; |
| 124 void SetTooltipText(const base::string16& tooltip_text) override; | 124 void SetTooltipText(const base::string16& tooltip_text) override; |
| (...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 240 void SynchronousFrameMetadata(cc::CompositorFrameMetadata frame_metadata); | 240 void SynchronousFrameMetadata(cc::CompositorFrameMetadata frame_metadata); |
| 241 | 241 |
| 242 void SetSynchronousCompositorClient(SynchronousCompositorClient* client); | 242 void SetSynchronousCompositorClient(SynchronousCompositorClient* client); |
| 243 | 243 |
| 244 SynchronousCompositorClient* synchronous_compositor_client() const { | 244 SynchronousCompositorClient* synchronous_compositor_client() const { |
| 245 return synchronous_compositor_client_; | 245 return synchronous_compositor_client_; |
| 246 } | 246 } |
| 247 | 247 |
| 248 static void OnContextLost(); | 248 static void OnContextLost(); |
| 249 | 249 |
| 250 // TextInputManager::Observer overrides. |
| 251 void OnUpdateTextInputStateCalled(TextInputManager* text_input_manager, |
| 252 RenderWidgetHostViewBase* updated_view, |
| 253 bool did_change_state) override; |
| 254 |
| 250 private: | 255 private: |
| 251 void RunAckCallbacks(); | 256 void RunAckCallbacks(); |
| 252 | 257 |
| 253 void CheckCompositorFrameSinkChanged(uint32_t compositor_frame_sink_id); | 258 void CheckCompositorFrameSinkChanged(uint32_t compositor_frame_sink_id); |
| 254 void SubmitCompositorFrame(cc::CompositorFrame frame_data); | 259 void SubmitCompositorFrame(cc::CompositorFrame frame_data); |
| 255 void SendReclaimCompositorResources(uint32_t compositor_frame_sink_id, | 260 void SendReclaimCompositorResources(uint32_t compositor_frame_sink_id, |
| 256 bool is_swap_ack); | 261 bool is_swap_ack); |
| 257 | 262 |
| 258 void OnFrameMetadataUpdated(const cc::CompositorFrameMetadata& frame_metadata, | 263 void OnFrameMetadataUpdated(const cc::CompositorFrameMetadata& frame_metadata, |
| 259 bool is_transparent); | 264 bool is_transparent); |
| (...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 380 gfx::Vector2dF last_scroll_offset_; | 385 gfx::Vector2dF last_scroll_offset_; |
| 381 | 386 |
| 382 base::WeakPtrFactory<RenderWidgetHostViewAndroid> weak_ptr_factory_; | 387 base::WeakPtrFactory<RenderWidgetHostViewAndroid> weak_ptr_factory_; |
| 383 | 388 |
| 384 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostViewAndroid); | 389 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostViewAndroid); |
| 385 }; | 390 }; |
| 386 | 391 |
| 387 } // namespace content | 392 } // namespace content |
| 388 | 393 |
| 389 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_ANDROID_H_ | 394 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_ANDROID_H_ |
| OLD | NEW |