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_BASE_H_ | 5 #ifndef CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_BASE_H_ |
| 6 #define CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_BASE_H_ | 6 #define CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_BASE_H_ |
| 7 | 7 |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 #include <stdint.h> | 9 #include <stdint.h> |
| 10 | 10 |
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 90 | 90 |
| 91 // Returns the focused RenderWidgetHost inside this |view|'s RWH. | 91 // Returns the focused RenderWidgetHost inside this |view|'s RWH. |
| 92 RenderWidgetHostImpl* GetFocusedWidget() const; | 92 RenderWidgetHostImpl* GetFocusedWidget() const; |
| 93 | 93 |
| 94 // RenderWidgetHostView implementation. | 94 // RenderWidgetHostView implementation. |
| 95 RenderWidgetHost* GetRenderWidgetHost() const override; | 95 RenderWidgetHost* GetRenderWidgetHost() const override; |
| 96 void SetBackgroundColorToDefault() final; | 96 void SetBackgroundColorToDefault() final; |
| 97 ui::TextInputClient* GetTextInputClient() override; | 97 ui::TextInputClient* GetTextInputClient() override; |
| 98 void WasUnOccluded() override {} | 98 void WasUnOccluded() override {} |
| 99 void WasOccluded() override {} | 99 void WasOccluded() override {} |
| 100 bool IsShowingContextMenu() const override; | |
| 101 void SetShowingContextMenu(bool showing_menu) override; | |
| 102 void SetIsInVR(bool is_in_vr) override; | 100 void SetIsInVR(bool is_in_vr) override; |
| 103 base::string16 GetSelectedText() override; | 101 base::string16 GetSelectedText() override; |
| 104 bool IsMouseLocked() override; | 102 bool IsMouseLocked() override; |
| 105 gfx::Size GetVisibleViewportSize() const override; | 103 gfx::Size GetVisibleViewportSize() const override; |
| 106 void SetInsets(const gfx::Insets& insets) override; | 104 void SetInsets(const gfx::Insets& insets) override; |
| 107 bool IsSurfaceAvailableForCopy() const override; | 105 bool IsSurfaceAvailableForCopy() const override; |
| 108 void CopyFromSurface(const gfx::Rect& src_rect, | 106 void CopyFromSurface(const gfx::Rect& src_rect, |
| 109 const gfx::Size& output_size, | 107 const gfx::Size& output_size, |
| 110 const ReadbackRequestCallback& callback, | 108 const ReadbackRequestCallback& callback, |
| 111 const SkColorType color_type) override; | 109 const SkColorType color_type) override; |
| (...skipping 277 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 389 | 387 |
| 390 // Called by the RenderWidgetHost when an ambiguous gesture is detected to | 388 // Called by the RenderWidgetHost when an ambiguous gesture is detected to |
| 391 // show the disambiguation popup bubble. | 389 // show the disambiguation popup bubble. |
| 392 virtual void ShowDisambiguationPopup(const gfx::Rect& rect_pixels, | 390 virtual void ShowDisambiguationPopup(const gfx::Rect& rect_pixels, |
| 393 const SkBitmap& zoomed_bitmap); | 391 const SkBitmap& zoomed_bitmap); |
| 394 | 392 |
| 395 // Called by the WebContentsImpl when a user tries to navigate a new page on | 393 // Called by the WebContentsImpl when a user tries to navigate a new page on |
| 396 // main frame. | 394 // main frame. |
| 397 virtual void OnDidNavigateMainFrameToNewPage(); | 395 virtual void OnDidNavigateMainFrameToNewPage(); |
| 398 | 396 |
| 397 // Called by WebContensImpl to notify the view about a change in visibility of | |
|
kenrb
2017/06/05 17:39:16
nit: WebContentsImpl
EhsanK
2017/06/06 12:34:46
Done.
| |
| 398 // context menu. The view can then perform platform specific tasks and | |
| 399 // changes. | |
| 400 virtual void SetShowingContextMenu(bool showing) {} | |
| 401 | |
| 399 // Add and remove observers for lifetime event notifications. The order in | 402 // Add and remove observers for lifetime event notifications. The order in |
| 400 // which notifications are sent to observers is undefined. Clients must be | 403 // which notifications are sent to observers is undefined. Clients must be |
| 401 // sure to remove the observer before they go away. | 404 // sure to remove the observer before they go away. |
| 402 void AddObserver(RenderWidgetHostViewBaseObserver* observer); | 405 void AddObserver(RenderWidgetHostViewBaseObserver* observer); |
| 403 void RemoveObserver(RenderWidgetHostViewBaseObserver* observer); | 406 void RemoveObserver(RenderWidgetHostViewBaseObserver* observer); |
| 404 | 407 |
| 405 // Returns a reference to the current instance of TextInputManager. The | 408 // Returns a reference to the current instance of TextInputManager. The |
| 406 // reference is obtained from RenderWidgetHostDelegate. The first time a non- | 409 // reference is obtained from RenderWidgetHostDelegate. The first time a non- |
| 407 // null reference is obtained, its value is cached in |text_input_manager_| | 410 // null reference is obtained, its value is cached in |text_input_manager_| |
| 408 // and this view is registered with it. The RWHV will unregister from the | 411 // and this view is registered with it. The RWHV will unregister from the |
| (...skipping 28 matching lines...) Expand all Loading... | |
| 437 // autofill...). | 440 // autofill...). |
| 438 blink::WebPopupType popup_type_; | 441 blink::WebPopupType popup_type_; |
| 439 | 442 |
| 440 // While the mouse is locked, the cursor is hidden from the user. Mouse events | 443 // While the mouse is locked, the cursor is hidden from the user. Mouse events |
| 441 // are still generated. However, the position they report is the last known | 444 // are still generated. However, the position they report is the last known |
| 442 // mouse position just as mouse lock was entered; the movement they report | 445 // mouse position just as mouse lock was entered; the movement they report |
| 443 // indicates what the change in position of the mouse would be had it not been | 446 // indicates what the change in position of the mouse would be had it not been |
| 444 // locked. | 447 // locked. |
| 445 bool mouse_locked_; | 448 bool mouse_locked_; |
| 446 | 449 |
| 447 // Whether we are showing a context menu. | |
| 448 bool showing_context_menu_; | |
| 449 | |
| 450 // The scale factor of the display the renderer is currently on. | 450 // The scale factor of the display the renderer is currently on. |
| 451 float current_device_scale_factor_; | 451 float current_device_scale_factor_; |
| 452 | 452 |
| 453 // The orientation of the display the renderer is currently on. | 453 // The orientation of the display the renderer is currently on. |
| 454 display::Display::Rotation current_display_rotation_; | 454 display::Display::Rotation current_display_rotation_; |
| 455 | 455 |
| 456 // A reference to current TextInputManager instance this RWHV is registered | 456 // A reference to current TextInputManager instance this RWHV is registered |
| 457 // with. This is initially nullptr until the first time the view calls | 457 // with. This is initially nullptr until the first time the view calls |
| 458 // GetTextInputManager(). It also becomes nullptr when TextInputManager is | 458 // GetTextInputManager(). It also becomes nullptr when TextInputManager is |
| 459 // destroyed before the RWHV is destroyed. | 459 // destroyed before the RWHV is destroyed. |
| 460 TextInputManager* text_input_manager_; | 460 TextInputManager* text_input_manager_; |
| 461 | 461 |
| 462 const bool wheel_scroll_latching_enabled_; | 462 const bool wheel_scroll_latching_enabled_; |
| 463 | 463 |
| 464 private: | 464 private: |
| 465 gfx::Rect current_display_area_; | 465 gfx::Rect current_display_area_; |
| 466 | 466 |
| 467 uint32_t renderer_frame_number_; | 467 uint32_t renderer_frame_number_; |
| 468 | 468 |
| 469 base::ObserverList<RenderWidgetHostViewBaseObserver> observers_; | 469 base::ObserverList<RenderWidgetHostViewBaseObserver> observers_; |
| 470 | 470 |
| 471 base::WeakPtrFactory<RenderWidgetHostViewBase> weak_factory_; | 471 base::WeakPtrFactory<RenderWidgetHostViewBase> weak_factory_; |
| 472 | 472 |
| 473 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostViewBase); | 473 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostViewBase); |
| 474 }; | 474 }; |
| 475 | 475 |
| 476 } // namespace content | 476 } // namespace content |
| 477 | 477 |
| 478 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_BASE_H_ | 478 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_BASE_H_ |
| OLD | NEW |