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 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
154 void ClearCompositorFrame() override; | 154 void ClearCompositorFrame() override; |
155 void SetIsInVR(bool is_in_vr) override; | 155 void SetIsInVR(bool is_in_vr) override; |
156 bool IsInVR() const override; | 156 bool IsInVR() const override; |
157 void DidOverscroll(const ui::DidOverscrollParams& params) override; | 157 void DidOverscroll(const ui::DidOverscrollParams& params) override; |
158 void DidStopFlinging() override; | 158 void DidStopFlinging() override; |
159 void ShowDisambiguationPopup(const gfx::Rect& rect_pixels, | 159 void ShowDisambiguationPopup(const gfx::Rect& rect_pixels, |
160 const SkBitmap& zoomed_bitmap) override; | 160 const SkBitmap& zoomed_bitmap) override; |
161 std::unique_ptr<SyntheticGestureTarget> CreateSyntheticGestureTarget() | 161 std::unique_ptr<SyntheticGestureTarget> CreateSyntheticGestureTarget() |
162 override; | 162 override; |
163 void OnDidNavigateMainFrameToNewPage() override; | 163 void OnDidNavigateMainFrameToNewPage() override; |
164 void OnFullscreenStateChanged(bool entered_fullscreen) override; | |
164 void SetNeedsBeginFrames(bool needs_begin_frames) override; | 165 void SetNeedsBeginFrames(bool needs_begin_frames) override; |
165 cc::FrameSinkId GetFrameSinkId() override; | 166 cc::FrameSinkId GetFrameSinkId() override; |
166 cc::FrameSinkId FrameSinkIdAtPoint(cc::SurfaceHittestDelegate* delegate, | 167 cc::FrameSinkId FrameSinkIdAtPoint(cc::SurfaceHittestDelegate* delegate, |
167 const gfx::Point& point, | 168 const gfx::Point& point, |
168 gfx::Point* transformed_point) override; | 169 gfx::Point* transformed_point) override; |
169 void ProcessMouseEvent(const blink::WebMouseEvent& event, | 170 void ProcessMouseEvent(const blink::WebMouseEvent& event, |
170 const ui::LatencyInfo& latency) override; | 171 const ui::LatencyInfo& latency) override; |
171 void ProcessMouseWheelEvent(const blink::WebMouseWheelEvent& event, | 172 void ProcessMouseWheelEvent(const blink::WebMouseWheelEvent& event, |
172 const ui::LatencyInfo& latency) override; | 173 const ui::LatencyInfo& latency) override; |
173 void ProcessTouchEvent(const blink::WebTouchEvent& event, | 174 void ProcessTouchEvent(const blink::WebTouchEvent& event, |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
231 void ReclaimResources(const cc::ReturnedResourceArray& resources) override; | 232 void ReclaimResources(const cc::ReturnedResourceArray& resources) override; |
232 | 233 |
233 // cc::BeginFrameObserver implementation. | 234 // cc::BeginFrameObserver implementation. |
234 void OnBeginFrame(const cc::BeginFrameArgs& args) override; | 235 void OnBeginFrame(const cc::BeginFrameArgs& args) override; |
235 const cc::BeginFrameArgs& LastUsedBeginFrameArgs() const override; | 236 const cc::BeginFrameArgs& LastUsedBeginFrameArgs() const override; |
236 void OnBeginFrameSourcePausedChanged(bool paused) override; | 237 void OnBeginFrameSourcePausedChanged(bool paused) override; |
237 | 238 |
238 // Non-virtual methods | 239 // Non-virtual methods |
239 void SetContentViewCore(ContentViewCoreImpl* content_view_core); | 240 void SetContentViewCore(ContentViewCoreImpl* content_view_core); |
240 SkColor GetCachedBackgroundColor() const; | 241 SkColor GetCachedBackgroundColor() const; |
242 void ClearThumbnailPlaceholder(); | |
241 void SendKeyEvent(const NativeWebKeyboardEvent& event); | 243 void SendKeyEvent(const NativeWebKeyboardEvent& event); |
242 void SendMouseEvent(const ui::MotionEventAndroid&, int action_button); | 244 void SendMouseEvent(const ui::MotionEventAndroid&, int action_button); |
243 void SendMouseWheelEvent(const blink::WebMouseWheelEvent& event); | 245 void SendMouseWheelEvent(const blink::WebMouseWheelEvent& event); |
244 void SendGestureEvent(const blink::WebGestureEvent& event); | 246 void SendGestureEvent(const blink::WebGestureEvent& event); |
245 void ResolveTapDisambiguation(double timestamp_seconds, | 247 void ResolveTapDisambiguation(double timestamp_seconds, |
246 gfx::Point tap_viewport_offset, | 248 gfx::Point tap_viewport_offset, |
247 bool is_long_press); | 249 bool is_long_press); |
248 void set_ime_adapter(ImeAdapterAndroid* ime_adapter) { | 250 void set_ime_adapter(ImeAdapterAndroid* ime_adapter) { |
249 ime_adapter_android_ = ime_adapter; | 251 ime_adapter_android_ = ime_adapter; |
250 } | 252 } |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
297 RenderWidgetHostViewBase* updated_view) override; | 299 RenderWidgetHostViewBase* updated_view) override; |
298 void OnTextSelectionChanged(TextInputManager* text_input_manager, | 300 void OnTextSelectionChanged(TextInputManager* text_input_manager, |
299 RenderWidgetHostViewBase* updated_view) override; | 301 RenderWidgetHostViewBase* updated_view) override; |
300 | 302 |
301 ImeAdapterAndroid* ime_adapter_for_testing() { return ime_adapter_android_; } | 303 ImeAdapterAndroid* ime_adapter_for_testing() { return ime_adapter_android_; } |
302 | 304 |
303 // Exposed for tests. | 305 // Exposed for tests. |
304 cc::SurfaceId SurfaceIdForTesting() const override; | 306 cc::SurfaceId SurfaceIdForTesting() const override; |
305 | 307 |
306 private: | 308 private: |
309 enum class FullscreenState { | |
310 kNotFullscreen, | |
311 kEnteringFullscreen, | |
312 kFullscreen, | |
313 kExitingFullscreen, | |
314 kFullscreenRotation, | |
315 }; | |
316 | |
307 void RunAckCallbacks(); | 317 void RunAckCallbacks(); |
308 | 318 |
309 void SendReclaimCompositorResources(bool is_swap_ack); | 319 void SendReclaimCompositorResources(bool is_swap_ack); |
310 | 320 |
311 void OnFrameMetadataUpdated(const cc::CompositorFrameMetadata& frame_metadata, | 321 void OnFrameMetadataUpdated(const cc::CompositorFrameMetadata& frame_metadata, |
312 bool is_transparent); | 322 bool is_transparent); |
313 | 323 |
314 void ShowInternal(); | 324 void ShowInternal(); |
315 void HideInternal(); | 325 void HideInternal(); |
316 void AttachLayers(); | 326 void AttachLayers(); |
(...skipping 25 matching lines...) Expand all Loading... | |
342 void RequestDisallowInterceptTouchEvent(); | 352 void RequestDisallowInterceptTouchEvent(); |
343 | 353 |
344 bool SyncCompositorOnMessageReceived(const IPC::Message& message); | 354 bool SyncCompositorOnMessageReceived(const IPC::Message& message); |
345 | 355 |
346 void ComputeEventLatencyOSTouchHistograms(const ui::MotionEvent& event); | 356 void ComputeEventLatencyOSTouchHistograms(const ui::MotionEvent& event); |
347 | 357 |
348 void CreateOverscrollControllerIfPossible(); | 358 void CreateOverscrollControllerIfPossible(); |
349 | 359 |
350 WebContentsAccessibilityAndroid* GetWebContentsAccessibilityAndroid() const; | 360 WebContentsAccessibilityAndroid* GetWebContentsAccessibilityAndroid() const; |
351 | 361 |
362 void UpdateFullscreenStateAndEvictFrameIfNeeded(); | |
363 void UpdateFullscreenState(); | |
364 bool IsInFullscreenTransition() const; | |
365 | |
352 // The model object. | 366 // The model object. |
353 RenderWidgetHostImpl* host_; | 367 RenderWidgetHostImpl* host_; |
354 | 368 |
355 // The begin frame source being observed. Null if none. | 369 // The begin frame source being observed. Null if none. |
356 cc::BeginFrameSource* begin_frame_source_; | 370 cc::BeginFrameSource* begin_frame_source_; |
357 cc::BeginFrameArgs last_begin_frame_args_; | 371 cc::BeginFrameArgs last_begin_frame_args_; |
358 uint32_t latest_confirmed_begin_frame_source_id_; | 372 uint32_t latest_confirmed_begin_frame_source_id_; |
359 uint64_t latest_confirmed_begin_frame_sequence_number_; | 373 uint64_t latest_confirmed_begin_frame_sequence_number_; |
360 | 374 |
361 // Indicates whether and for what reason a request for begin frames has been | 375 // Indicates whether and for what reason a request for begin frames has been |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
421 std::unique_ptr<viz::FrameEvictor> frame_evictor_; | 435 std::unique_ptr<viz::FrameEvictor> frame_evictor_; |
422 | 436 |
423 bool observing_root_window_; | 437 bool observing_root_window_; |
424 | 438 |
425 // The last scroll offset of the view. | 439 // The last scroll offset of the view. |
426 gfx::Vector2dF last_scroll_offset_; | 440 gfx::Vector2dF last_scroll_offset_; |
427 | 441 |
428 float prev_top_shown_pix_; | 442 float prev_top_shown_pix_; |
429 float prev_bottom_shown_pix_; | 443 float prev_bottom_shown_pix_; |
430 | 444 |
445 FullscreenState fullscreen_state_ = FullscreenState::kNotFullscreen; | |
446 | |
447 // While we could simply take a mismatch in fullscreen states as the trigger | |
448 // for a transition, and assume the transition to have finished once the | |
449 // fullscreen states and sizes match, we have cases where we reach this | |
450 // consistent state before the physical backing size changes. Therefore we | |
451 // defer assuming the transition to be completed until a resize event is | |
452 // received, which is marked by |fullscreen_transition_awaiting_resize_|. | |
453 // | |
454 // Note that this assumes that every transition will be followed by a change | |
455 // in the view's physical backing size. | |
456 bool fullscreen_transition_awaiting_resize_ = false; | |
aelias_OOO_until_Jul13
2017/06/22 02:52:06
Ping again when you make progress on removing this
steimel
2017/06/29 00:38:51
According to Khushal, the discussion on crbug.com/
aelias_OOO_until_Jul13
2017/06/29 01:05:18
The initial concerns expressed by me and Bo didn't
| |
457 bool current_frame_is_fullscreen_ = false; | |
458 bool web_contents_is_fullscreen_ = false; | |
459 | |
431 cc::mojom::MojoCompositorFrameSinkClient* renderer_compositor_frame_sink_ = | 460 cc::mojom::MojoCompositorFrameSinkClient* renderer_compositor_frame_sink_ = |
432 nullptr; | 461 nullptr; |
433 | 462 |
434 base::ObserverList<DestructionObserver> destruction_observers_; | 463 base::ObserverList<DestructionObserver> destruction_observers_; |
435 | 464 |
436 MouseWheelPhaseHandler mouse_wheel_phase_handler_; | 465 MouseWheelPhaseHandler mouse_wheel_phase_handler_; |
437 | 466 |
438 base::WeakPtrFactory<RenderWidgetHostViewAndroid> weak_ptr_factory_; | 467 base::WeakPtrFactory<RenderWidgetHostViewAndroid> weak_ptr_factory_; |
439 | 468 |
440 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostViewAndroid); | 469 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostViewAndroid); |
441 }; | 470 }; |
442 | 471 |
443 } // namespace content | 472 } // namespace content |
444 | 473 |
445 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_ANDROID_H_ | 474 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_ANDROID_H_ |
OLD | NEW |