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_RENDERER_RENDER_VIEW_IMPL_H_ | 5 #ifndef CONTENT_RENDERER_RENDER_VIEW_IMPL_H_ |
6 #define CONTENT_RENDERER_RENDER_VIEW_IMPL_H_ | 6 #define CONTENT_RENDERER_RENDER_VIEW_IMPL_H_ |
7 | 7 |
8 #include <deque> | |
9 #include <map> | |
10 #include <set> | 8 #include <set> |
11 #include <string> | |
12 #include <vector> | |
scottmg
2012/10/19 19:46:35
yikes
| |
13 | 9 |
14 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
15 #include "base/gtest_prod_util.h" | 11 #include "base/gtest_prod_util.h" |
16 #include "base/id_map.h" | 12 #include "base/id_map.h" |
17 #include "base/memory/linked_ptr.h" | 13 #include "base/memory/linked_ptr.h" |
18 #include "base/memory/weak_ptr.h" | 14 #include "base/memory/weak_ptr.h" |
19 #include "base/observer_list.h" | 15 #include "base/observer_list.h" |
20 #include "base/timer.h" | 16 #include "base/timer.h" |
21 #include "base/values.h" | 17 #include "base/values.h" |
22 #include "build/build_config.h" | 18 #include "build/build_config.h" |
(...skipping 16 matching lines...) Expand all Loading... | |
39 #include "third_party/WebKit/Source/WebKit/chromium/public/WebConsoleMessage.h" | 35 #include "third_party/WebKit/Source/WebKit/chromium/public/WebConsoleMessage.h" |
40 #include "third_party/WebKit/Source/WebKit/chromium/public/WebFrameClient.h" | 36 #include "third_party/WebKit/Source/WebKit/chromium/public/WebFrameClient.h" |
41 #include "third_party/WebKit/Source/WebKit/chromium/public/WebHistoryItem.h" | 37 #include "third_party/WebKit/Source/WebKit/chromium/public/WebHistoryItem.h" |
42 #include "third_party/WebKit/Source/WebKit/chromium/public/WebIconURL.h" | 38 #include "third_party/WebKit/Source/WebKit/chromium/public/WebIconURL.h" |
43 #include "third_party/WebKit/Source/WebKit/chromium/public/WebInputEvent.h" | 39 #include "third_party/WebKit/Source/WebKit/chromium/public/WebInputEvent.h" |
44 #include "third_party/WebKit/Source/WebKit/chromium/public/WebNavigationType.h" | 40 #include "third_party/WebKit/Source/WebKit/chromium/public/WebNavigationType.h" |
45 #include "third_party/WebKit/Source/WebKit/chromium/public/WebNode.h" | 41 #include "third_party/WebKit/Source/WebKit/chromium/public/WebNode.h" |
46 #include "third_party/WebKit/Source/WebKit/chromium/public/WebPageSerializerClie nt.h" | 42 #include "third_party/WebKit/Source/WebKit/chromium/public/WebPageSerializerClie nt.h" |
47 #include "third_party/WebKit/Source/WebKit/chromium/public/WebPageVisibilityStat e.h" | 43 #include "third_party/WebKit/Source/WebKit/chromium/public/WebPageVisibilityStat e.h" |
48 #include "third_party/WebKit/Source/WebKit/chromium/public/WebSecurityOrigin.h" | 44 #include "third_party/WebKit/Source/WebKit/chromium/public/WebSecurityOrigin.h" |
49 #include "third_party/WebKit/Source/WebKit/chromium/public/WebTextDirection.h" | |
50 #include "third_party/WebKit/Source/WebKit/chromium/public/WebViewClient.h" | 45 #include "third_party/WebKit/Source/WebKit/chromium/public/WebViewClient.h" |
51 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebFileSyste m.h" | 46 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebFileSyste m.h" |
52 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebGraphicsC ontext3D.h" | 47 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebGraphicsC ontext3D.h" |
53 #include "ui/surface/transport_dib.h" | 48 #include "ui/surface/transport_dib.h" |
54 #include "webkit/glue/webpreferences.h" | 49 #include "webkit/glue/webpreferences.h" |
55 #include "webkit/media/webmediaplayer_delegate.h" | 50 #include "webkit/media/webmediaplayer_delegate.h" |
56 #include "webkit/plugins/npapi/webplugin_page_delegate.h" | 51 #include "webkit/plugins/npapi/webplugin_page_delegate.h" |
57 | 52 |
58 #if defined(OS_ANDROID) | 53 #if defined(OS_ANDROID) |
59 #include "content/renderer/android/content_detector.h" | 54 #include "content/renderer/android/content_detector.h" |
60 #include "third_party/WebKit/Source/WebKit/chromium/public/WebContentDetectionRe sult.h" | 55 #include "third_party/WebKit/Source/WebKit/chromium/public/WebContentDetectionRe sult.h" |
61 #endif | 56 #endif |
62 | 57 |
63 #if defined(COMPILER_MSVC) | 58 #if defined(COMPILER_MSVC) |
64 // RenderViewImpl is a diamond-shaped hierarchy, with WebWidgetClient at the | 59 // RenderViewImpl is a diamond-shaped hierarchy, with WebWidgetClient at the |
65 // root. VS warns when we inherit the WebWidgetClient method implementations | 60 // root. VS warns when we inherit the WebWidgetClient method implementations |
66 // from RenderWidget. It's safe to ignore that warning. | 61 // from RenderWidget. It's safe to ignore that warning. |
67 #pragma warning(disable: 4250) | 62 #pragma warning(disable: 4250) |
68 #endif | 63 #endif |
69 | 64 |
70 class CommandLine; | 65 class CommandLine; |
71 class DeviceOrientationDispatcher; | |
72 class DevToolsAgent; | |
73 class DomAutomationController; | 66 class DomAutomationController; |
74 class ExternalPopupMenu; | |
75 class GeolocationDispatcher; | |
76 class GURL; | |
77 class JavaBridgeDispatcher; | 67 class JavaBridgeDispatcher; |
78 class LoadProgressTracker; | |
79 class MediaStreamDispatcher; | |
80 class MediaStreamImpl; | |
81 class MouseLockDispatcher; | |
82 class NotificationProvider; | |
83 class PepperDeviceTest; | 68 class PepperDeviceTest; |
69 class SkBitmap; | |
70 class WebUIBindings; | |
84 struct PP_NetAddress_Private; | 71 struct PP_NetAddress_Private; |
85 class RenderWidgetFullscreenPepper; | |
86 class RendererWebColorChooserImpl; | |
87 class SkBitmap; | |
88 class InputTagSpeechDispatcher; | |
89 class SpeechRecognitionDispatcher; | |
90 struct ViewMsg_Navigate_Params; | 72 struct ViewMsg_Navigate_Params; |
91 struct ViewMsg_PostMessage_Params; | 73 struct ViewMsg_PostMessage_Params; |
92 struct ViewMsg_StopFinding_Params; | 74 struct ViewMsg_StopFinding_Params; |
93 struct ViewMsg_SwapOut_Params; | 75 struct ViewMsg_SwapOut_Params; |
94 struct WebDropData; | 76 struct WebDropData; |
95 class WebIntentsHost; | |
96 class WebPluginDelegateProxy; | |
97 class WebUIBindings; | |
98 | |
99 namespace content { | |
100 class DocumentState; | |
101 class NavigationState; | |
102 class RenderViewObserver; | |
103 class RenderViewTest; | |
104 class RendererAccessibility; | |
105 class RendererPpapiHost; | |
106 #if defined(OS_ANDROID) | |
107 class WebMediaPlayerProxyImplAndroid; | |
108 #endif | |
109 struct CustomContextMenuContext; | |
110 struct FileChooserParams; | |
111 | |
112 namespace old { | |
113 class GuestToEmbedderChannel; | |
114 } | |
115 | |
116 } // namespace content | |
117 | |
118 namespace gfx { | |
119 class Point; | |
120 class Rect; | |
121 } // namespace gfx | |
122 | 77 |
123 namespace ui { | 78 namespace ui { |
124 struct SelectedFileInfo; | 79 struct SelectedFileInfo; |
125 } // namespace ui | 80 } // namespace ui |
126 | 81 |
127 namespace webkit { | 82 namespace webkit { |
128 | 83 |
129 namespace ppapi { | 84 namespace ppapi { |
130 class PluginInstance; | 85 class PluginInstance; |
131 class WebPluginImpl; | 86 class WebPluginImpl; |
(...skipping 15 matching lines...) Expand all Loading... | |
147 | 102 |
148 namespace WebKit { | 103 namespace WebKit { |
149 class WebApplicationCacheHost; | 104 class WebApplicationCacheHost; |
150 class WebApplicationCacheHostClient; | 105 class WebApplicationCacheHostClient; |
151 class WebCompositorOutputSurface; | 106 class WebCompositorOutputSurface; |
152 class WebDOMMessageEvent; | 107 class WebDOMMessageEvent; |
153 class WebDataSource; | 108 class WebDataSource; |
154 class WebDragData; | 109 class WebDragData; |
155 class WebGeolocationClient; | 110 class WebGeolocationClient; |
156 class WebGestureEvent; | 111 class WebGestureEvent; |
157 #if defined(OS_ANDROID) | |
158 class WebHitTestResult; | |
159 #endif | |
160 class WebIconURL; | 112 class WebIconURL; |
161 class WebImage; | 113 class WebImage; |
162 class WebPeerConnection00Handler; | 114 class WebPeerConnection00Handler; |
163 class WebPeerConnection00HandlerClient; | 115 class WebPeerConnection00HandlerClient; |
164 class WebMediaPlayer; | 116 class WebMediaPlayer; |
165 class WebMediaPlayerClient; | 117 class WebMediaPlayerClient; |
166 class WebMouseEvent; | 118 class WebMouseEvent; |
167 class WebPeerConnectionHandler; | 119 class WebPeerConnectionHandler; |
168 class WebPeerConnectionHandlerClient; | 120 class WebPeerConnectionHandlerClient; |
169 class WebSocketStreamHandle; | 121 class WebSocketStreamHandle; |
170 class WebSpeechInputController; | 122 class WebSpeechInputController; |
171 class WebSpeechInputListener; | 123 class WebSpeechInputListener; |
172 class WebSpeechRecognizer; | 124 class WebSpeechRecognizer; |
173 class WebStorageNamespace; | 125 class WebStorageNamespace; |
174 class WebTouchEvent; | 126 class WebTouchEvent; |
175 class WebURLRequest; | 127 class WebURLRequest; |
176 class WebUserMediaClient; | 128 class WebUserMediaClient; |
177 struct WebActiveWheelFlingParameters; | 129 struct WebActiveWheelFlingParameters; |
178 struct WebFileChooserParams; | 130 struct WebFileChooserParams; |
179 struct WebFindOptions; | 131 struct WebFindOptions; |
180 struct WebMediaPlayerAction; | 132 struct WebMediaPlayerAction; |
181 struct WebPluginAction; | 133 struct WebPluginAction; |
182 struct WebPoint; | 134 struct WebPoint; |
183 struct WebWindowFeatures; | 135 struct WebWindowFeatures; |
136 | |
137 #if defined(OS_ANDROID) | |
138 class WebHitTestResult; | |
139 #endif | |
140 } | |
141 | |
142 namespace content { | |
143 class DeviceOrientationDispatcher; | |
144 class DevToolsAgent; | |
145 class DocumentState; | |
146 class ExternalPopupMenu; | |
147 class GeolocationDispatcher; | |
148 class InputTagSpeechDispatcher; | |
149 class LoadProgressTracker; | |
150 class MediaStreamDispatcher; | |
151 class MediaStreamImpl; | |
152 class MouseLockDispatcher; | |
153 class NavigationState; | |
154 class NotificationProvider; | |
155 class RenderViewObserver; | |
156 class RenderViewTest; | |
157 class RendererAccessibility; | |
158 class RendererPpapiHost; | |
159 class RendererWebColorChooserImpl; | |
160 class RenderWidgetFullscreenPepper; | |
161 class SpeechRecognitionDispatcher; | |
162 class WebIntentsHost; | |
163 class WebPluginDelegateProxy; | |
164 struct CustomContextMenuContext; | |
165 struct FileChooserParams; | |
166 | |
167 #if defined(OS_ANDROID) | |
168 class WebMediaPlayerProxyImplAndroid; | |
169 #endif | |
170 | |
171 namespace old { | |
172 class GuestToEmbedderChannel; | |
184 } | 173 } |
185 | 174 |
186 // We need to prevent a page from trying to create infinite popups. It is not | 175 // We need to prevent a page from trying to create infinite popups. It is not |
187 // as simple as keeping a count of the number of immediate children | 176 // as simple as keeping a count of the number of immediate children |
188 // popups. Having an html file that window.open()s itself would create | 177 // popups. Having an html file that window.open()s itself would create |
189 // an unlimited chain of RenderViews who only have one RenderView child. | 178 // an unlimited chain of RenderViews who only have one RenderView child. |
190 // | 179 // |
191 // Therefore, each new top level RenderView creates a new counter and shares it | 180 // Therefore, each new top level RenderView creates a new counter and shares it |
192 // with all its children and grandchildren popup RenderViewImpls created with | 181 // with all its children and grandchildren popup RenderViewImpls created with |
193 // createView() to have a sort of global limit for the page so no more than | 182 // createView() to have a sort of global limit for the page so no more than |
194 // kMaximumNumberOfPopups popups are created. | 183 // kMaximumNumberOfPopups popups are created. |
195 // | 184 // |
196 // This is a RefCounted holder of an int because I can't say | 185 // This is a RefCounted holder of an int because I can't say |
197 // scoped_refptr<int>. | 186 // scoped_refptr<int>. |
198 typedef base::RefCountedData<int> SharedRenderViewCounter; | 187 typedef base::RefCountedData<int> SharedRenderViewCounter; |
199 | 188 |
200 // | 189 // |
201 // RenderView is an object that manages a WebView object, and provides a | 190 // RenderView is an object that manages a WebView object, and provides a |
202 // communication interface with an embedding application process | 191 // communication interface with an embedding application process |
203 // | 192 // |
204 class RenderViewImpl : public RenderWidget, | 193 class RenderViewImpl : public RenderWidget, |
205 public WebKit::WebViewClient, | 194 public WebKit::WebViewClient, |
206 public WebKit::WebFrameClient, | 195 public WebKit::WebFrameClient, |
207 public WebKit::WebPageSerializerClient, | 196 public WebKit::WebPageSerializerClient, |
208 public content::RenderView, | 197 public RenderView, |
209 public webkit::npapi::WebPluginPageDelegate, | 198 public webkit::npapi::WebPluginPageDelegate, |
210 public webkit_media::WebMediaPlayerDelegate, | 199 public webkit_media::WebMediaPlayerDelegate, |
211 public WebGraphicsContext3DSwapBuffersClient, | 200 public WebGraphicsContext3DSwapBuffersClient, |
212 public base::SupportsWeakPtr<RenderViewImpl> { | 201 public base::SupportsWeakPtr<RenderViewImpl> { |
213 public: | 202 public: |
214 // Creates a new RenderView. The parent_hwnd specifies a HWND to use as the | 203 // Creates a new RenderView. The parent_hwnd specifies a HWND to use as the |
215 // parent of the WebView HWND that will be created. If this is a blocked | 204 // parent of the WebView HWND that will be created. If this is a blocked |
216 // popup or as a new tab, opener_id is the routing ID of the RenderView | 205 // popup or as a new tab, opener_id is the routing ID of the RenderView |
217 // responsible for creating this RenderView (corresponding to parent_hwnd). | 206 // responsible for creating this RenderView (corresponding to parent_hwnd). |
218 // |counter| is either a currently initialized counter, or NULL (in which case | 207 // |counter| is either a currently initialized counter, or NULL (in which case |
219 // we treat this RenderView as a top level window). | 208 // we treat this RenderView as a top level window). |
220 CONTENT_EXPORT static RenderViewImpl* Create( | 209 CONTENT_EXPORT static RenderViewImpl* Create( |
221 gfx::NativeViewId parent_hwnd, | 210 gfx::NativeViewId parent_hwnd, |
222 int32 opener_id, | 211 int32 opener_id, |
223 const content::RendererPreferences& renderer_prefs, | 212 const RendererPreferences& renderer_prefs, |
224 const webkit_glue::WebPreferences& webkit_prefs, | 213 const webkit_glue::WebPreferences& webkit_prefs, |
225 SharedRenderViewCounter* counter, | 214 SharedRenderViewCounter* counter, |
226 int32 routing_id, | 215 int32 routing_id, |
227 int32 surface_id, | 216 int32 surface_id, |
228 int64 session_storage_namespace_id, | 217 int64 session_storage_namespace_id, |
229 const string16& frame_name, | 218 const string16& frame_name, |
230 bool is_renderer_created, | 219 bool is_renderer_created, |
231 bool swapped_out, | 220 bool swapped_out, |
232 int32 next_page_id, | 221 int32 next_page_id, |
233 const WebKit::WebScreenInfo& screen_info, | 222 const WebKit::WebScreenInfo& screen_info, |
234 content::old::GuestToEmbedderChannel* guest_to_embedder_channel, | 223 old::GuestToEmbedderChannel* guest_to_embedder_channel, |
235 AccessibilityMode accessibility_mode); | 224 AccessibilityMode accessibility_mode); |
236 | 225 |
237 // Returns the RenderViewImpl containing the given WebView. | 226 // Returns the RenderViewImpl containing the given WebView. |
238 CONTENT_EXPORT static RenderViewImpl* FromWebView(WebKit::WebView* webview); | 227 CONTENT_EXPORT static RenderViewImpl* FromWebView(WebKit::WebView* webview); |
239 | 228 |
240 // May return NULL when the view is closing. | 229 // May return NULL when the view is closing. |
241 CONTENT_EXPORT WebKit::WebView* webview() const; | 230 CONTENT_EXPORT WebKit::WebView* webview() const; |
242 | 231 |
243 // WebGraphicsContext3DSwapBuffersClient implementation. | 232 // WebGraphicsContext3DSwapBuffersClient implementation. |
244 | 233 |
(...skipping 25 matching lines...) Expand all Loading... | |
270 return mouse_lock_dispatcher_; | 259 return mouse_lock_dispatcher_; |
271 } | 260 } |
272 | 261 |
273 #if defined(OS_ANDROID) | 262 #if defined(OS_ANDROID) |
274 webkit_media::WebMediaPlayerManagerAndroid* media_player_manager() { | 263 webkit_media::WebMediaPlayerManagerAndroid* media_player_manager() { |
275 return media_player_manager_.get(); | 264 return media_player_manager_.get(); |
276 } | 265 } |
277 #endif | 266 #endif |
278 | 267 |
279 // Functions to add and remove observers for this object. | 268 // Functions to add and remove observers for this object. |
280 void AddObserver(content::RenderViewObserver* observer); | 269 void AddObserver(RenderViewObserver* observer); |
281 void RemoveObserver(content::RenderViewObserver* observer); | 270 void RemoveObserver(RenderViewObserver* observer); |
282 | 271 |
283 // Adds the given file chooser request to the file_chooser_completion_ queue | 272 // Adds the given file chooser request to the file_chooser_completion_ queue |
284 // (see that var for more) and requests the chooser be displayed if there are | 273 // (see that var for more) and requests the chooser be displayed if there are |
285 // no other waiting items in the queue. | 274 // no other waiting items in the queue. |
286 // | 275 // |
287 // Returns true if the chooser was successfully scheduled. False means we | 276 // Returns true if the chooser was successfully scheduled. False means we |
288 // didn't schedule anything. | 277 // didn't schedule anything. |
289 bool ScheduleFileChooser(const content::FileChooserParams& params, | 278 bool ScheduleFileChooser(const FileChooserParams& params, |
290 WebKit::WebFileChooserCompletion* completion); | 279 WebKit::WebFileChooserCompletion* completion); |
291 | 280 |
292 // Sets whether the renderer should report load progress to the browser. | 281 // Sets whether the renderer should report load progress to the browser. |
293 void SetReportLoadProgressEnabled(bool enabled); | 282 void SetReportLoadProgressEnabled(bool enabled); |
294 | 283 |
295 content::old::GuestToEmbedderChannel* GetGuestToEmbedderChannel() const; | 284 old::GuestToEmbedderChannel* GetGuestToEmbedderChannel() const; |
296 void SetGuestToEmbedderChannel(content::old::GuestToEmbedderChannel* channel); | 285 void SetGuestToEmbedderChannel(old::GuestToEmbedderChannel* channel); |
297 PP_Instance guest_pp_instance() const { return guest_pp_instance_; } | 286 PP_Instance guest_pp_instance() const { return guest_pp_instance_; } |
298 void set_guest_pp_instance(PP_Instance instance) { | 287 void set_guest_pp_instance(PP_Instance instance) { |
299 guest_pp_instance_ = instance; | 288 guest_pp_instance_ = instance; |
300 } | 289 } |
301 void set_guest_graphics_resource(const ppapi::HostResource& resource) { | 290 void set_guest_graphics_resource(const ppapi::HostResource& resource) { |
302 guest_graphics_resource_ = resource; | 291 guest_graphics_resource_ = resource; |
303 } | 292 } |
304 const ppapi::HostResource& guest_graphics_resource() const { | 293 const ppapi::HostResource& guest_graphics_resource() const { |
305 return guest_graphics_resource_; | 294 return guest_graphics_resource_; |
306 } | 295 } |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
339 void PpapiPluginTextInputTypeChanged(); | 328 void PpapiPluginTextInputTypeChanged(); |
340 void PpapiPluginCaretPositionChanged(); | 329 void PpapiPluginCaretPositionChanged(); |
341 | 330 |
342 // Cancels current composition. | 331 // Cancels current composition. |
343 void PpapiPluginCancelComposition(); | 332 void PpapiPluginCancelComposition(); |
344 | 333 |
345 // Informs the render view that a PPAPI plugin has changed selection. | 334 // Informs the render view that a PPAPI plugin has changed selection. |
346 void PpapiPluginSelectionChanged(); | 335 void PpapiPluginSelectionChanged(); |
347 | 336 |
348 // Notification that a PPAPI plugin has been created. | 337 // Notification that a PPAPI plugin has been created. |
349 void PpapiPluginCreated(content::RendererPpapiHost* host); | 338 void PpapiPluginCreated(RendererPpapiHost* host); |
350 | 339 |
351 // Retrieves the current caret position if a PPAPI plugin has focus. | 340 // Retrieves the current caret position if a PPAPI plugin has focus. |
352 bool GetPpapiPluginCaretBounds(gfx::Rect* rect); | 341 bool GetPpapiPluginCaretBounds(gfx::Rect* rect); |
353 | 342 |
354 // Simulates IME events for testing purpose. | 343 // Simulates IME events for testing purpose. |
355 void SimulateImeSetComposition( | 344 void SimulateImeSetComposition( |
356 const string16& text, | 345 const string16& text, |
357 const std::vector<WebKit::WebCompositionUnderline>& underlines, | 346 const std::vector<WebKit::WebCompositionUnderline>& underlines, |
358 int selection_start, | 347 int selection_start, |
359 int selection_end); | 348 int selection_end); |
(...skipping 329 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
689 WebKit::WebFrame* frame, | 678 WebKit::WebFrame* frame, |
690 const WebKit::WebURL& url) OVERRIDE; | 679 const WebKit::WebURL& url) OVERRIDE; |
691 | 680 |
692 // WebKit::WebPageSerializerClient implementation ---------------------------- | 681 // WebKit::WebPageSerializerClient implementation ---------------------------- |
693 | 682 |
694 virtual void didSerializeDataForFrame( | 683 virtual void didSerializeDataForFrame( |
695 const WebKit::WebURL& frame_url, | 684 const WebKit::WebURL& frame_url, |
696 const WebKit::WebCString& data, | 685 const WebKit::WebCString& data, |
697 PageSerializationStatus status) OVERRIDE; | 686 PageSerializationStatus status) OVERRIDE; |
698 | 687 |
699 // content::RenderView implementation ---------------------------------------- | 688 // RenderView implementation ------------------------------------------------- |
700 | 689 |
701 virtual bool Send(IPC::Message* message) OVERRIDE; | 690 virtual bool Send(IPC::Message* message) OVERRIDE; |
702 virtual int GetRoutingID() const OVERRIDE; | 691 virtual int GetRoutingID() const OVERRIDE; |
703 virtual int GetPageId() const OVERRIDE; | 692 virtual int GetPageId() const OVERRIDE; |
704 virtual gfx::Size GetSize() const OVERRIDE; | 693 virtual gfx::Size GetSize() const OVERRIDE; |
705 virtual webkit_glue::WebPreferences& GetWebkitPreferences() OVERRIDE; | 694 virtual webkit_glue::WebPreferences& GetWebkitPreferences() OVERRIDE; |
706 virtual WebKit::WebView* GetWebView() OVERRIDE; | 695 virtual WebKit::WebView* GetWebView() OVERRIDE; |
707 virtual WebKit::WebNode GetFocusedNode() const OVERRIDE; | 696 virtual WebKit::WebNode GetFocusedNode() const OVERRIDE; |
708 virtual WebKit::WebNode GetContextMenuNode() const OVERRIDE; | 697 virtual WebKit::WebNode GetContextMenuNode() const OVERRIDE; |
709 virtual bool IsEditableNode(const WebKit::WebNode& node) const OVERRIDE; | 698 virtual bool IsEditableNode(const WebKit::WebNode& node) const OVERRIDE; |
710 virtual WebKit::WebPlugin* CreatePlugin( | 699 virtual WebKit::WebPlugin* CreatePlugin( |
711 WebKit::WebFrame* frame, | 700 WebKit::WebFrame* frame, |
712 const webkit::WebPluginInfo& info, | 701 const webkit::WebPluginInfo& info, |
713 const WebKit::WebPluginParams& params) OVERRIDE; | 702 const WebKit::WebPluginParams& params) OVERRIDE; |
714 virtual void EvaluateScript(const string16& frame_xpath, | 703 virtual void EvaluateScript(const string16& frame_xpath, |
715 const string16& jscript, | 704 const string16& jscript, |
716 int id, | 705 int id, |
717 bool notify_result) OVERRIDE; | 706 bool notify_result) OVERRIDE; |
718 virtual bool ShouldDisplayScrollbars(int width, int height) const OVERRIDE; | 707 virtual bool ShouldDisplayScrollbars(int width, int height) const OVERRIDE; |
719 virtual int GetEnabledBindings() const OVERRIDE; | 708 virtual int GetEnabledBindings() const OVERRIDE; |
720 virtual bool GetContentStateImmediately() const OVERRIDE; | 709 virtual bool GetContentStateImmediately() const OVERRIDE; |
721 virtual float GetFilteredTimePerFrame() const OVERRIDE; | 710 virtual float GetFilteredTimePerFrame() const OVERRIDE; |
722 virtual int ShowContextMenu( | 711 virtual int ShowContextMenu(ContextMenuClient* client, |
723 content::ContextMenuClient* client, | 712 const ContextMenuParams& params) OVERRIDE; |
724 const content::ContextMenuParams& params) OVERRIDE; | |
725 virtual void CancelContextMenu(int request_id) OVERRIDE; | 713 virtual void CancelContextMenu(int request_id) OVERRIDE; |
726 virtual WebKit::WebPageVisibilityState GetVisibilityState() const OVERRIDE; | 714 virtual WebKit::WebPageVisibilityState GetVisibilityState() const OVERRIDE; |
727 virtual void RunModalAlertDialog(WebKit::WebFrame* frame, | 715 virtual void RunModalAlertDialog(WebKit::WebFrame* frame, |
728 const WebKit::WebString& message) OVERRIDE; | 716 const WebKit::WebString& message) OVERRIDE; |
729 virtual void LoadURLExternally( | 717 virtual void LoadURLExternally( |
730 WebKit::WebFrame* frame, | 718 WebKit::WebFrame* frame, |
731 const WebKit::WebURLRequest& request, | 719 const WebKit::WebURLRequest& request, |
732 WebKit::WebNavigationPolicy policy) OVERRIDE; | 720 WebKit::WebNavigationPolicy policy) OVERRIDE; |
733 virtual void Repaint(const gfx::Size& size) OVERRIDE; | 721 virtual void Repaint(const gfx::Size& size) OVERRIDE; |
734 | 722 |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
801 std::vector<gfx::Rect>* character_bounds) OVERRIDE; | 789 std::vector<gfx::Rect>* character_bounds) OVERRIDE; |
802 virtual bool CanComposeInline() OVERRIDE; | 790 virtual bool CanComposeInline() OVERRIDE; |
803 virtual bool WebWidgetHandlesCompositorScheduling() const OVERRIDE; | 791 virtual bool WebWidgetHandlesCompositorScheduling() const OVERRIDE; |
804 | 792 |
805 private: | 793 private: |
806 // For unit tests. | 794 // For unit tests. |
807 friend class ExternalPopupMenuTest; | 795 friend class ExternalPopupMenuTest; |
808 friend class PepperDeviceTest; | 796 friend class PepperDeviceTest; |
809 friend class RendererAccessibilityTest; | 797 friend class RendererAccessibilityTest; |
810 friend class WebIntentsHostTest; | 798 friend class WebIntentsHostTest; |
811 friend class content::RenderViewTest; | 799 friend class RenderViewTest; |
812 | 800 |
813 FRIEND_TEST_ALL_PREFIXES(ExternalPopupMenuRemoveTest, RemoveOnChange); | 801 FRIEND_TEST_ALL_PREFIXES(ExternalPopupMenuRemoveTest, RemoveOnChange); |
814 FRIEND_TEST_ALL_PREFIXES(ExternalPopupMenuTest, NormalCase); | 802 FRIEND_TEST_ALL_PREFIXES(ExternalPopupMenuTest, NormalCase); |
815 FRIEND_TEST_ALL_PREFIXES(ExternalPopupMenuTest, ShowPopupThenNavigate); | 803 FRIEND_TEST_ALL_PREFIXES(ExternalPopupMenuTest, ShowPopupThenNavigate); |
816 FRIEND_TEST_ALL_PREFIXES(RenderViewImplTest, DecideNavigationPolicyForWebUI); | 804 FRIEND_TEST_ALL_PREFIXES(RenderViewImplTest, DecideNavigationPolicyForWebUI); |
817 FRIEND_TEST_ALL_PREFIXES(RenderViewImplTest, | 805 FRIEND_TEST_ALL_PREFIXES(RenderViewImplTest, |
818 DontIgnoreBackAfterNavEntryLimit); | 806 DontIgnoreBackAfterNavEntryLimit); |
819 FRIEND_TEST_ALL_PREFIXES(RenderViewImplTest, ImeComposition); | 807 FRIEND_TEST_ALL_PREFIXES(RenderViewImplTest, ImeComposition); |
820 FRIEND_TEST_ALL_PREFIXES(RenderViewImplTest, InsertCharacters); | 808 FRIEND_TEST_ALL_PREFIXES(RenderViewImplTest, InsertCharacters); |
821 FRIEND_TEST_ALL_PREFIXES(RenderViewImplTest, JSBlockSentAfterPageLoad); | 809 FRIEND_TEST_ALL_PREFIXES(RenderViewImplTest, JSBlockSentAfterPageLoad); |
(...skipping 22 matching lines...) Expand all Loading... | |
844 typedef std::map<GURL, double> HostZoomLevels; | 832 typedef std::map<GURL, double> HostZoomLevels; |
845 | 833 |
846 enum ErrorPageType { | 834 enum ErrorPageType { |
847 DNS_ERROR, | 835 DNS_ERROR, |
848 HTTP_404, | 836 HTTP_404, |
849 CONNECTION_ERROR, | 837 CONNECTION_ERROR, |
850 }; | 838 }; |
851 | 839 |
852 RenderViewImpl(gfx::NativeViewId parent_hwnd, | 840 RenderViewImpl(gfx::NativeViewId parent_hwnd, |
853 int32 opener_id, | 841 int32 opener_id, |
854 const content::RendererPreferences& renderer_prefs, | 842 const RendererPreferences& renderer_prefs, |
855 const webkit_glue::WebPreferences& webkit_prefs, | 843 const webkit_glue::WebPreferences& webkit_prefs, |
856 SharedRenderViewCounter* counter, | 844 SharedRenderViewCounter* counter, |
857 int32 routing_id, | 845 int32 routing_id, |
858 int32 surface_id, | 846 int32 surface_id, |
859 int64 session_storage_namespace_id, | 847 int64 session_storage_namespace_id, |
860 const string16& frame_name, | 848 const string16& frame_name, |
861 bool is_renderer_created, | 849 bool is_renderer_created, |
862 bool swapped_out, | 850 bool swapped_out, |
863 int32 next_page_id, | 851 int32 next_page_id, |
864 const WebKit::WebScreenInfo& screen_info, | 852 const WebKit::WebScreenInfo& screen_info, |
865 content::old::GuestToEmbedderChannel* | 853 old::GuestToEmbedderChannel* guest_to_embedder_channel, |
866 guest_to_embedder_channel, | |
867 AccessibilityMode accessibility_mode); | 854 AccessibilityMode accessibility_mode); |
868 | 855 |
869 // Do not delete directly. This class is reference counted. | 856 // Do not delete directly. This class is reference counted. |
870 virtual ~RenderViewImpl(); | 857 virtual ~RenderViewImpl(); |
871 | 858 |
872 void UpdateURL(WebKit::WebFrame* frame); | 859 void UpdateURL(WebKit::WebFrame* frame); |
873 void UpdateTitle(WebKit::WebFrame* frame, const string16& title, | 860 void UpdateTitle(WebKit::WebFrame* frame, const string16& title, |
874 WebKit::WebTextDirection title_direction); | 861 WebKit::WebTextDirection title_direction); |
875 void UpdateSessionHistory(WebKit::WebFrame* frame); | 862 void UpdateSessionHistory(WebKit::WebFrame* frame); |
876 void SendUpdateState(const WebKit::WebHistoryItem& item); | 863 void SendUpdateState(const WebKit::WebHistoryItem& item); |
877 | 864 |
878 // Update current main frame's encoding and send it to browser window. | 865 // Update current main frame's encoding and send it to browser window. |
879 // Since we want to let users see the right encoding info from menu | 866 // Since we want to let users see the right encoding info from menu |
880 // before finishing loading, we call the UpdateEncoding in | 867 // before finishing loading, we call the UpdateEncoding in |
881 // a) function:DidCommitLoadForFrame. When this function is called, | 868 // a) function:DidCommitLoadForFrame. When this function is called, |
882 // that means we have got first data. In here we try to get encoding | 869 // that means we have got first data. In here we try to get encoding |
883 // of page if it has been specified in http header. | 870 // of page if it has been specified in http header. |
884 // b) function:DidReceiveTitle. When this function is called, | 871 // b) function:DidReceiveTitle. When this function is called, |
885 // that means we have got specified title. Because in most of webpages, | 872 // that means we have got specified title. Because in most of webpages, |
886 // title tags will follow meta tags. In here we try to get encoding of | 873 // title tags will follow meta tags. In here we try to get encoding of |
887 // page if it has been specified in meta tag. | 874 // page if it has been specified in meta tag. |
888 // c) function:DidFinishDocumentLoadForFrame. When this function is | 875 // c) function:DidFinishDocumentLoadForFrame. When this function is |
889 // called, that means we have got whole html page. In here we should | 876 // called, that means we have got whole html page. In here we should |
890 // finally get right encoding of page. | 877 // finally get right encoding of page. |
891 void UpdateEncoding(WebKit::WebFrame* frame, | 878 void UpdateEncoding(WebKit::WebFrame* frame, |
892 const std::string& encoding_name); | 879 const std::string& encoding_name); |
893 | 880 |
894 void OpenURL(WebKit::WebFrame* frame, | 881 void OpenURL(WebKit::WebFrame* frame, |
895 const GURL& url, | 882 const GURL& url, |
896 const content::Referrer& referrer, | 883 const Referrer& referrer, |
897 WebKit::WebNavigationPolicy policy); | 884 WebKit::WebNavigationPolicy policy); |
898 | 885 |
899 bool RunJavaScriptMessage(content::JavaScriptMessageType type, | 886 bool RunJavaScriptMessage(JavaScriptMessageType type, |
900 const string16& message, | 887 const string16& message, |
901 const string16& default_value, | 888 const string16& default_value, |
902 const GURL& frame_url, | 889 const GURL& frame_url, |
903 string16* result); | 890 string16* result); |
904 | 891 |
905 // Sends a message and runs a nested message loop. | 892 // Sends a message and runs a nested message loop. |
906 bool SendAndRunNestedMessageLoop(IPC::SyncMessage* message); | 893 bool SendAndRunNestedMessageLoop(IPC::SyncMessage* message); |
907 | 894 |
908 // Called when the "pinned to left/right edge" state needs to be updated. | 895 // Called when the "pinned to left/right edge" state needs to be updated. |
909 void UpdateScrollState(WebKit::WebFrame* frame); | 896 void UpdateScrollState(WebKit::WebFrame* frame); |
910 | 897 |
911 // IPC message handlers ------------------------------------------------------ | 898 // IPC message handlers ------------------------------------------------------ |
912 // | 899 // |
913 // The documentation for these functions should be in | 900 // The documentation for these functions should be in |
914 // render_messages_internal.h for the message that the function is handling. | 901 // render_messages_internal.h for the message that the function is handling. |
915 | 902 |
916 CONTENT_EXPORT void OnAllowBindings(int enabled_bindings_flags); | 903 CONTENT_EXPORT void OnAllowBindings(int enabled_bindings_flags); |
917 void OnAllowScriptToClose(bool script_can_close); | 904 void OnAllowScriptToClose(bool script_can_close); |
918 void OnAsyncFileOpened(base::PlatformFileError error_code, | 905 void OnAsyncFileOpened(base::PlatformFileError error_code, |
919 IPC::PlatformFileForTransit file_for_transit, | 906 IPC::PlatformFileForTransit file_for_transit, |
920 int message_id); | 907 int message_id); |
921 void OnPpapiBrokerChannelCreated(int request_id, | 908 void OnPpapiBrokerChannelCreated(int request_id, |
922 const IPC::ChannelHandle& handle); | 909 const IPC::ChannelHandle& handle); |
923 void OnPpapiBrokerPermissionResult(int request_id, bool result); | 910 void OnPpapiBrokerPermissionResult(int request_id, bool result); |
924 void OnCancelDownload(int32 download_id); | 911 void OnCancelDownload(int32 download_id); |
925 void OnClearFocusedNode(); | 912 void OnClearFocusedNode(); |
926 void OnClosePage(); | 913 void OnClosePage(); |
927 void OnContextMenuClosed( | 914 void OnContextMenuClosed(const CustomContextMenuContext& custom_context); |
928 const content::CustomContextMenuContext& custom_context); | |
929 void OnCopy(); | 915 void OnCopy(); |
930 void OnCopyImageAt(int x, int y); | 916 void OnCopyImageAt(int x, int y); |
931 void OnCut(); | 917 void OnCut(); |
932 void OnCSSInsertRequest(const string16& frame_xpath, | 918 void OnCSSInsertRequest(const string16& frame_xpath, |
933 const std::string& css); | 919 const std::string& css); |
934 void OnCustomContextMenuAction( | 920 void OnCustomContextMenuAction(const CustomContextMenuContext& custom_context, |
935 const content::CustomContextMenuContext& custom_context, | 921 unsigned action); |
936 unsigned action); | |
937 void OnDelete(); | 922 void OnDelete(); |
938 void OnDeterminePageLanguage(); | 923 void OnDeterminePageLanguage(); |
939 void OnDisableScrollbarsForSmallWindows( | 924 void OnDisableScrollbarsForSmallWindows( |
940 const gfx::Size& disable_scrollbars_size_limit); | 925 const gfx::Size& disable_scrollbars_size_limit); |
941 void OnDisassociateFromPopupCount(); | 926 void OnDisassociateFromPopupCount(); |
942 void OnDragSourceEndedOrMoved(const gfx::Point& client_point, | 927 void OnDragSourceEndedOrMoved(const gfx::Point& client_point, |
943 const gfx::Point& screen_point, | 928 const gfx::Point& screen_point, |
944 bool ended, | 929 bool ended, |
945 WebKit::WebDragOperation drag_operation); | 930 WebKit::WebDragOperation drag_operation); |
946 void OnDragSourceSystemDragEnded(); | 931 void OnDragSourceSystemDragEnded(); |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1007 void OnSetNavigationStartTime( | 992 void OnSetNavigationStartTime( |
1008 const base::TimeTicks& browser_navigation_start); | 993 const base::TimeTicks& browser_navigation_start); |
1009 void OnSetWebUIProperty(const std::string& name, const std::string& value); | 994 void OnSetWebUIProperty(const std::string& name, const std::string& value); |
1010 CONTENT_EXPORT void OnSetEditCommandsForNextKeyEvent( | 995 CONTENT_EXPORT void OnSetEditCommandsForNextKeyEvent( |
1011 const EditCommands& edit_commands); | 996 const EditCommands& edit_commands); |
1012 CONTENT_EXPORT void OnSetHistoryLengthAndPrune(int history_length, | 997 CONTENT_EXPORT void OnSetHistoryLengthAndPrune(int history_length, |
1013 int32 minimum_page_id); | 998 int32 minimum_page_id); |
1014 void OnSetInitialFocus(bool reverse); | 999 void OnSetInitialFocus(bool reverse); |
1015 void OnScrollFocusedEditableNodeIntoRect(const gfx::Rect& rect); | 1000 void OnScrollFocusedEditableNodeIntoRect(const gfx::Rect& rect); |
1016 void OnSetPageEncoding(const std::string& encoding_name); | 1001 void OnSetPageEncoding(const std::string& encoding_name); |
1017 void OnSetRendererPrefs(const content::RendererPreferences& renderer_prefs); | 1002 void OnSetRendererPrefs(const RendererPreferences& renderer_prefs); |
1018 void OnSetZoomLevel(double zoom_level); | 1003 void OnSetZoomLevel(double zoom_level); |
1019 CONTENT_EXPORT void OnSetZoomLevelForLoadingURL(const GURL& url, | 1004 CONTENT_EXPORT void OnSetZoomLevelForLoadingURL(const GURL& url, |
1020 double zoom_level); | 1005 double zoom_level); |
1021 void OnExitFullscreen(); | 1006 void OnExitFullscreen(); |
1022 void OnShouldClose(); | 1007 void OnShouldClose(); |
1023 void OnStop(); | 1008 void OnStop(); |
1024 void OnStopFinding(content::StopFindAction action); | 1009 void OnStopFinding(StopFindAction action); |
1025 CONTENT_EXPORT void OnSwapOut(const ViewMsg_SwapOut_Params& params); | 1010 CONTENT_EXPORT void OnSwapOut(const ViewMsg_SwapOut_Params& params); |
1026 void OnThemeChanged(); | 1011 void OnThemeChanged(); |
1027 void OnUndo(); | 1012 void OnUndo(); |
1028 void OnUpdateTargetURLAck(); | 1013 void OnUpdateTargetURLAck(); |
1029 void OnUpdateTimezone(); | 1014 void OnUpdateTimezone(); |
1030 CONTENT_EXPORT void OnUpdateWebPreferences( | 1015 CONTENT_EXPORT void OnUpdateWebPreferences( |
1031 const webkit_glue::WebPreferences& prefs); | 1016 const webkit_glue::WebPreferences& prefs); |
1032 CONTENT_EXPORT void OnUnselect(); | 1017 CONTENT_EXPORT void OnUnselect(); |
1033 | 1018 |
1034 void OnZoom(content::PageZoom zoom); | 1019 void OnZoom(PageZoom zoom); |
1035 void OnZoomFactor(content::PageZoom zoom, int zoom_center_x, | 1020 void OnZoomFactor(PageZoom zoom, int zoom_center_x, int zoom_center_y); |
1036 int zoom_center_y); | |
1037 | 1021 |
1038 void OnEnableViewSourceMode(); | 1022 void OnEnableViewSourceMode(); |
1039 | 1023 |
1040 void OnJavaBridgeInit(); | 1024 void OnJavaBridgeInit(); |
1041 | 1025 |
1042 void OnUpdatedFrameTree(int process_id, | 1026 void OnUpdatedFrameTree(int process_id, |
1043 int route_id, | 1027 int route_id, |
1044 const std::string& frame_tree); | 1028 const std::string& frame_tree); |
1045 | 1029 |
1046 #if defined(OS_ANDROID) | 1030 #if defined(OS_ANDROID) |
(...skipping 14 matching lines...) Expand all Loading... | |
1061 void OnSetWindowVisibility(bool visible); | 1045 void OnSetWindowVisibility(bool visible); |
1062 void OnWindowFrameChanged(const gfx::Rect& window_frame, | 1046 void OnWindowFrameChanged(const gfx::Rect& window_frame, |
1063 const gfx::Rect& view_frame); | 1047 const gfx::Rect& view_frame); |
1064 #endif | 1048 #endif |
1065 | 1049 |
1066 | 1050 |
1067 // Adding a new message handler? Please add it in alphabetical order above | 1051 // Adding a new message handler? Please add it in alphabetical order above |
1068 // and put it in the same position in the .cc file. | 1052 // and put it in the same position in the .cc file. |
1069 | 1053 |
1070 // Misc private functions ---------------------------------------------------- | 1054 // Misc private functions ---------------------------------------------------- |
1071 void ZoomFactorHelper(content::PageZoom zoom, int zoom_center_x, | 1055 void ZoomFactorHelper(PageZoom zoom, int zoom_center_x, int zoom_center_y, |
1072 int zoom_center_y, float scaling_increment); | 1056 float scaling_increment); |
1073 | 1057 |
1074 void AltErrorPageFinished(WebKit::WebFrame* frame, | 1058 void AltErrorPageFinished(WebKit::WebFrame* frame, |
1075 const WebKit::WebURLError& original_error, | 1059 const WebKit::WebURLError& original_error, |
1076 const std::string& html); | 1060 const std::string& html); |
1077 | 1061 |
1078 // Check whether the preferred size has changed. | 1062 // Check whether the preferred size has changed. |
1079 void CheckPreferredSize(); | 1063 void CheckPreferredSize(); |
1080 | 1064 |
1081 WebKit::WebGraphicsContext3D* CreateGraphicsContext3D( | 1065 WebKit::WebGraphicsContext3D* CreateGraphicsContext3D( |
1082 const WebKit::WebGraphicsContext3D::Attributes& attributes); | 1066 const WebKit::WebGraphicsContext3D::Attributes& attributes); |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1152 | 1136 |
1153 bool MaybeLoadAlternateErrorPage(WebKit::WebFrame* frame, | 1137 bool MaybeLoadAlternateErrorPage(WebKit::WebFrame* frame, |
1154 const WebKit::WebURLError& error, | 1138 const WebKit::WebURLError& error, |
1155 bool replace); | 1139 bool replace); |
1156 | 1140 |
1157 // Make this RenderView show an empty, unscriptable page. | 1141 // Make this RenderView show an empty, unscriptable page. |
1158 void NavigateToSwappedOutURL(WebKit::WebFrame* frame); | 1142 void NavigateToSwappedOutURL(WebKit::WebFrame* frame); |
1159 | 1143 |
1160 // If we initiated a navigation, this function will populate |document_state| | 1144 // If we initiated a navigation, this function will populate |document_state| |
1161 // with the navigation information saved in OnNavigate(). | 1145 // with the navigation information saved in OnNavigate(). |
1162 void PopulateDocumentStateFromPending(content::DocumentState* document_state); | 1146 void PopulateDocumentStateFromPending(DocumentState* document_state); |
1163 | 1147 |
1164 // Returns a new NavigationState populated with the navigation information | 1148 // Returns a new NavigationState populated with the navigation information |
1165 // saved in OnNavigate(). | 1149 // saved in OnNavigate(). |
1166 content::NavigationState* CreateNavigationStateFromPending(); | 1150 NavigationState* CreateNavigationStateFromPending(); |
1167 | 1151 |
1168 // Processes the command-line flags --enable-viewport and | 1152 // Processes the command-line flags --enable-viewport and |
1169 // --enable-fixed-layout[=w,h]. | 1153 // --enable-fixed-layout[=w,h]. |
1170 void ProcessViewLayoutFlags(const CommandLine& command_line); | 1154 void ProcessViewLayoutFlags(const CommandLine& command_line); |
1171 | 1155 |
1172 // Processes the command-line flags --enable-pinch and | 1156 // Processes the command-line flags --enable-pinch and |
1173 // --enable-pinch-in-compositor | 1157 // --enable-pinch-in-compositor |
1174 void ProcessAcceleratedPinchZoomFlags(const CommandLine& command_line); | 1158 void ProcessAcceleratedPinchZoomFlags(const CommandLine& command_line); |
1175 | 1159 |
1176 // Sends a reply to the current find operation handling if it was a | 1160 // Sends a reply to the current find operation handling if it was a |
1177 // synchronous find request. | 1161 // synchronous find request. |
1178 void SendFindReply(int request_id, | 1162 void SendFindReply(int request_id, |
1179 int match_count, | 1163 int match_count, |
1180 int ordinal, | 1164 int ordinal, |
1181 const WebKit::WebRect& selection_rect, | 1165 const WebKit::WebRect& selection_rect, |
1182 bool final_status_update); | 1166 bool final_status_update); |
1183 | 1167 |
1184 // Starts nav_state_sync_timer_ if it isn't already running. | 1168 // Starts nav_state_sync_timer_ if it isn't already running. |
1185 void StartNavStateSyncTimerIfNecessary(); | 1169 void StartNavStateSyncTimerIfNecessary(); |
1186 | 1170 |
1187 // Stops the current find-in-page search. | 1171 // Stops the current find-in-page search. |
1188 void StopFinding(content::StopFindAction action); | 1172 void StopFinding(StopFindAction action); |
1189 | 1173 |
1190 // Dispatches the current navigation state to the browser. Called on a | 1174 // Dispatches the current navigation state to the browser. Called on a |
1191 // periodic timer so we don't send too many messages. | 1175 // periodic timer so we don't send too many messages. |
1192 void SyncNavigationState(); | 1176 void SyncNavigationState(); |
1193 | 1177 |
1194 // Dispatches the current state of selection on the webpage to the browser if | 1178 // Dispatches the current state of selection on the webpage to the browser if |
1195 // it has changed. | 1179 // it has changed. |
1196 // TODO(varunjain): delete this method once we figure out how to keep | 1180 // TODO(varunjain): delete this method once we figure out how to keep |
1197 // selection handles in sync with the webpage. | 1181 // selection handles in sync with the webpage. |
1198 void SyncSelectionIfRequired(); | 1182 void SyncSelectionIfRequired(); |
1199 | 1183 |
1200 #if defined(OS_POSIX) && !defined(OS_MACOSX) | 1184 #if defined(OS_POSIX) && !defined(OS_MACOSX) |
1201 void UpdateFontRenderingFromRendererPrefs(); | 1185 void UpdateFontRenderingFromRendererPrefs(); |
1202 #else | 1186 #else |
1203 void UpdateFontRenderingFromRendererPrefs() {} | 1187 void UpdateFontRenderingFromRendererPrefs() {} |
1204 #endif | 1188 #endif |
1205 | 1189 |
1206 // Update the target url and tell the browser that the target URL has changed. | 1190 // Update the target url and tell the browser that the target URL has changed. |
1207 // If |url| is empty, show |fallback_url|. | 1191 // If |url| is empty, show |fallback_url|. |
1208 void UpdateTargetURL(const GURL& url, const GURL& fallback_url); | 1192 void UpdateTargetURL(const GURL& url, const GURL& fallback_url); |
1209 | 1193 |
1210 // --------------------------------------------------------------------------- | 1194 // --------------------------------------------------------------------------- |
1211 // ADDING NEW FUNCTIONS? Please keep private functions alphabetized and put | 1195 // ADDING NEW FUNCTIONS? Please keep private functions alphabetized and put |
1212 // it in the same order in the .cc file as it was in the header. | 1196 // it in the same order in the .cc file as it was in the header. |
1213 // --------------------------------------------------------------------------- | 1197 // --------------------------------------------------------------------------- |
1214 | 1198 |
1215 // Settings ------------------------------------------------------------------ | 1199 // Settings ------------------------------------------------------------------ |
1216 | 1200 |
1217 webkit_glue::WebPreferences webkit_preferences_; | 1201 webkit_glue::WebPreferences webkit_preferences_; |
1218 content::RendererPreferences renderer_preferences_; | 1202 RendererPreferences renderer_preferences_; |
1219 | 1203 |
1220 HostZoomLevels host_zoom_levels_; | 1204 HostZoomLevels host_zoom_levels_; |
1221 | 1205 |
1222 // Whether content state (such as form state, scroll position and page | 1206 // Whether content state (such as form state, scroll position and page |
1223 // contents) should be sent to the browser immediately. This is normally | 1207 // contents) should be sent to the browser immediately. This is normally |
1224 // false, but set to true by some tests. | 1208 // false, but set to true by some tests. |
1225 bool send_content_state_immediately_; | 1209 bool send_content_state_immediately_; |
1226 | 1210 |
1227 // Bitwise-ORed set of extra bindings that have been enabled. See | 1211 // Bitwise-ORed set of extra bindings that have been enabled. See |
1228 // BindingsPolicy for details. | 1212 // BindingsPolicy for details. |
(...skipping 30 matching lines...) Expand all Loading... | |
1259 | 1243 |
1260 // Whether this RenderView was created by a frame that was suppressing its | 1244 // Whether this RenderView was created by a frame that was suppressing its |
1261 // opener. If so, we may want to load pages in a separate process. See | 1245 // opener. If so, we may want to load pages in a separate process. See |
1262 // decidePolicyForNavigation for details. | 1246 // decidePolicyForNavigation for details. |
1263 bool opener_suppressed_; | 1247 bool opener_suppressed_; |
1264 | 1248 |
1265 // If we are handling a top-level client-side redirect, this tracks the URL | 1249 // If we are handling a top-level client-side redirect, this tracks the URL |
1266 // of the page that initiated it. Specifically, when a load is committed this | 1250 // of the page that initiated it. Specifically, when a load is committed this |
1267 // is used to determine if that load originated from a client-side redirect. | 1251 // is used to determine if that load originated from a client-side redirect. |
1268 // It is empty if there is no top-level client-side redirect. | 1252 // It is empty if there is no top-level client-side redirect. |
1269 content::Referrer completed_client_redirect_src_; | 1253 Referrer completed_client_redirect_src_; |
1270 | 1254 |
1271 // Holds state pertaining to a navigation that we initiated. This is held by | 1255 // Holds state pertaining to a navigation that we initiated. This is held by |
1272 // the WebDataSource::ExtraData attribute. We use pending_navigation_state_ | 1256 // the WebDataSource::ExtraData attribute. We use pending_navigation_state_ |
1273 // as a temporary holder for the state until the WebDataSource corresponding | 1257 // as a temporary holder for the state until the WebDataSource corresponding |
1274 // to the new navigation is created. See DidCreateDataSource. | 1258 // to the new navigation is created. See DidCreateDataSource. |
1275 scoped_ptr<ViewMsg_Navigate_Params> pending_navigation_params_; | 1259 scoped_ptr<ViewMsg_Navigate_Params> pending_navigation_params_; |
1276 | 1260 |
1277 // Timer used to delay the updating of nav state (see SyncNavigationState). | 1261 // Timer used to delay the updating of nav state (see SyncNavigationState). |
1278 base::OneShotTimer<RenderViewImpl> nav_state_sync_timer_; | 1262 base::OneShotTimer<RenderViewImpl> nav_state_sync_timer_; |
1279 | 1263 |
1280 // Page IDs ------------------------------------------------------------------ | 1264 // Page IDs ------------------------------------------------------------------ |
1281 // See documentation in content::RenderView. | 1265 // See documentation in RenderView. |
1282 int32 page_id_; | 1266 int32 page_id_; |
1283 | 1267 |
1284 // Indicates the ID of the last page that we sent a FrameNavigate to the | 1268 // Indicates the ID of the last page that we sent a FrameNavigate to the |
1285 // browser for. This is used to determine if the most recent transition | 1269 // browser for. This is used to determine if the most recent transition |
1286 // generated a history entry (less than page_id_), or not (equal to or | 1270 // generated a history entry (less than page_id_), or not (equal to or |
1287 // greater than). Note that this will be greater than page_id_ if the user | 1271 // greater than). Note that this will be greater than page_id_ if the user |
1288 // goes back. | 1272 // goes back. |
1289 int32 last_page_id_sent_to_browser_; | 1273 int32 last_page_id_sent_to_browser_; |
1290 | 1274 |
1291 // The next available page ID to use for this RenderView. These IDs are | 1275 // The next available page ID to use for this RenderView. These IDs are |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1353 // (WebKit-originated) context menu events will have an ID of 0 and will not | 1337 // (WebKit-originated) context menu events will have an ID of 0 and will not |
1354 // be in this map. | 1338 // be in this map. |
1355 // | 1339 // |
1356 // We don't want to add internal ones since some of the "special" page | 1340 // We don't want to add internal ones since some of the "special" page |
1357 // handlers in the browser process just ignore the context menu requests so | 1341 // handlers in the browser process just ignore the context menu requests so |
1358 // avoid showing context menus, and so this will cause right clicks to leak | 1342 // avoid showing context menus, and so this will cause right clicks to leak |
1359 // entries in this map. Most users of the custom context menu (e.g. Pepper | 1343 // entries in this map. Most users of the custom context menu (e.g. Pepper |
1360 // plugins) are normally only on "regular" pages and the regular pages will | 1344 // plugins) are normally only on "regular" pages and the regular pages will |
1361 // always respond properly to the request, so we don't have to worry so | 1345 // always respond properly to the request, so we don't have to worry so |
1362 // much about leaks. | 1346 // much about leaks. |
1363 IDMap<content::ContextMenuClient, IDMapExternalPointer> | 1347 IDMap<ContextMenuClient, IDMapExternalPointer> pending_context_menus_; |
1364 pending_context_menus_; | |
1365 | 1348 |
1366 // View ---------------------------------------------------------------------- | 1349 // View ---------------------------------------------------------------------- |
1367 | 1350 |
1368 // Cache the preferred size of the page in order to prevent sending the IPC | 1351 // Cache the preferred size of the page in order to prevent sending the IPC |
1369 // when layout() recomputes but doesn't actually change sizes. | 1352 // when layout() recomputes but doesn't actually change sizes. |
1370 gfx::Size preferred_size_; | 1353 gfx::Size preferred_size_; |
1371 | 1354 |
1372 // Used to delay determining the preferred size (to avoid intermediate | 1355 // Used to delay determining the preferred size (to avoid intermediate |
1373 // states for the sizes). | 1356 // states for the sizes). |
1374 base::OneShotTimer<RenderViewImpl> check_preferred_size_timer_; | 1357 base::OneShotTimer<RenderViewImpl> check_preferred_size_timer_; |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1422 // MediaStreamImpl attached to this view; lazily initialized. | 1405 // MediaStreamImpl attached to this view; lazily initialized. |
1423 MediaStreamImpl* media_stream_impl_; | 1406 MediaStreamImpl* media_stream_impl_; |
1424 | 1407 |
1425 DevToolsAgent* devtools_agent_; | 1408 DevToolsAgent* devtools_agent_; |
1426 | 1409 |
1427 // The current accessibility mode. | 1410 // The current accessibility mode. |
1428 AccessibilityMode accessibility_mode_; | 1411 AccessibilityMode accessibility_mode_; |
1429 | 1412 |
1430 // Only valid if |accessibility_mode_| is anything other than | 1413 // Only valid if |accessibility_mode_| is anything other than |
1431 // AccessibilityModeOff. | 1414 // AccessibilityModeOff. |
1432 content::RendererAccessibility* renderer_accessibility_; | 1415 RendererAccessibility* renderer_accessibility_; |
1433 | 1416 |
1434 // Java Bridge dispatcher attached to this view; lazily initialized. | 1417 // Java Bridge dispatcher attached to this view; lazily initialized. |
1435 JavaBridgeDispatcher* java_bridge_dispatcher_; | 1418 JavaBridgeDispatcher* java_bridge_dispatcher_; |
1436 | 1419 |
1437 // Mouse Lock dispatcher attached to this view. | 1420 // Mouse Lock dispatcher attached to this view. |
1438 MouseLockDispatcher* mouse_lock_dispatcher_; | 1421 MouseLockDispatcher* mouse_lock_dispatcher_; |
1439 | 1422 |
1440 #if defined(OS_ANDROID) | 1423 #if defined(OS_ANDROID) |
1441 // Android Specific --------------------------------------------------------- | 1424 // Android Specific --------------------------------------------------------- |
1442 | 1425 |
1443 // Expected id of the next content intent launched. Used to prevent scheduled | 1426 // Expected id of the next content intent launched. Used to prevent scheduled |
1444 // intents to be launched if aborted. | 1427 // intents to be launched if aborted. |
1445 size_t expected_content_intent_id_; | 1428 size_t expected_content_intent_id_; |
1446 | 1429 |
1447 // List of click-based content detectors. | 1430 // List of click-based content detectors. |
1448 typedef std::vector< linked_ptr<content::ContentDetector> > | 1431 typedef std::vector< linked_ptr<ContentDetector> > ContentDetectorList; |
1449 ContentDetectorList; | |
1450 ContentDetectorList content_detectors_; | 1432 ContentDetectorList content_detectors_; |
1451 | 1433 |
1452 // Proxy class for WebMediaPlayer to communicate with the real media player | 1434 // Proxy class for WebMediaPlayer to communicate with the real media player |
1453 // objects in browser process. | 1435 // objects in browser process. |
1454 content::WebMediaPlayerProxyImplAndroid* media_player_proxy_; | 1436 WebMediaPlayerProxyImplAndroid* media_player_proxy_; |
1455 | 1437 |
1456 // The media player manager for managing all the media players on this view. | 1438 // The media player manager for managing all the media players on this view. |
1457 scoped_ptr<webkit_media::WebMediaPlayerManagerAndroid> media_player_manager_; | 1439 scoped_ptr<webkit_media::WebMediaPlayerManagerAndroid> media_player_manager_; |
1458 | 1440 |
1459 // Resource manager for all the android media player objects if they are | 1441 // Resource manager for all the android media player objects if they are |
1460 // created in the renderer process. | 1442 // created in the renderer process. |
1461 scoped_ptr<webkit_media::MediaPlayerBridgeManagerImpl> media_bridge_manager_; | 1443 scoped_ptr<webkit_media::MediaPlayerBridgeManagerImpl> media_bridge_manager_; |
1462 | 1444 |
1463 // Holds the message used to return find results to the browser during | 1445 // Holds the message used to return find results to the browser during |
1464 // synchronous find-in-page requests. Only non-null during these requests. | 1446 // synchronous find-in-page requests. Only non-null during these requests. |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1509 scoped_ptr<ExternalPopupMenu> external_popup_menu_; | 1491 scoped_ptr<ExternalPopupMenu> external_popup_menu_; |
1510 | 1492 |
1511 // The node that the context menu was pressed over. | 1493 // The node that the context menu was pressed over. |
1512 WebKit::WebNode context_menu_node_; | 1494 WebKit::WebNode context_menu_node_; |
1513 | 1495 |
1514 // Reports load progress to the browser. | 1496 // Reports load progress to the browser. |
1515 scoped_ptr<LoadProgressTracker> load_progress_tracker_; | 1497 scoped_ptr<LoadProgressTracker> load_progress_tracker_; |
1516 | 1498 |
1517 // All the registered observers. We expect this list to be small, so vector | 1499 // All the registered observers. We expect this list to be small, so vector |
1518 // is fine. | 1500 // is fine. |
1519 ObserverList<content::RenderViewObserver> observers_; | 1501 ObserverList<RenderViewObserver> observers_; |
1520 | 1502 |
1521 // Used to inform didChangeSelection() when it is called in the context | 1503 // Used to inform didChangeSelection() when it is called in the context |
1522 // of handling a ViewMsg_SelectRange IPC. | 1504 // of handling a ViewMsg_SelectRange IPC. |
1523 bool handling_select_range_; | 1505 bool handling_select_range_; |
1524 | 1506 |
1525 // Wraps the |webwidget_| as a MouseLockDispatcher::LockTarget interface. | 1507 // Wraps the |webwidget_| as a MouseLockDispatcher::LockTarget interface. |
1526 scoped_ptr<MouseLockDispatcher::LockTarget> webwidget_mouse_lock_target_; | 1508 scoped_ptr<MouseLockDispatcher::LockTarget> webwidget_mouse_lock_target_; |
1527 | 1509 |
1528 // Plugins ------------------------------------------------------------------- | 1510 // Plugins ------------------------------------------------------------------- |
1529 | 1511 |
1530 // All the currently active plugin delegates for this RenderView; kept so | 1512 // All the currently active plugin delegates for this RenderView; kept so |
1531 // that we can enumerate them to send updates about things like window | 1513 // that we can enumerate them to send updates about things like window |
1532 // location or tab focus and visibily. These are non-owning references. | 1514 // location or tab focus and visibily. These are non-owning references. |
1533 std::set<WebPluginDelegateProxy*> plugin_delegates_; | 1515 std::set<WebPluginDelegateProxy*> plugin_delegates_; |
1534 | 1516 |
1535 #if defined(OS_WIN) | 1517 #if defined(OS_WIN) |
1536 // The ID of the focused NPAPI plug-in. | 1518 // The ID of the focused NPAPI plug-in. |
1537 int focused_plugin_id_; | 1519 int focused_plugin_id_; |
1538 #endif | 1520 #endif |
1539 | 1521 |
1540 // Allows JS to access DOM automation. The JS object is only exposed when the | 1522 // Allows JS to access DOM automation. The JS object is only exposed when the |
1541 // DOM automation bindings are enabled. | 1523 // DOM automation bindings are enabled. |
1542 scoped_ptr<DomAutomationController> dom_automation_controller_; | 1524 scoped_ptr<DomAutomationController> dom_automation_controller_; |
1543 | 1525 |
1544 // Channel for communication with embedding renderer, if it exists. | 1526 // Channel for communication with embedding renderer, if it exists. |
1545 scoped_refptr<content::old::GuestToEmbedderChannel> | 1527 scoped_refptr<old::GuestToEmbedderChannel> guest_to_embedder_channel_; |
1546 guest_to_embedder_channel_; | |
1547 | 1528 |
1548 // The pepper instance identifer for this guest RenderView. | 1529 // The pepper instance identifer for this guest RenderView. |
1549 PP_Instance guest_pp_instance_; | 1530 PP_Instance guest_pp_instance_; |
1550 | 1531 |
1551 // The ppapi::HostResource associated with the on-screen context for this | 1532 // The ppapi::HostResource associated with the on-screen context for this |
1552 // guest RenderView. | 1533 // guest RenderView. |
1553 ppapi::HostResource guest_graphics_resource_; | 1534 ppapi::HostResource guest_graphics_resource_; |
1554 | 1535 |
1555 // This graphics context is initialized once GuestReady() is called. | 1536 // This graphics context is initialized once GuestReady() is called. |
1556 WebGraphicsContext3DCommandBufferImpl* guest_uninitialized_context_; | 1537 WebGraphicsContext3DCommandBufferImpl* guest_uninitialized_context_; |
(...skipping 25 matching lines...) Expand all Loading... | |
1582 // For further details, see the comments on ViewHostMsg_FrameTreeUpdated. | 1563 // For further details, see the comments on ViewHostMsg_FrameTreeUpdated. |
1583 int target_process_id_; | 1564 int target_process_id_; |
1584 int target_routing_id_; | 1565 int target_routing_id_; |
1585 | 1566 |
1586 // A map of the current process's frame ids to ids in the remote active render | 1567 // A map of the current process's frame ids to ids in the remote active render |
1587 // view, if this is a swapped out render view. | 1568 // view, if this is a swapped out render view. |
1588 std::map<int, int> active_frame_id_map_; | 1569 std::map<int, int> active_frame_id_map_; |
1589 | 1570 |
1590 // NOTE: pepper_delegate_ should be last member because its constructor calls | 1571 // NOTE: pepper_delegate_ should be last member because its constructor calls |
1591 // AddObservers method of RenderViewImpl from c-tor. | 1572 // AddObservers method of RenderViewImpl from c-tor. |
1592 content::PepperPluginDelegateImpl pepper_delegate_; | 1573 PepperPluginDelegateImpl pepper_delegate_; |
1593 | 1574 |
1594 // --------------------------------------------------------------------------- | 1575 // --------------------------------------------------------------------------- |
1595 // ADDING NEW DATA? Please see if it fits appropriately in one of the above | 1576 // ADDING NEW DATA? Please see if it fits appropriately in one of the above |
1596 // sections rather than throwing it randomly at the end. If you're adding a | 1577 // sections rather than throwing it randomly at the end. If you're adding a |
1597 // bunch of stuff, you should probably create a helper class and put your | 1578 // bunch of stuff, you should probably create a helper class and put your |
1598 // data and methods on that to avoid bloating RenderView more. You can | 1579 // data and methods on that to avoid bloating RenderView more. You can |
1599 // use the Observer interface to filter IPC messages and receive frame change | 1580 // use the Observer interface to filter IPC messages and receive frame change |
1600 // notifications. | 1581 // notifications. |
1601 // --------------------------------------------------------------------------- | 1582 // --------------------------------------------------------------------------- |
1602 | 1583 |
1603 DISALLOW_COPY_AND_ASSIGN(RenderViewImpl); | 1584 DISALLOW_COPY_AND_ASSIGN(RenderViewImpl); |
1604 }; | 1585 }; |
1605 | 1586 |
1587 } // namespace content | |
1588 | |
1606 #endif // CONTENT_RENDERER_RENDER_VIEW_IMPL_H_ | 1589 #endif // CONTENT_RENDERER_RENDER_VIEW_IMPL_H_ |
OLD | NEW |