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_PUBLIC_BROWSER_RENDER_WIDGET_HOST_VIEW_H_ | 5 #ifndef CONTENT_PUBLIC_BROWSER_RENDER_WIDGET_HOST_VIEW_H_ |
| 6 #define CONTENT_PUBLIC_BROWSER_RENDER_WIDGET_HOST_VIEW_H_ | 6 #define CONTENT_PUBLIC_BROWSER_RENDER_WIDGET_HOST_VIEW_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 | 9 |
| 10 #include "base/strings/string16.h" | 10 #include "base/strings/string16.h" |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 47 virtual ~RenderWidgetHostView() {} | 47 virtual ~RenderWidgetHostView() {} |
| 48 | 48 |
| 49 // Initialize this object for use as a drawing area. |parent_view| may be | 49 // Initialize this object for use as a drawing area. |parent_view| may be |
| 50 // left as nullptr on platforms where a parent view is not required to | 50 // left as nullptr on platforms where a parent view is not required to |
| 51 // initialize a child window. | 51 // initialize a child window. |
| 52 virtual void InitAsChild(gfx::NativeView parent_view) = 0; | 52 virtual void InitAsChild(gfx::NativeView parent_view) = 0; |
| 53 | 53 |
| 54 // Returns the associated RenderWidgetHost. | 54 // Returns the associated RenderWidgetHost. |
| 55 virtual RenderWidgetHost* GetRenderWidgetHost() const = 0; | 55 virtual RenderWidgetHost* GetRenderWidgetHost() const = 0; |
| 56 | 56 |
| 57 // Tells the View to size itself to the specified size. | 57 // Tells the View to size itself, or its top-level window (impl-dependent), to |
| 58 // the specified size in screen coordinates. Note that this will not take | |
| 59 // effect permanently if this View's native view is being managed by the auto- | |
| 60 // layout heuristics of the native UI toolkit. | |
| 58 virtual void SetSize(const gfx::Size& size) = 0; | 61 virtual void SetSize(const gfx::Size& size) = 0; |
| 59 | 62 |
| 60 // Tells the View to size and move itself to the specified size and point in | |
| 61 // screen space. | |
| 62 virtual void SetBounds(const gfx::Rect& rect) = 0; | |
| 63 | |
| 64 // Retrieves the last known scroll position. | 63 // Retrieves the last known scroll position. |
| 65 virtual gfx::Vector2dF GetLastScrollOffset() const = 0; | 64 virtual gfx::Vector2dF GetLastScrollOffset() const = 0; |
| 66 | 65 |
| 67 // Sets a flag that indicates if it is in virtual reality mode. | 66 // Sets a flag that indicates if it is in virtual reality mode. |
| 68 virtual void SetIsInVR(bool is_in_vr) = 0; | 67 virtual void SetIsInVR(bool is_in_vr) = 0; |
| 69 | 68 |
| 70 // Coordinate points received from a renderer process need to be transformed | 69 // Coordinate points received from a renderer process need to be transformed |
| 71 // to the top-level frame's coordinate space. For coordinates received from | 70 // to the top-level frame's coordinate space. For coordinates received from |
| 72 // the top-level frame's renderer this is a no-op as they are already | 71 // the top-level frame's renderer this is a no-op as they are already |
| 73 // properly transformed; however, coordinates received from an out-of-process | 72 // properly transformed; however, coordinates received from an out-of-process |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 108 virtual bool IsShowing() = 0; | 107 virtual bool IsShowing() = 0; |
| 109 | 108 |
| 110 // Indicates if the view is currently occluded (e.g, not visible because it's | 109 // Indicates if the view is currently occluded (e.g, not visible because it's |
| 111 // covered up by other windows), and as a result the view's renderer may be | 110 // covered up by other windows), and as a result the view's renderer may be |
| 112 // suspended. If Show() is called on a view then its state should be re-set to | 111 // suspended. If Show() is called on a view then its state should be re-set to |
| 113 // being un-occluded (an explicit WasUnOccluded call will not be made for | 112 // being un-occluded (an explicit WasUnOccluded call will not be made for |
| 114 // that). These calls are not necessarily made in pairs. | 113 // that). These calls are not necessarily made in pairs. |
| 115 virtual void WasUnOccluded() = 0; | 114 virtual void WasUnOccluded() = 0; |
| 116 virtual void WasOccluded() = 0; | 115 virtual void WasOccluded() = 0; |
| 117 | 116 |
| 118 // Retrieve the bounds of the View, in screen coordinates. | 117 // Retrieves the bounds of the View, in screen coordinates. Note that this |
| 118 // reflects the region the view occupies on-screen, accounting for any scaling | |
| 119 // performed on the native view by the platform or UI toolkit. Callers should | |
| 120 // NOT assume the size of this region is equal to to the View's actual | |
| 121 // rendering size, and NOT assume a device scale factor will resolve this | |
|
Nico
2017/02/17 22:05:11
I have a hard time understanding this comment. May
miu
2017/02/17 23:50:59
Example on Mac: The RWHV's native view (NSView) wi
| |
| 122 // discrepancy. | |
|
ncarter (slow)
2017/02/15 23:35:02
How does this differ from (or relate to) GetVisibl
miu
2017/02/16 00:07:07
Took a look. It seems that there is Ash UI code as
| |
| 123 // | |
| 124 // TODO(miu): Provide a GetRenderingSize() method for use cases that need the | |
| 125 // actual DIP rendering size. http://crbug.com/73362 | |
| 119 virtual gfx::Rect GetViewBounds() const = 0; | 126 virtual gfx::Rect GetViewBounds() const = 0; |
| 120 | 127 |
| 121 // Returns true if the View's context menu is showing. | 128 // Returns true if the View's context menu is showing. |
| 122 virtual bool IsShowingContextMenu() const = 0; | 129 virtual bool IsShowingContextMenu() const = 0; |
| 123 | 130 |
| 124 // Tells the View whether the context menu is showing. | 131 // Tells the View whether the context menu is showing. |
| 125 virtual void SetShowingContextMenu(bool showing) = 0; | 132 virtual void SetShowingContextMenu(bool showing) = 0; |
| 126 | 133 |
| 127 // Returns the currently selected text. | 134 // Returns the currently selected text. |
| 128 virtual base::string16 GetSelectedText() = 0; | 135 virtual base::string16 GetSelectedText() = 0; |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 192 // Returns |true| if text is currently being spoken by Mac OS X. | 199 // Returns |true| if text is currently being spoken by Mac OS X. |
| 193 virtual bool IsSpeaking() const = 0; | 200 virtual bool IsSpeaking() const = 0; |
| 194 // Stops speaking, if it is currently in progress. | 201 // Stops speaking, if it is currently in progress. |
| 195 virtual void StopSpeaking() = 0; | 202 virtual void StopSpeaking() = 0; |
| 196 #endif // defined(OS_MACOSX) | 203 #endif // defined(OS_MACOSX) |
| 197 }; | 204 }; |
| 198 | 205 |
| 199 } // namespace content | 206 } // namespace content |
| 200 | 207 |
| 201 #endif // CONTENT_PUBLIC_BROWSER_RENDER_WIDGET_HOST_VIEW_H_ | 208 #endif // CONTENT_PUBLIC_BROWSER_RENDER_WIDGET_HOST_VIEW_H_ |
| OLD | NEW |