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 "base/basictypes.h" | 8 #include "base/basictypes.h" |
| 9 #include "base/memory/scoped_ptr.h" |
9 #include "base/strings/string16.h" | 10 #include "base/strings/string16.h" |
10 #include "content/common/content_export.h" | 11 #include "content/common/content_export.h" |
11 #include "third_party/skia/include/core/SkBitmap.h" | 12 #include "third_party/skia/include/core/SkBitmap.h" |
12 #include "third_party/skia/include/core/SkRegion.h" | 13 #include "third_party/skia/include/core/SkRegion.h" |
13 #include "third_party/WebKit/public/web/WebInputEvent.h" | 14 #include "third_party/WebKit/public/web/WebInputEvent.h" |
14 #include "ui/gfx/native_widget_types.h" | 15 #include "ui/gfx/native_widget_types.h" |
15 | 16 |
16 class GURL; | 17 class GURL; |
17 | 18 |
18 namespace gfx { | 19 namespace gfx { |
19 class Rect; | 20 class Rect; |
20 class Size; | 21 class Size; |
21 } | 22 } |
22 | 23 |
23 namespace content { | 24 namespace content { |
24 | 25 |
25 class RenderWidgetHost; | 26 class RenderWidgetHost; |
| 27 class RenderWidgetHostViewFrameSubscriber; |
26 | 28 |
27 // RenderWidgetHostView is an interface implemented by an object that acts as | 29 // RenderWidgetHostView is an interface implemented by an object that acts as |
28 // the "View" portion of a RenderWidgetHost. The RenderWidgetHost and its | 30 // the "View" portion of a RenderWidgetHost. The RenderWidgetHost and its |
29 // associated RenderProcessHost own the "Model" in this case which is the | 31 // associated RenderProcessHost own the "Model" in this case which is the |
30 // child renderer process. The View is responsible for receiving events from | 32 // child renderer process. The View is responsible for receiving events from |
31 // the surrounding environment and passing them to the RenderWidgetHost, and | 33 // the surrounding environment and passing them to the RenderWidgetHost, and |
32 // for actually displaying the content of the RenderWidgetHost when it | 34 // for actually displaying the content of the RenderWidgetHost when it |
33 // changes. | 35 // changes. |
34 // | 36 // |
35 // RenderWidgetHostView Class Hierarchy: | 37 // RenderWidgetHostView Class Hierarchy: |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
101 | 103 |
102 // Retrives the size of the viewport for the visible region. May be smaller | 104 // Retrives the size of the viewport for the visible region. May be smaller |
103 // than the view size if a portion of the view is obstructed (e.g. by a | 105 // than the view size if a portion of the view is obstructed (e.g. by a |
104 // virtual keyboard). | 106 // virtual keyboard). |
105 virtual gfx::Size GetVisibleViewportSize() const = 0; | 107 virtual gfx::Size GetVisibleViewportSize() const = 0; |
106 | 108 |
107 // Set insets for the visible region of the root window. Used to compute the | 109 // Set insets for the visible region of the root window. Used to compute the |
108 // visible viewport. | 110 // visible viewport. |
109 virtual void SetInsets(const gfx::Insets& insets) = 0; | 111 virtual void SetInsets(const gfx::Insets& insets) = 0; |
110 | 112 |
| 113 // Begin subscribing for presentation events and captured frames. |
| 114 // |subscriber| is now owned by this object, it will be called only on the |
| 115 // UI thread. |
| 116 virtual void BeginFrameSubscription( |
| 117 scoped_ptr<RenderWidgetHostViewFrameSubscriber> subscriber) = 0; |
| 118 |
| 119 // End subscribing for frame presentation events. FrameSubscriber will be |
| 120 // deleted after this call. |
| 121 virtual void EndFrameSubscription() = 0; |
| 122 |
111 #if defined(OS_MACOSX) | 123 #if defined(OS_MACOSX) |
112 // Set the view's active state (i.e., tint state of controls). | 124 // Set the view's active state (i.e., tint state of controls). |
113 virtual void SetActive(bool active) = 0; | 125 virtual void SetActive(bool active) = 0; |
114 | 126 |
115 // Tells the view whether or not to accept first responder status. If |flag| | 127 // Tells the view whether or not to accept first responder status. If |flag| |
116 // is true, the view does not accept first responder status and instead | 128 // is true, the view does not accept first responder status and instead |
117 // manually becomes first responder when it receives a mouse down event. If | 129 // manually becomes first responder when it receives a mouse down event. If |
118 // |flag| is false, the view participates in the key-view chain as normal. | 130 // |flag| is false, the view participates in the key-view chain as normal. |
119 virtual void SetTakesFocusOnlyOnMouseDown(bool flag) = 0; | 131 virtual void SetTakesFocusOnlyOnMouseDown(bool flag) = 0; |
120 | 132 |
(...skipping 18 matching lines...) Expand all Loading... |
139 // Returns |true| if text is currently being spoken by Mac OS X. | 151 // Returns |true| if text is currently being spoken by Mac OS X. |
140 virtual bool IsSpeaking() const = 0; | 152 virtual bool IsSpeaking() const = 0; |
141 // Stops speaking, if it is currently in progress. | 153 // Stops speaking, if it is currently in progress. |
142 virtual void StopSpeaking() = 0; | 154 virtual void StopSpeaking() = 0; |
143 #endif // defined(OS_MACOSX) | 155 #endif // defined(OS_MACOSX) |
144 }; | 156 }; |
145 | 157 |
146 } // namespace content | 158 } // namespace content |
147 | 159 |
148 #endif // CONTENT_PUBLIC_BROWSER_RENDER_WIDGET_HOST_VIEW_H_ | 160 #endif // CONTENT_PUBLIC_BROWSER_RENDER_WIDGET_HOST_VIEW_H_ |
OLD | NEW |