Chromium Code Reviews| 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 |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 55 namespace ui { | 55 namespace ui { |
| 56 class DelegatedFrameHostAndroid; | 56 class DelegatedFrameHostAndroid; |
| 57 } | 57 } |
| 58 | 58 |
| 59 namespace content { | 59 namespace content { |
| 60 class ContentViewCoreImpl; | 60 class ContentViewCoreImpl; |
| 61 class OverscrollControllerAndroid; | 61 class OverscrollControllerAndroid; |
| 62 class RenderWidgetHost; | 62 class RenderWidgetHost; |
| 63 class RenderWidgetHostImpl; | 63 class RenderWidgetHostImpl; |
| 64 class SynchronousCompositorHost; | 64 class SynchronousCompositorHost; |
| 65 class SynchronousCompositorClient; | |
| 65 struct NativeWebKeyboardEvent; | 66 struct NativeWebKeyboardEvent; |
| 66 struct TextInputState; | 67 struct TextInputState; |
| 67 | 68 |
| 68 // ----------------------------------------------------------------------------- | 69 // ----------------------------------------------------------------------------- |
| 69 // See comments in render_widget_host_view.h about this class and its members. | 70 // See comments in render_widget_host_view.h about this class and its members. |
| 70 // ----------------------------------------------------------------------------- | 71 // ----------------------------------------------------------------------------- |
| 71 class CONTENT_EXPORT RenderWidgetHostViewAndroid | 72 class CONTENT_EXPORT RenderWidgetHostViewAndroid |
| 72 : public RenderWidgetHostViewBase, | 73 : public RenderWidgetHostViewBase, |
| 73 public ui::GestureProviderClient, | 74 public ui::GestureProviderClient, |
| 74 public ui::WindowAndroidObserver, | 75 public ui::WindowAndroidObserver, |
| 75 public DelegatedFrameEvictorClient, | 76 public DelegatedFrameEvictorClient, |
| 76 public StylusTextSelectorClient, | 77 public StylusTextSelectorClient, |
| 77 public ui::TouchSelectionControllerClient, | 78 public ui::TouchSelectionControllerClient, |
| 78 public content::ContentViewCoreImplObserver { | 79 public content::ContentViewCoreImplObserver { |
| 79 public: | 80 public: |
| 80 RenderWidgetHostViewAndroid(RenderWidgetHostImpl* widget, | 81 RenderWidgetHostViewAndroid(RenderWidgetHostImpl* widget, |
| 81 ContentViewCoreImpl* content_view_core); | 82 ContentViewCoreImpl* content_view_core, |
| 83 SynchronousCompositorClient* compositor_client); | |
|
boliu
2016/11/10 17:52:34
is the constructor arg required? can't we just con
Jinsuk Kim
2016/11/10 17:55:15
That's how it was done but it caused a problem. Th
boliu
2016/11/10 17:59:21
I don't think there is any more need to tie the li
Jinsuk Kim
2016/11/10 21:22:19
SG. Reverted.
| |
| 82 ~RenderWidgetHostViewAndroid() override; | 84 ~RenderWidgetHostViewAndroid() override; |
| 83 | 85 |
| 84 void Blur(); | 86 void Blur(); |
| 85 | 87 |
| 86 // RenderWidgetHostView implementation. | 88 // RenderWidgetHostView implementation. |
| 87 bool OnMessageReceived(const IPC::Message& msg) override; | 89 bool OnMessageReceived(const IPC::Message& msg) override; |
| 88 void InitAsChild(gfx::NativeView parent_view) override; | 90 void InitAsChild(gfx::NativeView parent_view) override; |
| 89 void InitAsPopup(RenderWidgetHostView* parent_host_view, | 91 void InitAsPopup(RenderWidgetHostView* parent_host_view, |
| 90 const gfx::Rect& pos) override; | 92 const gfx::Rect& pos) override; |
| 91 void InitAsFullscreen(RenderWidgetHostView* reference_host_view) override; | 93 void InitAsFullscreen(RenderWidgetHostView* reference_host_view) override; |
| (...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 230 | 232 |
| 231 bool HasValidFrame() const; | 233 bool HasValidFrame() const; |
| 232 | 234 |
| 233 void MoveCaret(const gfx::Point& point); | 235 void MoveCaret(const gfx::Point& point); |
| 234 void DismissTextHandles(); | 236 void DismissTextHandles(); |
| 235 void SetTextHandlesTemporarilyHidden(bool hidden); | 237 void SetTextHandlesTemporarilyHidden(bool hidden); |
| 236 void OnShowUnhandledTapUIIfNeeded(int x_dip, int y_dip); | 238 void OnShowUnhandledTapUIIfNeeded(int x_dip, int y_dip); |
| 237 | 239 |
| 238 void SynchronousFrameMetadata(cc::CompositorFrameMetadata frame_metadata); | 240 void SynchronousFrameMetadata(cc::CompositorFrameMetadata frame_metadata); |
| 239 | 241 |
| 242 void set_synchronous_compositor_client(SynchronousCompositorClient* client) { | |
| 243 synchronous_compositor_client_ = client; | |
| 244 } | |
| 245 | |
| 246 SynchronousCompositorClient* synchronous_compositor_client() const { | |
| 247 return synchronous_compositor_client_; | |
| 248 } | |
| 249 | |
| 240 static void OnContextLost(); | 250 static void OnContextLost(); |
| 241 | 251 |
| 242 private: | 252 private: |
| 243 void RunAckCallbacks(); | 253 void RunAckCallbacks(); |
| 244 | 254 |
| 245 void CheckCompositorFrameSinkChanged(uint32_t compositor_frame_sink_id); | 255 void CheckCompositorFrameSinkChanged(uint32_t compositor_frame_sink_id); |
| 246 void SubmitCompositorFrame(cc::CompositorFrame frame_data); | 256 void SubmitCompositorFrame(cc::CompositorFrame frame_data); |
| 247 void SendReclaimCompositorResources(uint32_t compositor_frame_sink_id, | 257 void SendReclaimCompositorResources(uint32_t compositor_frame_sink_id, |
| 248 bool is_swap_ack); | 258 bool is_swap_ack); |
| 249 | 259 |
| (...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 344 // Manages selection handle rendering and manipulation. | 354 // Manages selection handle rendering and manipulation. |
| 345 // This will always be NULL if |content_view_core_| is NULL. | 355 // This will always be NULL if |content_view_core_| is NULL. |
| 346 std::unique_ptr<ui::TouchSelectionController> selection_controller_; | 356 std::unique_ptr<ui::TouchSelectionController> selection_controller_; |
| 347 | 357 |
| 348 // Bounds to use if we have no backing ContentViewCore | 358 // Bounds to use if we have no backing ContentViewCore |
| 349 gfx::Rect default_bounds_; | 359 gfx::Rect default_bounds_; |
| 350 | 360 |
| 351 const bool using_browser_compositor_; | 361 const bool using_browser_compositor_; |
| 352 std::unique_ptr<SynchronousCompositorHost> sync_compositor_; | 362 std::unique_ptr<SynchronousCompositorHost> sync_compositor_; |
| 353 | 363 |
| 364 SynchronousCompositorClient* synchronous_compositor_client_; | |
| 365 | |
| 354 std::unique_ptr<DelegatedFrameEvictor> frame_evictor_; | 366 std::unique_ptr<DelegatedFrameEvictor> frame_evictor_; |
| 355 | 367 |
| 356 size_t locks_on_frame_count_; | 368 size_t locks_on_frame_count_; |
| 357 bool observing_root_window_; | 369 bool observing_root_window_; |
| 358 | 370 |
| 359 struct LastFrameInfo { | 371 struct LastFrameInfo { |
| 360 LastFrameInfo(uint32_t compositor_frame_sink_id, | 372 LastFrameInfo(uint32_t compositor_frame_sink_id, |
| 361 cc::CompositorFrame output_frame); | 373 cc::CompositorFrame output_frame); |
| 362 ~LastFrameInfo(); | 374 ~LastFrameInfo(); |
| 363 uint32_t compositor_frame_sink_id; | 375 uint32_t compositor_frame_sink_id; |
| 364 cc::CompositorFrame frame; | 376 cc::CompositorFrame frame; |
| 365 }; | 377 }; |
| 366 | 378 |
| 367 std::unique_ptr<LastFrameInfo> last_frame_info_; | 379 std::unique_ptr<LastFrameInfo> last_frame_info_; |
| 368 | 380 |
| 369 // The last scroll offset of the view. | 381 // The last scroll offset of the view. |
| 370 gfx::Vector2dF last_scroll_offset_; | 382 gfx::Vector2dF last_scroll_offset_; |
| 371 | 383 |
| 372 base::WeakPtrFactory<RenderWidgetHostViewAndroid> weak_ptr_factory_; | 384 base::WeakPtrFactory<RenderWidgetHostViewAndroid> weak_ptr_factory_; |
| 373 | 385 |
| 374 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostViewAndroid); | 386 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostViewAndroid); |
| 375 }; | 387 }; |
| 376 | 388 |
| 377 } // namespace content | 389 } // namespace content |
| 378 | 390 |
| 379 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_ANDROID_H_ | 391 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_ANDROID_H_ |
| OLD | NEW |