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 220 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 231 void ReclaimResources(const cc::ReturnedResourceArray& resources) override; | 231 void ReclaimResources(const cc::ReturnedResourceArray& resources) override; |
| 232 | 232 |
| 233 // cc::BeginFrameObserver implementation. | 233 // cc::BeginFrameObserver implementation. |
| 234 void OnBeginFrame(const cc::BeginFrameArgs& args) override; | 234 void OnBeginFrame(const cc::BeginFrameArgs& args) override; |
| 235 const cc::BeginFrameArgs& LastUsedBeginFrameArgs() const override; | 235 const cc::BeginFrameArgs& LastUsedBeginFrameArgs() const override; |
| 236 void OnBeginFrameSourcePausedChanged(bool paused) override; | 236 void OnBeginFrameSourcePausedChanged(bool paused) override; |
| 237 | 237 |
| 238 // Non-virtual methods | 238 // Non-virtual methods |
| 239 void SetContentViewCore(ContentViewCoreImpl* content_view_core); | 239 void SetContentViewCore(ContentViewCoreImpl* content_view_core); |
| 240 SkColor GetCachedBackgroundColor() const; | 240 SkColor GetCachedBackgroundColor() const; |
| 241 bool CanShowThumbnailPlaceholder() const; | |
| 241 void SendKeyEvent(const NativeWebKeyboardEvent& event); | 242 void SendKeyEvent(const NativeWebKeyboardEvent& event); |
| 242 void SendMouseEvent(const ui::MotionEventAndroid&, int action_button); | 243 void SendMouseEvent(const ui::MotionEventAndroid&, int action_button); |
| 243 void SendMouseWheelEvent(const blink::WebMouseWheelEvent& event); | 244 void SendMouseWheelEvent(const blink::WebMouseWheelEvent& event); |
| 244 void SendGestureEvent(const blink::WebGestureEvent& event); | 245 void SendGestureEvent(const blink::WebGestureEvent& event); |
| 245 void ResolveTapDisambiguation(double timestamp_seconds, | 246 void ResolveTapDisambiguation(double timestamp_seconds, |
| 246 gfx::Point tap_viewport_offset, | 247 gfx::Point tap_viewport_offset, |
| 247 bool is_long_press); | 248 bool is_long_press); |
| 248 void set_ime_adapter(ImeAdapterAndroid* ime_adapter) { | 249 void set_ime_adapter(ImeAdapterAndroid* ime_adapter) { |
| 249 ime_adapter_android_ = ime_adapter; | 250 ime_adapter_android_ = ime_adapter; |
| 250 } | 251 } |
| 251 void set_selection_popup_controller(SelectionPopupController* controller) { | 252 void set_selection_popup_controller(SelectionPopupController* controller) { |
| 252 selection_popup_controller_ = controller; | 253 selection_popup_controller_ = controller; |
| 253 } | 254 } |
| 254 | 255 |
| 255 base::WeakPtr<RenderWidgetHostViewAndroid> GetWeakPtrAndroid(); | 256 base::WeakPtr<RenderWidgetHostViewAndroid> GetWeakPtrAndroid(); |
| 256 | 257 |
| 257 bool OnTouchEvent(const ui::MotionEvent& event); | 258 bool OnTouchEvent(const ui::MotionEvent& event); |
| 258 bool OnTouchHandleEvent(const ui::MotionEvent& event); | 259 bool OnTouchHandleEvent(const ui::MotionEvent& event); |
| 259 int GetTouchHandleHeight(); | 260 int GetTouchHandleHeight(); |
| 260 void ResetGestureDetection(); | 261 void ResetGestureDetection(); |
| 261 void SetDoubleTapSupportEnabled(bool enabled); | 262 void SetDoubleTapSupportEnabled(bool enabled); |
| 262 void SetMultiTouchZoomSupportEnabled(bool enabled); | 263 void SetMultiTouchZoomSupportEnabled(bool enabled); |
| 263 | 264 |
| 264 void WasResized(); | 265 void WasResized(); |
| 265 | 266 |
| 267 void OnFullscreenStateChanged(bool entered_fullscreen) override; | |
|
Khushal
2017/06/15 18:42:55
nit: Put this with the rest of the RWHV overrides.
steimel
2017/06/15 21:46:38
Done.
| |
| 268 | |
| 266 bool HasValidFrame() const; | 269 bool HasValidFrame() const; |
| 267 | 270 |
| 268 void MoveCaret(const gfx::Point& point); | 271 void MoveCaret(const gfx::Point& point); |
| 269 void ShowContextMenuAtPoint(const gfx::Point& point, ui::MenuSourceType); | 272 void ShowContextMenuAtPoint(const gfx::Point& point, ui::MenuSourceType); |
| 270 void DismissTextHandles(); | 273 void DismissTextHandles(); |
| 271 void SetTextHandlesTemporarilyHidden(bool hidden); | 274 void SetTextHandlesTemporarilyHidden(bool hidden); |
| 272 void OnShowUnhandledTapUIIfNeeded(int x_dip, int y_dip); | 275 void OnShowUnhandledTapUIIfNeeded(int x_dip, int y_dip); |
| 273 void OnSelectWordAroundCaretAck(bool did_select, | 276 void OnSelectWordAroundCaretAck(bool did_select, |
| 274 int start_adjust, | 277 int start_adjust, |
| 275 int end_adjust); | 278 int end_adjust); |
| (...skipping 21 matching lines...) Expand all Loading... | |
| 297 RenderWidgetHostViewBase* updated_view) override; | 300 RenderWidgetHostViewBase* updated_view) override; |
| 298 void OnTextSelectionChanged(TextInputManager* text_input_manager, | 301 void OnTextSelectionChanged(TextInputManager* text_input_manager, |
| 299 RenderWidgetHostViewBase* updated_view) override; | 302 RenderWidgetHostViewBase* updated_view) override; |
| 300 | 303 |
| 301 ImeAdapterAndroid* ime_adapter_for_testing() { return ime_adapter_android_; } | 304 ImeAdapterAndroid* ime_adapter_for_testing() { return ime_adapter_android_; } |
| 302 | 305 |
| 303 // Exposed for tests. | 306 // Exposed for tests. |
| 304 cc::SurfaceId SurfaceIdForTesting() const override; | 307 cc::SurfaceId SurfaceIdForTesting() const override; |
| 305 | 308 |
| 306 private: | 309 private: |
| 310 enum class FullscreenState { | |
| 311 kNotFullscreen, | |
| 312 kEnteringFullscreen, | |
| 313 kFullscreen, | |
| 314 kExitingFullscreen, | |
| 315 kFullscreenRotation, | |
|
mlamouri (slow - plz ping)
2017/06/15 13:23:41
Do we not care about rotation when not in fullscre
Khushal
2017/06/15 18:42:55
In those case we just use the frame we have and us
| |
| 316 }; | |
| 317 | |
| 307 void RunAckCallbacks(); | 318 void RunAckCallbacks(); |
| 308 | 319 |
| 309 void SendReclaimCompositorResources(bool is_swap_ack); | 320 void SendReclaimCompositorResources(bool is_swap_ack); |
| 310 | 321 |
| 311 void OnFrameMetadataUpdated(const cc::CompositorFrameMetadata& frame_metadata, | 322 void OnFrameMetadataUpdated(const cc::CompositorFrameMetadata& frame_metadata, |
| 312 bool is_transparent); | 323 bool is_transparent); |
| 313 | 324 |
| 314 void ShowInternal(); | 325 void ShowInternal(); |
| 315 void HideInternal(); | 326 void HideInternal(); |
| 316 void AttachLayers(); | 327 void AttachLayers(); |
| (...skipping 25 matching lines...) Expand all Loading... | |
| 342 void RequestDisallowInterceptTouchEvent(); | 353 void RequestDisallowInterceptTouchEvent(); |
| 343 | 354 |
| 344 bool SyncCompositorOnMessageReceived(const IPC::Message& message); | 355 bool SyncCompositorOnMessageReceived(const IPC::Message& message); |
| 345 | 356 |
| 346 void ComputeEventLatencyOSTouchHistograms(const ui::MotionEvent& event); | 357 void ComputeEventLatencyOSTouchHistograms(const ui::MotionEvent& event); |
| 347 | 358 |
| 348 void CreateOverscrollControllerIfPossible(); | 359 void CreateOverscrollControllerIfPossible(); |
| 349 | 360 |
| 350 WebContentsAccessibilityAndroid* GetWebContentsAccessibilityAndroid() const; | 361 WebContentsAccessibilityAndroid* GetWebContentsAccessibilityAndroid() const; |
| 351 | 362 |
| 363 void UpdateFullscreenState(bool physical_backing_resized); | |
| 364 | |
| 352 // The model object. | 365 // The model object. |
| 353 RenderWidgetHostImpl* host_; | 366 RenderWidgetHostImpl* host_; |
| 354 | 367 |
| 355 // The begin frame source being observed. Null if none. | 368 // The begin frame source being observed. Null if none. |
| 356 cc::BeginFrameSource* begin_frame_source_; | 369 cc::BeginFrameSource* begin_frame_source_; |
| 357 cc::BeginFrameArgs last_begin_frame_args_; | 370 cc::BeginFrameArgs last_begin_frame_args_; |
| 358 uint32_t latest_confirmed_begin_frame_source_id_; | 371 uint32_t latest_confirmed_begin_frame_source_id_; |
| 359 uint64_t latest_confirmed_begin_frame_sequence_number_; | 372 uint64_t latest_confirmed_begin_frame_sequence_number_; |
| 360 | 373 |
| 361 // Indicates whether and for what reason a request for begin frames has been | 374 // 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_; | 434 std::unique_ptr<viz::FrameEvictor> frame_evictor_; |
| 422 | 435 |
| 423 bool observing_root_window_; | 436 bool observing_root_window_; |
| 424 | 437 |
| 425 // The last scroll offset of the view. | 438 // The last scroll offset of the view. |
| 426 gfx::Vector2dF last_scroll_offset_; | 439 gfx::Vector2dF last_scroll_offset_; |
| 427 | 440 |
| 428 float prev_top_shown_pix_; | 441 float prev_top_shown_pix_; |
| 429 float prev_bottom_shown_pix_; | 442 float prev_bottom_shown_pix_; |
| 430 | 443 |
| 444 FullscreenState fullscreen_state_ = FullscreenState::kNotFullscreen; | |
| 445 | |
| 446 // While we could simply take a mismatch in fullscreen states as the trigger | |
| 447 // for a transition, and assume the transition to have finished once the | |
| 448 // fullscreen states and sizes match, we have cases where we reach this | |
| 449 // consistent state before the physical backing size changes. Therefore we | |
| 450 // defer assuming the transition to be completed until a resize event is | |
| 451 // received, which is marked by |fullscreen_transition_awaiting_resize_|. | |
| 452 // | |
| 453 // Note that this assumes that every transition will be followed by a change | |
| 454 // in the view's physical backing size. | |
| 455 bool fullscreen_transition_awaiting_resize_ = false; | |
| 456 bool current_frame_is_fullscreen_ = false; | |
| 457 bool web_contents_is_fullscreen_ = false; | |
| 458 | |
| 431 cc::mojom::MojoCompositorFrameSinkClient* renderer_compositor_frame_sink_ = | 459 cc::mojom::MojoCompositorFrameSinkClient* renderer_compositor_frame_sink_ = |
| 432 nullptr; | 460 nullptr; |
| 433 | 461 |
| 434 base::ObserverList<DestructionObserver> destruction_observers_; | 462 base::ObserverList<DestructionObserver> destruction_observers_; |
| 435 | 463 |
| 436 MouseWheelPhaseHandler mouse_wheel_phase_handler_; | 464 MouseWheelPhaseHandler mouse_wheel_phase_handler_; |
| 437 | 465 |
| 438 base::WeakPtrFactory<RenderWidgetHostViewAndroid> weak_ptr_factory_; | 466 base::WeakPtrFactory<RenderWidgetHostViewAndroid> weak_ptr_factory_; |
| 439 | 467 |
| 440 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostViewAndroid); | 468 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostViewAndroid); |
| 441 }; | 469 }; |
| 442 | 470 |
| 443 } // namespace content | 471 } // namespace content |
| 444 | 472 |
| 445 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_ANDROID_H_ | 473 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_ANDROID_H_ |
| OLD | NEW |