[email protected] | 81375e87 | 2012-01-11 21:40:36 | [diff] [blame] | 1 | // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
[email protected] | 6e24cf1 | 2011-03-18 19:57:02 | [diff] [blame] | 2 | // Use of this source code is governed by a BSD-style license that can be |
| 3 | // found in the LICENSE file. |
| 4 | |
[email protected] | 310ebd630 | 2011-10-10 19:06:28 | [diff] [blame] | 5 | #ifndef CONTENT_RENDERER_RENDER_VIEW_IMPL_H_ |
| 6 | #define CONTENT_RENDERER_RENDER_VIEW_IMPL_H_ |
[email protected] | 6e24cf1 | 2011-03-18 19:57:02 | [diff] [blame] | 7 | #pragma once |
| 8 | |
| 9 | #include <deque> |
| 10 | #include <map> |
[email protected] | 6e24cf1 | 2011-03-18 19:57:02 | [diff] [blame] | 11 | #include <set> |
| 12 | #include <string> |
| 13 | #include <vector> |
| 14 | |
[email protected] | 6e24cf1 | 2011-03-18 19:57:02 | [diff] [blame] | 15 | #include "base/basictypes.h" |
| 16 | #include "base/gtest_prod_util.h" |
| 17 | #include "base/id_map.h" |
[email protected] | 3b63f8f4 | 2011-03-28 01:54:15 | [diff] [blame] | 18 | #include "base/memory/linked_ptr.h" |
| 19 | #include "base/memory/weak_ptr.h" |
[email protected] | 6e24cf1 | 2011-03-18 19:57:02 | [diff] [blame] | 20 | #include "base/observer_list.h" |
| 21 | #include "base/timer.h" |
[email protected] | 6e24cf1 | 2011-03-18 19:57:02 | [diff] [blame] | 22 | #include "build/build_config.h" |
[email protected] | 8d128d6 | 2011-09-13 22:11:57 | [diff] [blame] | 23 | #include "content/common/content_export.h" |
[email protected] | 5572215 | 2011-03-22 01:33:53 | [diff] [blame] | 24 | #include "content/common/edit_command.h" |
[email protected] | c26ad88 | 2012-02-07 06:41:20 | [diff] [blame] | 25 | #include "content/common/gpu/client/webgraphicscontext3d_command_buffer_impl.h" |
[email protected] | 6e24cf1 | 2011-03-18 19:57:02 | [diff] [blame] | 26 | #include "content/common/navigation_gesture.h" |
[email protected] | 3e3c452 | 2012-04-13 21:16:29 | [diff] [blame] | 27 | #include "content/common/view_message_enums.h" |
[email protected] | 54087fe | 2011-10-28 22:02:48 | [diff] [blame] | 28 | #include "content/public/common/page_zoom.h" |
[email protected] | 445e104 | 2011-12-03 21:03:15 | [diff] [blame] | 29 | #include "content/public/common/referrer.h" |
[email protected] | daf82f8 | 2011-10-31 22:35:31 | [diff] [blame] | 30 | #include "content/public/common/renderer_preferences.h" |
[email protected] | 815dd987 | 2011-11-23 18:40:30 | [diff] [blame] | 31 | #include "content/public/common/stop_find_action.h" |
[email protected] | a2ef54c | 2011-10-10 16:20:31 | [diff] [blame] | 32 | #include "content/public/renderer/render_view.h" |
[email protected] | 1e7e357 | 2012-02-22 00:25:08 | [diff] [blame] | 33 | #include "content/renderer/pepper/pepper_plugin_delegate_impl.h" |
[email protected] | 1e7e357 | 2012-02-22 00:25:08 | [diff] [blame] | 34 | #include "content/renderer/render_view_selection.h" |
[email protected] | 6e24cf1 | 2011-03-18 19:57:02 | [diff] [blame] | 35 | #include "content/renderer/render_widget.h" |
[email protected] | d353541f | 2012-05-03 22:45:41 | [diff] [blame] | 36 | #include "content/renderer/renderer_webcookiejar_impl.h" |
[email protected] | 6e24cf1 | 2011-03-18 19:57:02 | [diff] [blame] | 37 | #include "ipc/ipc_platform_file.h" |
[email protected] | 1e7e357 | 2012-02-22 00:25:08 | [diff] [blame] | 38 | #include "third_party/WebKit/Source/WebKit/chromium/public/WebConsoleMessage.h" |
[email protected] | 6e24cf1 | 2011-03-18 19:57:02 | [diff] [blame] | 39 | #include "third_party/WebKit/Source/WebKit/chromium/public/WebFrameClient.h" |
[email protected] | 6459800a | 2012-03-27 23:57:05 | [diff] [blame] | 40 | #include "third_party/WebKit/Source/WebKit/chromium/public/WebHistoryItem.h" |
[email protected] | 42054a25 | 2011-05-17 18:02:13 | [diff] [blame] | 41 | #include "third_party/WebKit/Source/WebKit/chromium/public/WebIconURL.h" |
[email protected] | d353541f | 2012-05-03 22:45:41 | [diff] [blame] | 42 | #include "third_party/WebKit/Source/WebKit/chromium/public/WebNavigationType.h" |
[email protected] | 6e24cf1 | 2011-03-18 19:57:02 | [diff] [blame] | 43 | #include "third_party/WebKit/Source/WebKit/chromium/public/WebNode.h" |
[email protected] | 18d5be9 | 2011-07-25 18:00:19 | [diff] [blame] | 44 | #include "third_party/WebKit/Source/WebKit/chromium/public/WebPageSerializerClient.h" |
[email protected] | 94dec93 | 2011-05-26 20:04:21 | [diff] [blame] | 45 | #include "third_party/WebKit/Source/WebKit/chromium/public/WebPageVisibilityState.h" |
[email protected] | f546640b | 2012-05-15 00:03:49 | [diff] [blame^] | 46 | #include "third_party/WebKit/Source/WebKit/chromium/public/WebSecurityOrigin.h" |
[email protected] | 6e24cf1 | 2011-03-18 19:57:02 | [diff] [blame] | 47 | #include "third_party/WebKit/Source/WebKit/chromium/public/WebTextDirection.h" |
| 48 | #include "third_party/WebKit/Source/WebKit/chromium/public/WebViewClient.h" |
[email protected] | d353541f | 2012-05-03 22:45:41 | [diff] [blame] | 49 | #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebFileSystem.h" |
[email protected] | 7e8b4d1 | 2012-01-20 23:39:51 | [diff] [blame] | 50 | #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebGraphicsContext3D.h" |
[email protected] | 269f86d | 2011-12-07 02:43:47 | [diff] [blame] | 51 | #include "ui/base/javascript_message_type.h" |
[email protected] | d353541f | 2012-05-03 22:45:41 | [diff] [blame] | 52 | #include "ui/surface/transport_dib.h" |
[email protected] | 6e24cf1 | 2011-03-18 19:57:02 | [diff] [blame] | 53 | #include "webkit/glue/webpreferences.h" |
[email protected] | a9288f5 | 2011-11-17 05:18:16 | [diff] [blame] | 54 | #include "webkit/media/webmediaplayer_delegate.h" |
[email protected] | 6e24cf1 | 2011-03-18 19:57:02 | [diff] [blame] | 55 | #include "webkit/plugins/npapi/webplugin_page_delegate.h" |
| 56 | |
[email protected] | 9f76c1e | 2012-03-05 15:15:58 | [diff] [blame] | 57 | #if defined(COMPILER_MSVC) |
[email protected] | 310ebd630 | 2011-10-10 19:06:28 | [diff] [blame] | 58 | // RenderViewImpl is a diamond-shaped hierarchy, with WebWidgetClient at the |
| 59 | // root. VS warns when we inherit the WebWidgetClient method implementations |
| 60 | // from RenderWidget. It's safe to ignore that warning. |
[email protected] | 6e24cf1 | 2011-03-18 19:57:02 | [diff] [blame] | 61 | #pragma warning(disable: 4250) |
| 62 | #endif |
| 63 | |
[email protected] | 5b52cd2f71 | 2012-03-28 02:12:48 | [diff] [blame] | 64 | class CommandLine; |
[email protected] | 6e24cf1 | 2011-03-18 19:57:02 | [diff] [blame] | 65 | class DeviceOrientationDispatcher; |
[email protected] | c5c1d6d | 2011-07-28 18:42:41 | [diff] [blame] | 66 | class DevToolsAgent; |
[email protected] | 766a708 | 2012-02-03 23:39:15 | [diff] [blame] | 67 | class DomAutomationController; |
[email protected] | 5572215 | 2011-03-22 01:33:53 | [diff] [blame] | 68 | class ExternalPopupMenu; |
[email protected] | 6e24cf1 | 2011-03-18 19:57:02 | [diff] [blame] | 69 | class GeolocationDispatcher; |
[email protected] | 6e24cf1 | 2011-03-18 19:57:02 | [diff] [blame] | 70 | class GURL; |
[email protected] | 7f3c7af | 2011-10-20 22:52:51 | [diff] [blame] | 71 | class JavaBridgeDispatcher; |
[email protected] | 6e24cf1 | 2011-03-18 19:57:02 | [diff] [blame] | 72 | class LoadProgressTracker; |
[email protected] | 273558fb | 2012-01-12 15:03:51 | [diff] [blame] | 73 | class MediaStreamDispatcher; |
[email protected] | ab2c473 | 2011-07-20 19:57:40 | [diff] [blame] | 74 | class MediaStreamImpl; |
[email protected] | 217690d | 2012-01-27 07:33:11 | [diff] [blame] | 75 | class MouseLockDispatcher; |
[email protected] | 6e24cf1 | 2011-03-18 19:57:02 | [diff] [blame] | 76 | class NotificationProvider; |
[email protected] | 6e24cf1 | 2011-03-18 19:57:02 | [diff] [blame] | 77 | class PepperDeviceTest; |
[email protected] | 83f93d3 | 2011-11-11 00:43:30 | [diff] [blame] | 78 | struct PP_NetAddress_Private; |
[email protected] | ea192e8 | 2011-04-11 19:16:02 | [diff] [blame] | 79 | class RenderWidgetFullscreenPepper; |
[email protected] | 063afcb | 2011-09-29 07:54:32 | [diff] [blame] | 80 | class RendererAccessibility; |
[email protected] | da854376 | 2012-03-20 08:52:20 | [diff] [blame] | 81 | class RendererWebColorChooserImpl; |
[email protected] | 6e24cf1 | 2011-03-18 19:57:02 | [diff] [blame] | 82 | class SkBitmap; |
[email protected] | c52b289 | 2012-03-07 11:01:02 | [diff] [blame] | 83 | class InputTagSpeechDispatcher; |
[email protected] | 6e24cf1 | 2011-03-18 19:57:02 | [diff] [blame] | 84 | struct ViewMsg_Navigate_Params; |
[email protected] | f546640b | 2012-05-15 00:03:49 | [diff] [blame^] | 85 | struct ViewMsg_PostMessage_Params; |
[email protected] | 6e24cf1 | 2011-03-18 19:57:02 | [diff] [blame] | 86 | struct ViewMsg_StopFinding_Params; |
[email protected] | 83f93d3 | 2011-11-11 00:43:30 | [diff] [blame] | 87 | struct ViewMsg_SwapOut_Params; |
[email protected] | 6e24cf1 | 2011-03-18 19:57:02 | [diff] [blame] | 88 | struct WebDropData; |
[email protected] | 0d9989d | 2011-12-21 20:26:00 | [diff] [blame] | 89 | class WebIntentsHost; |
[email protected] | 83f93d3 | 2011-11-11 00:43:30 | [diff] [blame] | 90 | class WebPluginDelegateProxy; |
| 91 | class WebUIBindings; |
[email protected] | b3f8f972 | 2011-08-25 20:56:07 | [diff] [blame] | 92 | |
| 93 | namespace content { |
[email protected] | 007733c | 2011-11-17 00:34:07 | [diff] [blame] | 94 | class DocumentState; |
[email protected] | 45d83a1 | 2012-04-06 22:57:57 | [diff] [blame] | 95 | class NavigationState; |
[email protected] | b3f8f972 | 2011-08-25 20:56:07 | [diff] [blame] | 96 | class P2PSocketDispatcher; |
[email protected] | 3a034ebb | 2011-10-03 19:19:44 | [diff] [blame] | 97 | class RenderViewObserver; |
[email protected] | 007733c | 2011-11-17 00:34:07 | [diff] [blame] | 98 | class RenderViewTest; |
[email protected] | 35be7ec | 2012-02-12 20:42:51 | [diff] [blame] | 99 | struct CustomContextMenuContext; |
[email protected] | 8caadeb | 2011-11-22 02:45:23 | [diff] [blame] | 100 | struct FileChooserParams; |
[email protected] | fb11b6a4 | 2012-03-14 07:25:12 | [diff] [blame] | 101 | struct SelectedFileInfo; |
[email protected] | b3f8f972 | 2011-08-25 20:56:07 | [diff] [blame] | 102 | } // namespace content |
[email protected] | 6e24cf1 | 2011-03-18 19:57:02 | [diff] [blame] | 103 | |
[email protected] | 6e24cf1 | 2011-03-18 19:57:02 | [diff] [blame] | 104 | namespace gfx { |
| 105 | class Point; |
| 106 | class Rect; |
[email protected] | b3f8f972 | 2011-08-25 20:56:07 | [diff] [blame] | 107 | } // namespace gfx |
[email protected] | 6e24cf1 | 2011-03-18 19:57:02 | [diff] [blame] | 108 | |
| 109 | namespace webkit { |
| 110 | |
[email protected] | 6e24cf1 | 2011-03-18 19:57:02 | [diff] [blame] | 111 | namespace ppapi { |
[email protected] | 6e24cf1 | 2011-03-18 19:57:02 | [diff] [blame] | 112 | class PluginInstance; |
[email protected] | 6e24cf1 | 2011-03-18 19:57:02 | [diff] [blame] | 113 | } // namespace ppapi |
| 114 | |
| 115 | } // namespace webkit |
| 116 | |
| 117 | namespace webkit_glue { |
[email protected] | 6e24cf1 | 2011-03-18 19:57:02 | [diff] [blame] | 118 | class ImageResourceFetcher; |
[email protected] | 6e24cf1 | 2011-03-18 19:57:02 | [diff] [blame] | 119 | class ResourceFetcher; |
| 120 | } |
| 121 | |
| 122 | namespace WebKit { |
[email protected] | 6e24cf1 | 2011-03-18 19:57:02 | [diff] [blame] | 123 | class WebApplicationCacheHost; |
| 124 | class WebApplicationCacheHostClient; |
[email protected] | f546640b | 2012-05-15 00:03:49 | [diff] [blame^] | 125 | class WebDOMMessageEvent; |
[email protected] | 6e24cf1 | 2011-03-18 19:57:02 | [diff] [blame] | 126 | class WebDataSource; |
[email protected] | 6e24cf1 | 2011-03-18 19:57:02 | [diff] [blame] | 127 | class WebDragData; |
[email protected] | 6e24cf1 | 2011-03-18 19:57:02 | [diff] [blame] | 128 | class WebGeolocationClient; |
[email protected] | 42054a25 | 2011-05-17 18:02:13 | [diff] [blame] | 129 | class WebIconURL; |
[email protected] | 6e24cf1 | 2011-03-18 19:57:02 | [diff] [blame] | 130 | class WebImage; |
[email protected] | 50da23d0 | 2012-04-13 17:47:48 | [diff] [blame] | 131 | class WebPeerConnection00Handler; |
| 132 | class WebPeerConnection00HandlerClient; |
[email protected] | 6e24cf1 | 2011-03-18 19:57:02 | [diff] [blame] | 133 | class WebMediaPlayer; |
| 134 | class WebMediaPlayerClient; |
| 135 | class WebMouseEvent; |
[email protected] | 273558fb | 2012-01-12 15:03:51 | [diff] [blame] | 136 | class WebPeerConnectionHandler; |
| 137 | class WebPeerConnectionHandlerClient; |
[email protected] | 5fa3a06 | 2012-03-21 15:39:34 | [diff] [blame] | 138 | class WebSocketStreamHandle; |
[email protected] | 6e24cf1 | 2011-03-18 19:57:02 | [diff] [blame] | 139 | class WebSpeechInputController; |
| 140 | class WebSpeechInputListener; |
| 141 | class WebStorageNamespace; |
[email protected] | 2d0f2e9 | 2011-10-03 09:02:24 | [diff] [blame] | 142 | class WebTouchEvent; |
[email protected] | b00ba70 | 2011-08-17 01:41:03 | [diff] [blame] | 143 | class WebURLLoader; |
[email protected] | 6e24cf1 | 2011-03-18 19:57:02 | [diff] [blame] | 144 | class WebURLRequest; |
[email protected] | 273558fb | 2012-01-12 15:03:51 | [diff] [blame] | 145 | class WebUserMediaClient; |
[email protected] | 7a1ec28a | 2012-03-28 21:10:24 | [diff] [blame] | 146 | struct WebActiveWheelFlingParameters; |
[email protected] | 6e24cf1 | 2011-03-18 19:57:02 | [diff] [blame] | 147 | struct WebFileChooserParams; |
| 148 | struct WebFindOptions; |
| 149 | struct WebMediaPlayerAction; |
[email protected] | 81375e87 | 2012-01-11 21:40:36 | [diff] [blame] | 150 | struct WebPluginAction; |
[email protected] | 6e24cf1 | 2011-03-18 19:57:02 | [diff] [blame] | 151 | struct WebPoint; |
| 152 | struct WebWindowFeatures; |
| 153 | } |
| 154 | |
| 155 | // We need to prevent a page from trying to create infinite popups. It is not |
| 156 | // as simple as keeping a count of the number of immediate children |
| 157 | // popups. Having an html file that window.open()s itself would create |
| 158 | // an unlimited chain of RenderViews who only have one RenderView child. |
| 159 | // |
| 160 | // Therefore, each new top level RenderView creates a new counter and shares it |
[email protected] | 310ebd630 | 2011-10-10 19:06:28 | [diff] [blame] | 161 | // with all its children and grandchildren popup RenderViewImpls created with |
[email protected] | 6e24cf1 | 2011-03-18 19:57:02 | [diff] [blame] | 162 | // createView() to have a sort of global limit for the page so no more than |
| 163 | // kMaximumNumberOfPopups popups are created. |
| 164 | // |
| 165 | // This is a RefCounted holder of an int because I can't say |
| 166 | // scoped_refptr<int>. |
| 167 | typedef base::RefCountedData<int> SharedRenderViewCounter; |
| 168 | |
| 169 | // |
| 170 | // RenderView is an object that manages a WebView object, and provides a |
| 171 | // communication interface with an embedding application process |
| 172 | // |
[email protected] | 310ebd630 | 2011-10-10 19:06:28 | [diff] [blame] | 173 | class RenderViewImpl : public RenderWidget, |
| 174 | public WebKit::WebViewClient, |
| 175 | public WebKit::WebFrameClient, |
| 176 | public WebKit::WebPageSerializerClient, |
| 177 | public content::RenderView, |
| 178 | public webkit::npapi::WebPluginPageDelegate, |
[email protected] | a9288f5 | 2011-11-17 05:18:16 | [diff] [blame] | 179 | public webkit_media::WebMediaPlayerDelegate, |
[email protected] | b3e83de | 2012-02-07 03:33:28 | [diff] [blame] | 180 | public WebGraphicsContext3DSwapBuffersClient, |
[email protected] | 310ebd630 | 2011-10-10 19:06:28 | [diff] [blame] | 181 | public base::SupportsWeakPtr<RenderViewImpl> { |
[email protected] | 6e24cf1 | 2011-03-18 19:57:02 | [diff] [blame] | 182 | public: |
| 183 | // Creates a new RenderView. The parent_hwnd specifies a HWND to use as the |
[email protected] | 5f9de588 | 2011-09-30 23:36:28 | [diff] [blame] | 184 | // parent of the WebView HWND that will be created. If this is a blocked |
[email protected] | 6e24cf1 | 2011-03-18 19:57:02 | [diff] [blame] | 185 | // popup or as a new tab, opener_id is the routing ID of the RenderView |
| 186 | // responsible for creating this RenderView (corresponding to parent_hwnd). |
| 187 | // |counter| is either a currently initialized counter, or NULL (in which case |
| 188 | // we treat this RenderView as a top level window). |
[email protected] | 310ebd630 | 2011-10-10 19:06:28 | [diff] [blame] | 189 | CONTENT_EXPORT static RenderViewImpl* Create( |
[email protected] | 6e24cf1 | 2011-03-18 19:57:02 | [diff] [blame] | 190 | gfx::NativeViewId parent_hwnd, |
| 191 | int32 opener_id, |
[email protected] | daf82f8 | 2011-10-31 22:35:31 | [diff] [blame] | 192 | const content::RendererPreferences& renderer_prefs, |
[email protected] | 6717bf27 | 2012-05-11 23:31:25 | [diff] [blame] | 193 | const webkit_glue::WebPreferences& webkit_prefs, |
[email protected] | 6e24cf1 | 2011-03-18 19:57:02 | [diff] [blame] | 194 | SharedRenderViewCounter* counter, |
| 195 | int32 routing_id, |
[email protected] | 9f4f332 | 2012-01-18 22:29:56 | [diff] [blame] | 196 | int32 surface_id, |
[email protected] | 6e24cf1 | 2011-03-18 19:57:02 | [diff] [blame] | 197 | int64 session_storage_namespace_id, |
[email protected] | 74ce1ad | 2011-12-16 21:51:46 | [diff] [blame] | 198 | const string16& frame_name, |
[email protected] | 14392a5 | 2012-05-02 20:28:44 | [diff] [blame] | 199 | bool is_renderer_created, |
| 200 | bool swapped_out, |
[email protected] | 6fd35b7 | 2012-03-01 19:46:41 | [diff] [blame] | 201 | int32 next_page_id, |
[email protected] | 8cca3da | 2012-03-20 08:26:34 | [diff] [blame] | 202 | const WebKit::WebScreenInfo& screen_info, |
[email protected] | 3e3c452 | 2012-04-13 21:16:29 | [diff] [blame] | 203 | bool guest, |
| 204 | AccessibilityMode accessibility_mode); |
[email protected] | 6e24cf1 | 2011-03-18 19:57:02 | [diff] [blame] | 205 | |
[email protected] | 310ebd630 | 2011-10-10 19:06:28 | [diff] [blame] | 206 | // Returns the RenderViewImpl containing the given WebView. |
| 207 | CONTENT_EXPORT static RenderViewImpl* FromWebView(WebKit::WebView* webview); |
[email protected] | 6e24cf1 | 2011-03-18 19:57:02 | [diff] [blame] | 208 | |
[email protected] | 6e24cf1 | 2011-03-18 19:57:02 | [diff] [blame] | 209 | // May return NULL when the view is closing. |
[email protected] | 8d128d6 | 2011-09-13 22:11:57 | [diff] [blame] | 210 | CONTENT_EXPORT WebKit::WebView* webview() const; |
[email protected] | 6e24cf1 | 2011-03-18 19:57:02 | [diff] [blame] | 211 | |
[email protected] | b3e83de | 2012-02-07 03:33:28 | [diff] [blame] | 212 | // WebGraphicsContext3DSwapBuffersClient implementation. |
| 213 | |
[email protected] | 6522577 | 2011-05-12 21:10:24 | [diff] [blame] | 214 | // Called by a GraphicsContext associated with this view when swapbuffers |
[email protected] | 37a6f30 | 2011-07-11 23:43:08 | [diff] [blame] | 215 | // is posted, completes or is aborted. |
[email protected] | b3e83de | 2012-02-07 03:33:28 | [diff] [blame] | 216 | virtual void OnViewContextSwapBuffersPosted() OVERRIDE; |
| 217 | virtual void OnViewContextSwapBuffersComplete() OVERRIDE; |
| 218 | virtual void OnViewContextSwapBuffersAborted() OVERRIDE; |
[email protected] | 6522577 | 2011-05-12 21:10:24 | [diff] [blame] | 219 | |
[email protected] | d466b8a | 2011-07-15 21:48:03 | [diff] [blame] | 220 | int history_list_offset() const { return history_list_offset_; } |
[email protected] | 6e24cf1 | 2011-03-18 19:57:02 | [diff] [blame] | 221 | |
[email protected] | 6717bf27 | 2012-05-11 23:31:25 | [diff] [blame] | 222 | const webkit_glue::WebPreferences& webkit_preferences() const { |
[email protected] | 6e24cf1 | 2011-03-18 19:57:02 | [diff] [blame] | 223 | return webkit_preferences_; |
| 224 | } |
| 225 | |
| 226 | void set_send_content_state_immediately(bool value) { |
| 227 | send_content_state_immediately_ = value; |
| 228 | } |
| 229 | |
[email protected] | 273558fb | 2012-01-12 15:03:51 | [diff] [blame] | 230 | MediaStreamDispatcher* media_stream_dispatcher() { |
| 231 | return media_stream_dispatcher_; |
| 232 | } |
| 233 | |
[email protected] | 6e24cf1 | 2011-03-18 19:57:02 | [diff] [blame] | 234 | // Current P2PSocketDispatcher. Set to NULL if P2P API is disabled. |
[email protected] | b3f8f972 | 2011-08-25 20:56:07 | [diff] [blame] | 235 | content::P2PSocketDispatcher* p2p_socket_dispatcher() { |
[email protected] | 6e24cf1 | 2011-03-18 19:57:02 | [diff] [blame] | 236 | return p2p_socket_dispatcher_; |
| 237 | } |
| 238 | |
[email protected] | 217690d | 2012-01-27 07:33:11 | [diff] [blame] | 239 | MouseLockDispatcher* mouse_lock_dispatcher() { |
| 240 | return mouse_lock_dispatcher_; |
| 241 | } |
| 242 | |
[email protected] | 273558fb | 2012-01-12 15:03:51 | [diff] [blame] | 243 | WebKit::WebPeerConnectionHandler* CreatePeerConnectionHandler( |
| 244 | WebKit::WebPeerConnectionHandlerClient* client); |
[email protected] | 50da23d0 | 2012-04-13 17:47:48 | [diff] [blame] | 245 | WebKit::WebPeerConnection00Handler* CreatePeerConnectionHandlerJsep( |
| 246 | WebKit::WebPeerConnection00HandlerClient* client); |
[email protected] | 273558fb | 2012-01-12 15:03:51 | [diff] [blame] | 247 | |
[email protected] | 6e24cf1 | 2011-03-18 19:57:02 | [diff] [blame] | 248 | // Functions to add and remove observers for this object. |
[email protected] | 3a034ebb | 2011-10-03 19:19:44 | [diff] [blame] | 249 | void AddObserver(content::RenderViewObserver* observer); |
| 250 | void RemoveObserver(content::RenderViewObserver* observer); |
[email protected] | 6e24cf1 | 2011-03-18 19:57:02 | [diff] [blame] | 251 | |
[email protected] | 6e24cf1 | 2011-03-18 19:57:02 | [diff] [blame] | 252 | // Adds the given file chooser request to the file_chooser_completion_ queue |
| 253 | // (see that var for more) and requests the chooser be displayed if there are |
| 254 | // no other waiting items in the queue. |
| 255 | // |
| 256 | // Returns true if the chooser was successfully scheduled. False means we |
| 257 | // didn't schedule anything. |
[email protected] | 8caadeb | 2011-11-22 02:45:23 | [diff] [blame] | 258 | bool ScheduleFileChooser(const content::FileChooserParams& params, |
[email protected] | 6e24cf1 | 2011-03-18 19:57:02 | [diff] [blame] | 259 | WebKit::WebFileChooserCompletion* completion); |
| 260 | |
[email protected] | 6e24cf1 | 2011-03-18 19:57:02 | [diff] [blame] | 261 | // Sets whether the renderer should report load progress to the browser. |
| 262 | void SetReportLoadProgressEnabled(bool enabled); |
| 263 | |
[email protected] | 2ac2be8b | 2012-03-21 23:11:28 | [diff] [blame] | 264 | bool guest() const { return guest_; } |
| 265 | |
[email protected] | a2ef54c | 2011-10-10 16:20:31 | [diff] [blame] | 266 | void LoadNavigationErrorPage( |
[email protected] | 8d128d6 | 2011-09-13 22:11:57 | [diff] [blame] | 267 | WebKit::WebFrame* frame, |
| 268 | const WebKit::WebURLRequest& failed_request, |
| 269 | const WebKit::WebURLError& error, |
| 270 | const std::string& html, |
| 271 | bool replace); |
[email protected] | 9966325b | 2011-04-18 05:00:10 | [diff] [blame] | 272 | |
[email protected] | 6e24cf1 | 2011-03-18 19:57:02 | [diff] [blame] | 273 | // Plugin-related functions -------------------------------------------------- |
| 274 | // (See also WebPluginPageDelegate implementation.) |
| 275 | |
| 276 | // Notification that the given plugin has crashed. |
| 277 | void PluginCrashed(const FilePath& plugin_path); |
| 278 | |
[email protected] | 6e24cf1 | 2011-03-18 19:57:02 | [diff] [blame] | 279 | // Creates a fullscreen container for a pepper plugin instance. |
[email protected] | ea192e8 | 2011-04-11 19:16:02 | [diff] [blame] | 280 | RenderWidgetFullscreenPepper* CreatePepperFullscreenContainer( |
[email protected] | 6e24cf1 | 2011-03-18 19:57:02 | [diff] [blame] | 281 | webkit::ppapi::PluginInstance* plugin); |
| 282 | |
[email protected] | 56ea1a6 | 2011-05-30 07:05:57 | [diff] [blame] | 283 | // Informs the render view that a PPAPI plugin has gained or lost focus. |
| 284 | void PpapiPluginFocusChanged(); |
| 285 | |
[email protected] | 73bf9581 | 2011-10-12 11:38:32 | [diff] [blame] | 286 | // Informs the render view that a PPAPI plugin has changed text input status. |
| 287 | void PpapiPluginTextInputTypeChanged(); |
[email protected] | 3f78336 | 2011-10-21 22:40:50 | [diff] [blame] | 288 | void PpapiPluginCaretPositionChanged(); |
[email protected] | 73bf9581 | 2011-10-12 11:38:32 | [diff] [blame] | 289 | |
| 290 | // Cancels current composition. |
| 291 | void PpapiPluginCancelComposition(); |
| 292 | |
[email protected] | 3c8c74c | 2012-03-15 07:34:52 | [diff] [blame] | 293 | // Informs the render view that a PPAPI plugin has changed selection. |
| 294 | void PpapiPluginSelectionChanged(); |
| 295 | |
[email protected] | b25b3ee | 2012-01-13 05:19:54 | [diff] [blame] | 296 | // Retrieves the current caret position if a PPAPI plugin has focus. |
| 297 | bool GetPpapiPluginCaretBounds(gfx::Rect* rect); |
| 298 | |
[email protected] | e6ae0f6c | 2011-10-04 10:39:23 | [diff] [blame] | 299 | #if defined(OS_MACOSX) || defined(OS_WIN) |
[email protected] | 6e24cf1 | 2011-03-18 19:57:02 | [diff] [blame] | 300 | // Informs the render view that the given plugin has gained or lost focus. |
| 301 | void PluginFocusChanged(bool focused, int plugin_id); |
[email protected] | e6ae0f6c | 2011-10-04 10:39:23 | [diff] [blame] | 302 | #endif |
[email protected] | 6e24cf1 | 2011-03-18 19:57:02 | [diff] [blame] | 303 | |
[email protected] | e6ae0f6c | 2011-10-04 10:39:23 | [diff] [blame] | 304 | #if defined(OS_MACOSX) |
[email protected] | 6e24cf1 | 2011-03-18 19:57:02 | [diff] [blame] | 305 | // Starts plugin IME. |
| 306 | void StartPluginIme(); |
| 307 | |
| 308 | // Helper routines for accelerated plugin support. Used by the |
| 309 | // WebPluginDelegateProxy, which has a pointer to the RenderView. |
| 310 | gfx::PluginWindowHandle AllocateFakePluginWindowHandle(bool opaque, |
| 311 | bool root); |
| 312 | void DestroyFakePluginWindowHandle(gfx::PluginWindowHandle window); |
| 313 | void AcceleratedSurfaceSetIOSurface(gfx::PluginWindowHandle window, |
| 314 | int32 width, |
| 315 | int32 height, |
| 316 | uint64 io_surface_identifier); |
| 317 | TransportDIB::Handle AcceleratedSurfaceAllocTransportDIB(size_t size); |
| 318 | void AcceleratedSurfaceFreeTransportDIB(TransportDIB::Id dib_id); |
| 319 | void AcceleratedSurfaceSetTransportDIB(gfx::PluginWindowHandle window, |
| 320 | int32 width, |
| 321 | int32 height, |
| 322 | TransportDIB::Handle transport_dib); |
| 323 | void AcceleratedSurfaceBuffersSwapped(gfx::PluginWindowHandle window, |
| 324 | uint64 surface_id); |
| 325 | #endif |
| 326 | |
| 327 | void RegisterPluginDelegate(WebPluginDelegateProxy* delegate); |
| 328 | void UnregisterPluginDelegate(WebPluginDelegateProxy* delegate); |
| 329 | |
[email protected] | 4a7d639 | 2011-09-19 20:55:08 | [diff] [blame] | 330 | // Helper function to retrieve information about a plugin for a URL and mime |
| 331 | // type. Returns false if no plugin was found. |
| 332 | // |actual_mime_type| is the actual mime type supported by the |
| 333 | // plugin found that match the URL given (one for each item in |
| 334 | // |info|). |
[email protected] | 84c13c03 | 2011-09-23 00:12:22 | [diff] [blame] | 335 | CONTENT_EXPORT bool GetPluginInfo(const GURL& url, |
| 336 | const GURL& page_url, |
| 337 | const std::string& mime_type, |
| 338 | webkit::WebPluginInfo* plugin_info, |
| 339 | std::string* actual_mime_type); |
[email protected] | 4a7d639 | 2011-09-19 20:55:08 | [diff] [blame] | 340 | |
[email protected] | 7a1ec28a | 2012-03-28 21:10:24 | [diff] [blame] | 341 | void TransferActiveWheelFlingAnimation( |
| 342 | const WebKit::WebActiveWheelFlingParameters& params); |
| 343 | |
[email protected] | 6e24cf1 | 2011-03-18 19:57:02 | [diff] [blame] | 344 | // IPC::Channel::Listener implementation ------------------------------------- |
| 345 | |
[email protected] | edc64de | 2011-11-17 20:07:38 | [diff] [blame] | 346 | virtual bool OnMessageReceived(const IPC::Message& msg) OVERRIDE; |
[email protected] | 6e24cf1 | 2011-03-18 19:57:02 | [diff] [blame] | 347 | |
| 348 | // WebKit::WebWidgetClient implementation ------------------------------------ |
| 349 | |
| 350 | // Most methods are handled by RenderWidget. |
| 351 | virtual void didFocus(); |
| 352 | virtual void didBlur(); |
| 353 | virtual void show(WebKit::WebNavigationPolicy policy); |
| 354 | virtual void runModal(); |
[email protected] | 2b624c56 | 2011-10-27 22:58:26 | [diff] [blame] | 355 | virtual bool enterFullScreen(); |
| 356 | virtual void exitFullScreen(); |
[email protected] | 217690d | 2012-01-27 07:33:11 | [diff] [blame] | 357 | virtual bool requestPointerLock(); |
| 358 | virtual void requestPointerUnlock(); |
| 359 | virtual bool isPointerLocked(); |
[email protected] | 7a1ec28a | 2012-03-28 21:10:24 | [diff] [blame] | 360 | virtual void didActivateCompositor(int input_handler_identifier); |
[email protected] | 6e24cf1 | 2011-03-18 19:57:02 | [diff] [blame] | 361 | |
| 362 | // WebKit::WebViewClient implementation -------------------------------------- |
| 363 | |
| 364 | virtual WebKit::WebView* createView( |
| 365 | WebKit::WebFrame* creator, |
| 366 | const WebKit::WebURLRequest& request, |
| 367 | const WebKit::WebWindowFeatures& features, |
[email protected] | 916dfb6 | 2012-03-05 03:39:37 | [diff] [blame] | 368 | const WebKit::WebString& frame_name, |
| 369 | WebKit::WebNavigationPolicy policy); |
[email protected] | 6e24cf1 | 2011-03-18 19:57:02 | [diff] [blame] | 370 | virtual WebKit::WebWidget* createPopupMenu(WebKit::WebPopupType popup_type); |
[email protected] | 6e24cf1 | 2011-03-18 19:57:02 | [diff] [blame] | 371 | virtual WebKit::WebExternalPopupMenu* createExternalPopupMenu( |
| 372 | const WebKit::WebPopupMenuInfo& popup_menu_info, |
| 373 | WebKit::WebExternalPopupMenuClient* popup_menu_client); |
| 374 | virtual WebKit::WebStorageNamespace* createSessionStorageNamespace( |
| 375 | unsigned quota); |
[email protected] | 7e8b4d1 | 2012-01-20 23:39:51 | [diff] [blame] | 376 | virtual WebKit::WebGraphicsContext3D* createGraphicsContext3D( |
[email protected] | 40ec0c1 | 2012-03-08 12:34:40 | [diff] [blame] | 377 | const WebKit::WebGraphicsContext3D::Attributes& attributes); |
[email protected] | 6e24cf1 | 2011-03-18 19:57:02 | [diff] [blame] | 378 | virtual void didAddMessageToConsole( |
| 379 | const WebKit::WebConsoleMessage& message, |
| 380 | const WebKit::WebString& source_name, |
| 381 | unsigned source_line); |
| 382 | virtual void printPage(WebKit::WebFrame* frame); |
| 383 | virtual WebKit::WebNotificationPresenter* notificationPresenter(); |
[email protected] | 8a58c1c | 2011-04-19 18:40:12 | [diff] [blame] | 384 | virtual bool enumerateChosenDirectory( |
| 385 | const WebKit::WebString& path, |
| 386 | WebKit::WebFileChooserCompletion* chooser_completion); |
[email protected] | 6e24cf1 | 2011-03-18 19:57:02 | [diff] [blame] | 387 | virtual void didStartLoading(); |
| 388 | virtual void didStopLoading(); |
| 389 | virtual void didChangeLoadProgress(WebKit::WebFrame* frame, |
| 390 | double load_progress); |
| 391 | virtual bool isSmartInsertDeleteEnabled(); |
| 392 | virtual bool isSelectTrailingWhitespaceEnabled(); |
| 393 | virtual void didChangeSelection(bool is_selection_empty); |
| 394 | virtual void didExecuteCommand(const WebKit::WebString& command_name); |
| 395 | virtual bool handleCurrentKeyboardEvent(); |
[email protected] | da854376 | 2012-03-20 08:52:20 | [diff] [blame] | 396 | virtual WebKit::WebColorChooser* createColorChooser( |
| 397 | WebKit::WebColorChooserClient*, const WebKit::WebColor& initial_color); |
[email protected] | 6e24cf1 | 2011-03-18 19:57:02 | [diff] [blame] | 398 | virtual bool runFileChooser( |
| 399 | const WebKit::WebFileChooserParams& params, |
| 400 | WebKit::WebFileChooserCompletion* chooser_completion); |
| 401 | virtual void runModalAlertDialog(WebKit::WebFrame* frame, |
| 402 | const WebKit::WebString& message); |
| 403 | virtual bool runModalConfirmDialog(WebKit::WebFrame* frame, |
| 404 | const WebKit::WebString& message); |
| 405 | virtual bool runModalPromptDialog(WebKit::WebFrame* frame, |
| 406 | const WebKit::WebString& message, |
| 407 | const WebKit::WebString& default_value, |
| 408 | WebKit::WebString* actual_value); |
| 409 | virtual bool runModalBeforeUnloadDialog(WebKit::WebFrame* frame, |
| 410 | const WebKit::WebString& message); |
| 411 | virtual void showContextMenu(WebKit::WebFrame* frame, |
| 412 | const WebKit::WebContextMenuData& data); |
[email protected] | 6e24cf1 | 2011-03-18 19:57:02 | [diff] [blame] | 413 | virtual void setStatusText(const WebKit::WebString& text); |
| 414 | virtual void setMouseOverURL(const WebKit::WebURL& url); |
| 415 | virtual void setKeyboardFocusURL(const WebKit::WebURL& url); |
[email protected] | 6e24cf1 | 2011-03-18 19:57:02 | [diff] [blame] | 416 | virtual void startDragging(const WebKit::WebDragData& data, |
| 417 | WebKit::WebDragOperationsMask mask, |
| 418 | const WebKit::WebImage& image, |
| 419 | const WebKit::WebPoint& imageOffset); |
| 420 | virtual bool acceptsLoadDrops(); |
| 421 | virtual void focusNext(); |
| 422 | virtual void focusPrevious(); |
| 423 | virtual void focusedNodeChanged(const WebKit::WebNode& node); |
[email protected] | 169d428 | 2011-11-30 19:33:59 | [diff] [blame] | 424 | virtual void didUpdateLayout(); |
[email protected] | 6e24cf1 | 2011-03-18 19:57:02 | [diff] [blame] | 425 | virtual void navigateBackForwardSoon(int offset); |
| 426 | virtual int historyBackListCount(); |
| 427 | virtual int historyForwardListCount(); |
| 428 | virtual void postAccessibilityNotification( |
| 429 | const WebKit::WebAccessibilityObject& obj, |
| 430 | WebKit::WebAccessibilityNotification notification); |
| 431 | virtual void didUpdateInspectorSetting(const WebKit::WebString& key, |
| 432 | const WebKit::WebString& value); |
| 433 | virtual WebKit::WebGeolocationClient* geolocationClient(); |
| 434 | virtual WebKit::WebSpeechInputController* speechInputController( |
| 435 | WebKit::WebSpeechInputListener* listener); |
| 436 | virtual WebKit::WebDeviceOrientationClient* deviceOrientationClient(); |
| 437 | virtual void zoomLimitsChanged(double minimum_level, double maximum_level); |
| 438 | virtual void zoomLevelChanged(); |
| 439 | virtual void registerProtocolHandler(const WebKit::WebString& scheme, |
| 440 | const WebKit::WebString& base_url, |
| 441 | const WebKit::WebString& url, |
| 442 | const WebKit::WebString& title); |
[email protected] | 94dec93 | 2011-05-26 20:04:21 | [diff] [blame] | 443 | virtual WebKit::WebPageVisibilityState visibilityState() const; |
[email protected] | 273558fb | 2012-01-12 15:03:51 | [diff] [blame] | 444 | virtual WebKit::WebUserMediaClient* userMediaClient(); |
[email protected] | 6e24cf1 | 2011-03-18 19:57:02 | [diff] [blame] | 445 | |
| 446 | // WebKit::WebFrameClient implementation ------------------------------------- |
| 447 | |
| 448 | virtual WebKit::WebPlugin* createPlugin( |
| 449 | WebKit::WebFrame* frame, |
| 450 | const WebKit::WebPluginParams& params); |
[email protected] | 6ac77cb | 2012-05-01 14:49:01 | [diff] [blame] | 451 | virtual WebKit::WebPlugin* createPluginReplacement( |
| 452 | WebKit::WebFrame* frame, |
| 453 | const WebKit::WebPluginParams& params); |
[email protected] | 6e24cf1 | 2011-03-18 19:57:02 | [diff] [blame] | 454 | virtual WebKit::WebSharedWorker* createSharedWorker( |
| 455 | WebKit::WebFrame* frame, const WebKit::WebURL& url, |
| 456 | const WebKit::WebString& name, unsigned long long documentId); |
| 457 | virtual WebKit::WebMediaPlayer* createMediaPlayer( |
| 458 | WebKit::WebFrame* frame, |
| 459 | WebKit::WebMediaPlayerClient* client); |
| 460 | virtual WebKit::WebApplicationCacheHost* createApplicationCacheHost( |
| 461 | WebKit::WebFrame* frame, |
| 462 | WebKit::WebApplicationCacheHostClient* client); |
| 463 | virtual WebKit::WebCookieJar* cookieJar(WebKit::WebFrame* frame); |
| 464 | virtual void frameDetached(WebKit::WebFrame* frame); |
| 465 | virtual void willClose(WebKit::WebFrame* frame); |
[email protected] | 6e24cf1 | 2011-03-18 19:57:02 | [diff] [blame] | 466 | virtual void loadURLExternally(WebKit::WebFrame* frame, |
| 467 | const WebKit::WebURLRequest& request, |
| 468 | WebKit::WebNavigationPolicy policy); |
[email protected] | 0622875ab | 2011-07-27 12:10:34 | [diff] [blame] | 469 | virtual void loadURLExternally(WebKit::WebFrame* frame, |
| 470 | const WebKit::WebURLRequest& request, |
| 471 | WebKit::WebNavigationPolicy policy, |
| 472 | const WebKit::WebString& suggested_name); |
[email protected] | 6e24cf1 | 2011-03-18 19:57:02 | [diff] [blame] | 473 | virtual WebKit::WebNavigationPolicy decidePolicyForNavigation( |
| 474 | WebKit::WebFrame* frame, |
| 475 | const WebKit::WebURLRequest& request, |
| 476 | WebKit::WebNavigationType type, |
| 477 | const WebKit::WebNode&, |
| 478 | WebKit::WebNavigationPolicy default_policy, |
| 479 | bool is_redirect); |
| 480 | virtual bool canHandleRequest(WebKit::WebFrame* frame, |
| 481 | const WebKit::WebURLRequest& request); |
| 482 | virtual WebKit::WebURLError cannotHandleRequestError( |
| 483 | WebKit::WebFrame* frame, |
| 484 | const WebKit::WebURLRequest& request); |
| 485 | virtual WebKit::WebURLError cancelledError( |
| 486 | WebKit::WebFrame* frame, |
| 487 | const WebKit::WebURLRequest& request); |
| 488 | virtual void unableToImplementPolicyWithError( |
| 489 | WebKit::WebFrame* frame, |
| 490 | const WebKit::WebURLError& error); |
| 491 | virtual void willSendSubmitEvent(WebKit::WebFrame* frame, |
| 492 | const WebKit::WebFormElement& form); |
| 493 | virtual void willSubmitForm(WebKit::WebFrame* frame, |
| 494 | const WebKit::WebFormElement& form); |
| 495 | virtual void willPerformClientRedirect(WebKit::WebFrame* frame, |
| 496 | const WebKit::WebURL& from, |
| 497 | const WebKit::WebURL& to, |
| 498 | double interval, |
| 499 | double fire_time); |
| 500 | virtual void didCancelClientRedirect(WebKit::WebFrame* frame); |
| 501 | virtual void didCompleteClientRedirect(WebKit::WebFrame* frame, |
| 502 | const WebKit::WebURL& from); |
| 503 | virtual void didCreateDataSource(WebKit::WebFrame* frame, |
| 504 | WebKit::WebDataSource* datasource); |
| 505 | virtual void didStartProvisionalLoad(WebKit::WebFrame* frame); |
| 506 | virtual void didReceiveServerRedirectForProvisionalLoad( |
| 507 | WebKit::WebFrame* frame); |
| 508 | virtual void didFailProvisionalLoad(WebKit::WebFrame* frame, |
| 509 | const WebKit::WebURLError& error); |
| 510 | virtual void didReceiveDocumentData(WebKit::WebFrame* frame, |
| 511 | const char* data, size_t length, |
| 512 | bool& prevent_default); |
| 513 | virtual void didCommitProvisionalLoad(WebKit::WebFrame* frame, |
| 514 | bool is_new_navigation); |
| 515 | virtual void didClearWindowObject(WebKit::WebFrame* frame); |
| 516 | virtual void didCreateDocumentElement(WebKit::WebFrame* frame); |
| 517 | virtual void didReceiveTitle(WebKit::WebFrame* frame, |
[email protected] | a3bc4d1 | 2011-04-20 17:22:21 | [diff] [blame] | 518 | const WebKit::WebString& title, |
| 519 | WebKit::WebTextDirection direction); |
[email protected] | 42054a25 | 2011-05-17 18:02:13 | [diff] [blame] | 520 | virtual void didChangeIcon(WebKit::WebFrame*, |
| 521 | WebKit::WebIconURL::Type) OVERRIDE; |
[email protected] | 6e24cf1 | 2011-03-18 19:57:02 | [diff] [blame] | 522 | virtual void didFinishDocumentLoad(WebKit::WebFrame* frame); |
| 523 | virtual void didHandleOnloadEvents(WebKit::WebFrame* frame); |
| 524 | virtual void didFailLoad(WebKit::WebFrame* frame, |
| 525 | const WebKit::WebURLError& error); |
| 526 | virtual void didFinishLoad(WebKit::WebFrame* frame); |
| 527 | virtual void didNavigateWithinPage(WebKit::WebFrame* frame, |
| 528 | bool is_new_navigation); |
| 529 | virtual void didUpdateCurrentHistoryItem(WebKit::WebFrame* frame); |
| 530 | virtual void assignIdentifierToRequest(WebKit::WebFrame* frame, |
| 531 | unsigned identifier, |
| 532 | const WebKit::WebURLRequest& request); |
| 533 | virtual void willSendRequest(WebKit::WebFrame* frame, |
| 534 | unsigned identifier, |
| 535 | WebKit::WebURLRequest& request, |
| 536 | const WebKit::WebURLResponse& redirect_response); |
| 537 | virtual void didReceiveResponse(WebKit::WebFrame* frame, |
| 538 | unsigned identifier, |
| 539 | const WebKit::WebURLResponse& response); |
| 540 | virtual void didFinishResourceLoad(WebKit::WebFrame* frame, |
| 541 | unsigned identifier); |
| 542 | virtual void didFailResourceLoad(WebKit::WebFrame* frame, |
| 543 | unsigned identifier, |
| 544 | const WebKit::WebURLError& error); |
| 545 | virtual void didLoadResourceFromMemoryCache( |
| 546 | WebKit::WebFrame* frame, |
| 547 | const WebKit::WebURLRequest& request, |
| 548 | const WebKit::WebURLResponse&); |
| 549 | virtual void didDisplayInsecureContent(WebKit::WebFrame* frame); |
| 550 | virtual void didRunInsecureContent( |
| 551 | WebKit::WebFrame* frame, |
| 552 | const WebKit::WebSecurityOrigin& origin, |
| 553 | const WebKit::WebURL& target); |
[email protected] | b00ba70 | 2011-08-17 01:41:03 | [diff] [blame] | 554 | virtual void didAdoptURLLoader(WebKit::WebURLLoader* loader); |
[email protected] | 6e24cf1 | 2011-03-18 19:57:02 | [diff] [blame] | 555 | virtual void didExhaustMemoryAvailableForScript(WebKit::WebFrame* frame); |
[email protected] | 5bc1093 | 2011-09-21 21:03:30 | [diff] [blame] | 556 | virtual void didCreateScriptContext(WebKit::WebFrame* frame, |
| 557 | v8::Handle<v8::Context>, |
[email protected] | a00fe69 | 2012-02-27 05:52:58 | [diff] [blame] | 558 | int extension_group, |
| 559 | int world_id); |
| 560 | // TODO(koz): Remove once WebKit no longer calls this. |
| 561 | virtual void didCreateScriptContext(WebKit::WebFrame* frame, |
| 562 | v8::Handle<v8::Context>, |
[email protected] | 5bc1093 | 2011-09-21 21:03:30 | [diff] [blame] | 563 | int world_id); |
| 564 | virtual void willReleaseScriptContext(WebKit::WebFrame* frame, |
| 565 | v8::Handle<v8::Context>, |
| 566 | int world_id); |
[email protected] | 6e24cf1 | 2011-03-18 19:57:02 | [diff] [blame] | 567 | virtual void didChangeScrollOffset(WebKit::WebFrame* frame); |
[email protected] | dd6afca | 2011-08-13 03:44:31 | [diff] [blame] | 568 | virtual void numberOfWheelEventHandlersChanged(unsigned num_handlers); |
[email protected] | ea93125 | 2012-02-15 22:01:03 | [diff] [blame] | 569 | virtual void numberOfTouchEventHandlersChanged(unsigned num_handlers); |
[email protected] | dd6afca | 2011-08-13 03:44:31 | [diff] [blame] | 570 | virtual void didChangeContentsSize(WebKit::WebFrame* frame, |
| 571 | const WebKit::WebSize& size); |
[email protected] | 6e24cf1 | 2011-03-18 19:57:02 | [diff] [blame] | 572 | virtual void reportFindInPageMatchCount(int request_id, |
| 573 | int count, |
| 574 | bool final_update); |
| 575 | virtual void reportFindInPageSelection(int request_id, |
| 576 | int active_match_ordinal, |
| 577 | const WebKit::WebRect& sel); |
[email protected] | 6e24cf1 | 2011-03-18 19:57:02 | [diff] [blame] | 578 | virtual void openFileSystem(WebKit::WebFrame* frame, |
| 579 | WebKit::WebFileSystem::Type type, |
| 580 | long long size, |
| 581 | bool create, |
| 582 | WebKit::WebFileSystemCallbacks* callbacks); |
[email protected] | 10e5cf1 | 2011-04-13 04:10:40 | [diff] [blame] | 583 | virtual void queryStorageUsageAndQuota( |
| 584 | WebKit::WebFrame* frame, |
| 585 | WebKit::WebStorageQuotaType type, |
| 586 | WebKit::WebStorageQuotaCallbacks* callbacks); |
[email protected] | 10e5cf1 | 2011-04-13 04:10:40 | [diff] [blame] | 587 | virtual void requestStorageQuota( |
| 588 | WebKit::WebFrame* frame, |
| 589 | WebKit::WebStorageQuotaType type, |
| 590 | unsigned long long requested_size, |
| 591 | WebKit::WebStorageQuotaCallbacks* callbacks); |
[email protected] | 8b5af49 | 2011-11-28 21:50:58 | [diff] [blame] | 592 | virtual void registerIntentService( |
| 593 | WebKit::WebFrame* frame, |
| 594 | const WebKit::WebIntentServiceInfo& service); |
| 595 | virtual void dispatchIntent(WebKit::WebFrame* frame, |
[email protected] | ffc8bed | 2012-01-21 01:23:15 | [diff] [blame] | 596 | const WebKit::WebIntentRequest& intentRequest); |
[email protected] | 5fa3a06 | 2012-03-21 15:39:34 | [diff] [blame] | 597 | virtual void willOpenSocketStream( |
| 598 | WebKit::WebSocketStreamHandle* handle); |
[email protected] | f546640b | 2012-05-15 00:03:49 | [diff] [blame^] | 599 | virtual bool willCheckAndDispatchMessageEvent( |
| 600 | WebKit::WebFrame* source, |
| 601 | WebKit::WebSecurityOrigin targetOrigin, |
| 602 | WebKit::WebDOMMessageEvent event) OVERRIDE; |
[email protected] | 8b5af49 | 2011-11-28 21:50:58 | [diff] [blame] | 603 | |
[email protected] | 18d5be9 | 2011-07-25 18:00:19 | [diff] [blame] | 604 | // WebKit::WebPageSerializerClient implementation ---------------------------- |
| 605 | |
| 606 | virtual void didSerializeDataForFrame( |
| 607 | const WebKit::WebURL& frame_url, |
| 608 | const WebKit::WebCString& data, |
| 609 | PageSerializationStatus status) OVERRIDE; |
| 610 | |
[email protected] | a2ef54c | 2011-10-10 16:20:31 | [diff] [blame] | 611 | // content::RenderView implementation ---------------------------------------- |
| 612 | |
| 613 | virtual bool Send(IPC::Message* message) OVERRIDE; |
[email protected] | 9f76c1e | 2012-03-05 15:15:58 | [diff] [blame] | 614 | virtual int GetRoutingID() const OVERRIDE; |
[email protected] | 82114f5 | 2012-03-20 22:53:41 | [diff] [blame] | 615 | virtual int GetPageId() const OVERRIDE; |
| 616 | virtual gfx::Size GetSize() const OVERRIDE; |
| 617 | virtual gfx::NativeViewId GetHostWindow() const OVERRIDE; |
[email protected] | 6717bf27 | 2012-05-11 23:31:25 | [diff] [blame] | 618 | virtual webkit_glue::WebPreferences& GetWebkitPreferences() OVERRIDE; |
[email protected] | a2ef54c | 2011-10-10 16:20:31 | [diff] [blame] | 619 | virtual WebKit::WebView* GetWebView() OVERRIDE; |
| 620 | virtual WebKit::WebNode GetFocusedNode() const OVERRIDE; |
| 621 | virtual WebKit::WebNode GetContextMenuNode() const OVERRIDE; |
[email protected] | 82114f5 | 2012-03-20 22:53:41 | [diff] [blame] | 622 | virtual bool IsEditableNode(const WebKit::WebNode& node) const OVERRIDE; |
[email protected] | a2ef54c | 2011-10-10 16:20:31 | [diff] [blame] | 623 | virtual WebKit::WebPlugin* CreatePlugin( |
| 624 | WebKit::WebFrame* frame, |
| 625 | const webkit::WebPluginInfo& info, |
| 626 | const WebKit::WebPluginParams& params) OVERRIDE; |
| 627 | virtual void EvaluateScript(const string16& frame_xpath, |
| 628 | const string16& jscript, |
| 629 | int id, |
| 630 | bool notify_result) OVERRIDE; |
| 631 | virtual bool ShouldDisplayScrollbars(int width, int height) const OVERRIDE; |
[email protected] | 82114f5 | 2012-03-20 22:53:41 | [diff] [blame] | 632 | virtual int GetEnabledBindings() const OVERRIDE; |
| 633 | virtual bool GetContentStateImmediately() const OVERRIDE; |
| 634 | virtual float GetFilteredTimePerFrame() const OVERRIDE; |
[email protected] | a2ef54c | 2011-10-10 16:20:31 | [diff] [blame] | 635 | virtual void ShowContextMenu(WebKit::WebFrame* frame, |
| 636 | const WebKit::WebContextMenuData& data) OVERRIDE; |
| 637 | virtual WebKit::WebPageVisibilityState GetVisibilityState() const OVERRIDE; |
| 638 | virtual void RunModalAlertDialog(WebKit::WebFrame* frame, |
| 639 | const WebKit::WebString& message) OVERRIDE; |
| 640 | virtual void LoadURLExternally( |
| 641 | WebKit::WebFrame* frame, |
| 642 | const WebKit::WebURLRequest& request, |
| 643 | WebKit::WebNavigationPolicy policy) OVERRIDE; |
| 644 | |
[email protected] | 6e24cf1 | 2011-03-18 19:57:02 | [diff] [blame] | 645 | // webkit_glue::WebPluginPageDelegate implementation ------------------------- |
| 646 | |
| 647 | virtual webkit::npapi::WebPluginDelegate* CreatePluginDelegate( |
| 648 | const FilePath& file_path, |
[email protected] | edc64de | 2011-11-17 20:07:38 | [diff] [blame] | 649 | const std::string& mime_type) OVERRIDE; |
[email protected] | 6ac77cb | 2012-05-01 14:49:01 | [diff] [blame] | 650 | virtual WebKit::WebPlugin* CreatePluginReplacement( |
| 651 | const FilePath& file_path) OVERRIDE; |
[email protected] | edc64de | 2011-11-17 20:07:38 | [diff] [blame] | 652 | virtual void CreatedPluginWindow(gfx::PluginWindowHandle handle) OVERRIDE; |
| 653 | virtual void WillDestroyPluginWindow(gfx::PluginWindowHandle handle) OVERRIDE; |
| 654 | virtual void DidMovePlugin( |
| 655 | const webkit::npapi::WebPluginGeometry& move) OVERRIDE; |
| 656 | virtual void DidStartLoadingForPlugin() OVERRIDE; |
| 657 | virtual void DidStopLoadingForPlugin() OVERRIDE; |
| 658 | virtual WebKit::WebCookieJar* GetCookieJar() OVERRIDE; |
[email protected] | 6e24cf1 | 2011-03-18 19:57:02 | [diff] [blame] | 659 | |
[email protected] | a9288f5 | 2011-11-17 05:18:16 | [diff] [blame] | 660 | // webkit_media::WebMediaPlayerDelegate implementation ----------------------- |
[email protected] | baff451 | 2011-10-19 18:21:07 | [diff] [blame] | 661 | |
[email protected] | a9288f5 | 2011-11-17 05:18:16 | [diff] [blame] | 662 | virtual void DidPlay(webkit_media::WebMediaPlayerImpl* player) OVERRIDE; |
| 663 | virtual void DidPause(webkit_media::WebMediaPlayerImpl* player) OVERRIDE; |
| 664 | virtual void PlayerGone(webkit_media::WebMediaPlayerImpl* player) OVERRIDE; |
[email protected] | baff451 | 2011-10-19 18:21:07 | [diff] [blame] | 665 | |
[email protected] | 6e24cf1 | 2011-03-18 19:57:02 | [diff] [blame] | 666 | // Please do not add your stuff randomly to the end here. If there is an |
| 667 | // appropriate section, add it there. If not, there are some random functions |
| 668 | // nearer to the top you can add it to. |
[email protected] | 6e24cf1 | 2011-03-18 19:57:02 | [diff] [blame] | 669 | |
[email protected] | 38b59290 | 2011-04-16 02:08:42 | [diff] [blame] | 670 | // Cannot use std::set unfortunately since linked_ptr<> does not support |
| 671 | // operator<. |
| 672 | typedef std::vector<linked_ptr<webkit_glue::ImageResourceFetcher> > |
| 673 | ImageResourceFetcherList; |
| 674 | |
[email protected] | 6e24cf1 | 2011-03-18 19:57:02 | [diff] [blame] | 675 | protected: |
| 676 | // RenderWidget overrides: |
[email protected] | edc64de | 2011-11-17 20:07:38 | [diff] [blame] | 677 | virtual void Close() OVERRIDE; |
[email protected] | 6e24cf1 | 2011-03-18 19:57:02 | [diff] [blame] | 678 | virtual void OnResize(const gfx::Size& new_size, |
[email protected] | ee41e7d2 | 2011-10-14 19:34:09 | [diff] [blame] | 679 | const gfx::Rect& resizer_rect, |
[email protected] | edc64de | 2011-11-17 20:07:38 | [diff] [blame] | 680 | bool is_fullscreen) OVERRIDE; |
[email protected] | 29ed96a | 2012-02-04 18:12:16 | [diff] [blame] | 681 | virtual void WillInitiatePaint() OVERRIDE; |
[email protected] | edc64de | 2011-11-17 20:07:38 | [diff] [blame] | 682 | virtual void DidInitiatePaint() OVERRIDE; |
[email protected] | 29ed96a | 2012-02-04 18:12:16 | [diff] [blame] | 683 | virtual void DidFlushPaint() OVERRIDE; |
[email protected] | 6e24cf1 | 2011-03-18 19:57:02 | [diff] [blame] | 684 | virtual webkit::ppapi::PluginInstance* GetBitmapForOptimizedPluginPaint( |
| 685 | const gfx::Rect& paint_bounds, |
| 686 | TransportDIB** dib, |
| 687 | gfx::Rect* location, |
[email protected] | edc64de | 2011-11-17 20:07:38 | [diff] [blame] | 688 | gfx::Rect* clip) OVERRIDE; |
| 689 | virtual gfx::Point GetScrollOffset() OVERRIDE; |
| 690 | virtual void DidHandleKeyEvent() OVERRIDE; |
[email protected] | 67bfb83f | 2011-09-22 03:36:37 | [diff] [blame] | 691 | virtual bool WillHandleMouseEvent( |
| 692 | const WebKit::WebMouseEvent& event) OVERRIDE; |
[email protected] | edc64de | 2011-11-17 20:07:38 | [diff] [blame] | 693 | virtual void DidHandleMouseEvent(const WebKit::WebMouseEvent& event) OVERRIDE; |
| 694 | virtual void DidHandleTouchEvent(const WebKit::WebTouchEvent& event) OVERRIDE; |
| 695 | virtual void OnSetFocus(bool enable) OVERRIDE; |
| 696 | virtual void OnWasHidden() OVERRIDE; |
| 697 | virtual void OnWasRestored(bool needs_repainting) OVERRIDE; |
[email protected] | 6522577 | 2011-05-12 21:10:24 | [diff] [blame] | 698 | virtual bool SupportsAsynchronousSwapBuffers() OVERRIDE; |
[email protected] | 56ea1a6 | 2011-05-30 07:05:57 | [diff] [blame] | 699 | virtual void OnImeSetComposition( |
| 700 | const string16& text, |
| 701 | const std::vector<WebKit::WebCompositionUnderline>& underlines, |
| 702 | int selection_start, |
| 703 | int selection_end) OVERRIDE; |
[email protected] | 4de6d169 | 2011-10-12 08:45:44 | [diff] [blame] | 704 | virtual void OnImeConfirmComposition( |
| 705 | const string16& text, const ui::Range& replacement_range) OVERRIDE; |
[email protected] | ad26ef4 | 2011-06-17 07:59:45 | [diff] [blame] | 706 | virtual ui::TextInputType GetTextInputType() OVERRIDE; |
[email protected] | 3f78336 | 2011-10-21 22:40:50 | [diff] [blame] | 707 | virtual void GetSelectionBounds(gfx::Rect* start, gfx::Rect* end) OVERRIDE; |
[email protected] | ad26ef4 | 2011-06-17 07:59:45 | [diff] [blame] | 708 | virtual bool CanComposeInline() OVERRIDE; |
[email protected] | c3d4553 | 2011-10-07 19:20:40 | [diff] [blame] | 709 | virtual bool WebWidgetHandlesCompositorScheduling() const OVERRIDE; |
[email protected] | 6e24cf1 | 2011-03-18 19:57:02 | [diff] [blame] | 710 | |
| 711 | private: |
[email protected] | 6e24cf1 | 2011-03-18 19:57:02 | [diff] [blame] | 712 | // For unit tests. |
| 713 | friend class ExternalPopupMenuTest; |
| 714 | friend class PepperDeviceTest; |
[email protected] | c6d068ff | 2011-10-14 17:28:23 | [diff] [blame] | 715 | friend class content::RenderViewTest; |
[email protected] | 6e24cf1 | 2011-03-18 19:57:02 | [diff] [blame] | 716 | |
| 717 | FRIEND_TEST_ALL_PREFIXES(ExternalPopupMenuRemoveTest, RemoveOnChange); |
| 718 | FRIEND_TEST_ALL_PREFIXES(ExternalPopupMenuTest, NormalCase); |
| 719 | FRIEND_TEST_ALL_PREFIXES(ExternalPopupMenuTest, ShowPopupThenNavigate); |
[email protected] | 744c2a2 | 2012-03-15 18:42:04 | [diff] [blame] | 720 | FRIEND_TEST_ALL_PREFIXES(RenderViewImplTest, DecideNavigationPolicyForWebUI); |
[email protected] | 068970d | 2011-10-11 00:05:16 | [diff] [blame] | 721 | FRIEND_TEST_ALL_PREFIXES(RenderViewImplTest, |
| 722 | DontIgnoreBackAfterNavEntryLimit); |
| 723 | FRIEND_TEST_ALL_PREFIXES(RenderViewImplTest, ImeComposition); |
| 724 | FRIEND_TEST_ALL_PREFIXES(RenderViewImplTest, InsertCharacters); |
| 725 | FRIEND_TEST_ALL_PREFIXES(RenderViewImplTest, JSBlockSentAfterPageLoad); |
| 726 | FRIEND_TEST_ALL_PREFIXES(RenderViewImplTest, LastCommittedUpdateState); |
| 727 | FRIEND_TEST_ALL_PREFIXES(RenderViewImplTest, OnHandleKeyboardEvent); |
| 728 | FRIEND_TEST_ALL_PREFIXES(RenderViewImplTest, OnImeStateChanged); |
| 729 | FRIEND_TEST_ALL_PREFIXES(RenderViewImplTest, OnNavStateChanged); |
| 730 | FRIEND_TEST_ALL_PREFIXES(RenderViewImplTest, OnSetTextDirection); |
| 731 | FRIEND_TEST_ALL_PREFIXES(RenderViewImplTest, OnUpdateWebPreferences); |
[email protected] | 73eb260 | 2012-02-09 19:50:55 | [diff] [blame] | 732 | FRIEND_TEST_ALL_PREFIXES(RenderViewImplTest, SendSwapOutACK); |
[email protected] | 068970d | 2011-10-11 00:05:16 | [diff] [blame] | 733 | FRIEND_TEST_ALL_PREFIXES(RenderViewImplTest, StaleNavigationsIgnored); |
| 734 | FRIEND_TEST_ALL_PREFIXES(RenderViewImplTest, UpdateTargetURLWithInvalidURL); |
[email protected] | 6e24cf1 | 2011-03-18 19:57:02 | [diff] [blame] | 735 | #if defined(OS_MACOSX) |
| 736 | FRIEND_TEST_ALL_PREFIXES(RenderViewTest, MacTestCmdUp); |
| 737 | #endif |
[email protected] | 068970d | 2011-10-11 00:05:16 | [diff] [blame] | 738 | FRIEND_TEST_ALL_PREFIXES(RenderViewImplTest, SetHistoryLengthAndPrune); |
[email protected] | 6e24cf1 | 2011-03-18 19:57:02 | [diff] [blame] | 739 | |
[email protected] | 6e24cf1 | 2011-03-18 19:57:02 | [diff] [blame] | 740 | typedef std::map<GURL, double> HostZoomLevels; |
| 741 | |
[email protected] | 6e24cf1 | 2011-03-18 19:57:02 | [diff] [blame] | 742 | enum ErrorPageType { |
| 743 | DNS_ERROR, |
| 744 | HTTP_404, |
| 745 | CONNECTION_ERROR, |
| 746 | }; |
| 747 | |
[email protected] | 310ebd630 | 2011-10-10 19:06:28 | [diff] [blame] | 748 | RenderViewImpl(gfx::NativeViewId parent_hwnd, |
| 749 | int32 opener_id, |
[email protected] | daf82f8 | 2011-10-31 22:35:31 | [diff] [blame] | 750 | const content::RendererPreferences& renderer_prefs, |
[email protected] | 6717bf27 | 2012-05-11 23:31:25 | [diff] [blame] | 751 | const webkit_glue::WebPreferences& webkit_prefs, |
[email protected] | 310ebd630 | 2011-10-10 19:06:28 | [diff] [blame] | 752 | SharedRenderViewCounter* counter, |
| 753 | int32 routing_id, |
[email protected] | 9f4f332 | 2012-01-18 22:29:56 | [diff] [blame] | 754 | int32 surface_id, |
[email protected] | 310ebd630 | 2011-10-10 19:06:28 | [diff] [blame] | 755 | int64 session_storage_namespace_id, |
[email protected] | 74ce1ad | 2011-12-16 21:51:46 | [diff] [blame] | 756 | const string16& frame_name, |
[email protected] | 14392a5 | 2012-05-02 20:28:44 | [diff] [blame] | 757 | bool is_renderer_created, |
| 758 | bool swapped_out, |
[email protected] | 6fd35b7 | 2012-03-01 19:46:41 | [diff] [blame] | 759 | int32 next_page_id, |
[email protected] | 8cca3da | 2012-03-20 08:26:34 | [diff] [blame] | 760 | const WebKit::WebScreenInfo& screen_info, |
[email protected] | 3e3c452 | 2012-04-13 21:16:29 | [diff] [blame] | 761 | bool guest, |
| 762 | AccessibilityMode accessibility_mode); |
[email protected] | 6e24cf1 | 2011-03-18 19:57:02 | [diff] [blame] | 763 | |
| 764 | // Do not delete directly. This class is reference counted. |
[email protected] | 310ebd630 | 2011-10-10 19:06:28 | [diff] [blame] | 765 | virtual ~RenderViewImpl(); |
[email protected] | 6e24cf1 | 2011-03-18 19:57:02 | [diff] [blame] | 766 | |
| 767 | void UpdateURL(WebKit::WebFrame* frame); |
[email protected] | a49e10b | 2011-08-01 23:57:46 | [diff] [blame] | 768 | void UpdateTitle(WebKit::WebFrame* frame, const string16& title, |
| 769 | WebKit::WebTextDirection title_direction); |
[email protected] | 6e24cf1 | 2011-03-18 19:57:02 | [diff] [blame] | 770 | void UpdateSessionHistory(WebKit::WebFrame* frame); |
[email protected] | 6459800a | 2012-03-27 23:57:05 | [diff] [blame] | 771 | void SendUpdateState(const WebKit::WebHistoryItem& item); |
[email protected] | 6e24cf1 | 2011-03-18 19:57:02 | [diff] [blame] | 772 | |
| 773 | // Update current main frame's encoding and send it to browser window. |
| 774 | // Since we want to let users see the right encoding info from menu |
| 775 | // before finishing loading, we call the UpdateEncoding in |
| 776 | // a) function:DidCommitLoadForFrame. When this function is called, |
| 777 | // that means we have got first data. In here we try to get encoding |
| 778 | // of page if it has been specified in http header. |
| 779 | // b) function:DidReceiveTitle. When this function is called, |
| 780 | // that means we have got specified title. Because in most of webpages, |
| 781 | // title tags will follow meta tags. In here we try to get encoding of |
| 782 | // page if it has been specified in meta tag. |
| 783 | // c) function:DidFinishDocumentLoadForFrame. When this function is |
| 784 | // called, that means we have got whole html page. In here we should |
| 785 | // finally get right encoding of page. |
| 786 | void UpdateEncoding(WebKit::WebFrame* frame, |
| 787 | const std::string& encoding_name); |
| 788 | |
[email protected] | ae5184d6 | 2011-10-06 19:25:58 | [diff] [blame] | 789 | void OpenURL(WebKit::WebFrame* frame, |
| 790 | const GURL& url, |
[email protected] | 445e104 | 2011-12-03 21:03:15 | [diff] [blame] | 791 | const content::Referrer& referrer, |
[email protected] | 6e24cf1 | 2011-03-18 19:57:02 | [diff] [blame] | 792 | WebKit::WebNavigationPolicy policy); |
| 793 | |
[email protected] | 269f86d | 2011-12-07 02:43:47 | [diff] [blame] | 794 | bool RunJavaScriptMessage(ui::JavascriptMessageType type, |
[email protected] | 4f5ce84 | 2011-05-27 19:34:41 | [diff] [blame] | 795 | const string16& message, |
| 796 | const string16& default_value, |
[email protected] | 6e24cf1 | 2011-03-18 19:57:02 | [diff] [blame] | 797 | const GURL& frame_url, |
[email protected] | 4f5ce84 | 2011-05-27 19:34:41 | [diff] [blame] | 798 | string16* result); |
[email protected] | 6e24cf1 | 2011-03-18 19:57:02 | [diff] [blame] | 799 | |
| 800 | // Sends a message and runs a nested message loop. |
| 801 | bool SendAndRunNestedMessageLoop(IPC::SyncMessage* message); |
| 802 | |
[email protected] | dd6afca | 2011-08-13 03:44:31 | [diff] [blame] | 803 | // Called when the "pinned to left/right edge" state needs to be updated. |
| 804 | void UpdateScrollState(WebKit::WebFrame* frame); |
| 805 | |
[email protected] | 6e24cf1 | 2011-03-18 19:57:02 | [diff] [blame] | 806 | // IPC message handlers ------------------------------------------------------ |
| 807 | // |
| 808 | // The documentation for these functions should be in |
| 809 | // render_messages_internal.h for the message that the function is handling. |
| 810 | |
[email protected] | 744c2a2 | 2012-03-15 18:42:04 | [diff] [blame] | 811 | CONTENT_EXPORT void OnAllowBindings(int enabled_bindings_flags); |
[email protected] | 6e24cf1 | 2011-03-18 19:57:02 | [diff] [blame] | 812 | void OnAllowScriptToClose(bool script_can_close); |
| 813 | void OnAsyncFileOpened(base::PlatformFileError error_code, |
| 814 | IPC::PlatformFileForTransit file_for_transit, |
| 815 | int message_id); |
[email protected] | eb415bf0e | 2011-04-14 02:45:42 | [diff] [blame] | 816 | void OnPpapiBrokerChannelCreated(int request_id, |
[email protected] | d5430507 | 2011-06-22 20:58:43 | [diff] [blame] | 817 | const IPC::ChannelHandle& handle); |
[email protected] | 6e24cf1 | 2011-03-18 19:57:02 | [diff] [blame] | 818 | void OnCancelDownload(int32 download_id); |
| 819 | void OnClearFocusedNode(); |
[email protected] | 992db4c | 2011-05-12 15:37:15 | [diff] [blame] | 820 | void OnClosePage(); |
[email protected] | 6e24cf1 | 2011-03-18 19:57:02 | [diff] [blame] | 821 | void OnContextMenuClosed( |
[email protected] | 35be7ec | 2012-02-12 20:42:51 | [diff] [blame] | 822 | const content::CustomContextMenuContext& custom_context); |
[email protected] | 6e24cf1 | 2011-03-18 19:57:02 | [diff] [blame] | 823 | void OnCopy(); |
| 824 | void OnCopyImageAt(int x, int y); |
| 825 | #if defined(OS_MACOSX) |
| 826 | void OnCopyToFindPboard(); |
| 827 | #endif |
| 828 | void OnCut(); |
[email protected] | 318bf580 | 2011-08-08 17:12:41 | [diff] [blame] | 829 | void OnCSSInsertRequest(const string16& frame_xpath, |
[email protected] | 01cf589c | 2011-07-28 18:04:03 | [diff] [blame] | 830 | const std::string& css); |
[email protected] | 6e24cf1 | 2011-03-18 19:57:02 | [diff] [blame] | 831 | void OnCustomContextMenuAction( |
[email protected] | 35be7ec | 2012-02-12 20:42:51 | [diff] [blame] | 832 | const content::CustomContextMenuContext& custom_context, |
[email protected] | 6e24cf1 | 2011-03-18 19:57:02 | [diff] [blame] | 833 | unsigned action); |
| 834 | void OnDelete(); |
| 835 | void OnDeterminePageLanguage(); |
| 836 | void OnDisableScrollbarsForSmallWindows( |
| 837 | const gfx::Size& disable_scrollbars_size_limit); |
| 838 | void OnDisassociateFromPopupCount(); |
[email protected] | 6e24cf1 | 2011-03-18 19:57:02 | [diff] [blame] | 839 | void OnDragSourceEndedOrMoved(const gfx::Point& client_point, |
| 840 | const gfx::Point& screen_point, |
| 841 | bool ended, |
| 842 | WebKit::WebDragOperation drag_operation); |
| 843 | void OnDragSourceSystemDragEnded(); |
| 844 | void OnDragTargetDrop(const gfx::Point& client_pt, |
| 845 | const gfx::Point& screen_pt); |
| 846 | void OnDragTargetDragEnter(const WebDropData& drop_data, |
| 847 | const gfx::Point& client_pt, |
| 848 | const gfx::Point& screen_pt, |
| 849 | WebKit::WebDragOperationsMask operations_allowed); |
| 850 | void OnDragTargetDragLeave(); |
| 851 | void OnDragTargetDragOver(const gfx::Point& client_pt, |
| 852 | const gfx::Point& screen_pt, |
| 853 | WebKit::WebDragOperationsMask operations_allowed); |
[email protected] | 2bf834f | 2011-11-17 20:02:21 | [diff] [blame] | 854 | void OnEnablePreferredSizeChangedMode(); |
[email protected] | 244ac189 | 2011-12-02 17:04:47 | [diff] [blame] | 855 | void OnEnableAutoResize(const gfx::Size& min_size, const gfx::Size& max_size); |
[email protected] | 61e2b3cc | 2012-03-02 16:13:34 | [diff] [blame] | 856 | void OnDisableAutoResize(const gfx::Size& new_size); |
[email protected] | 600ea40 | 2011-04-12 00:01:51 | [diff] [blame] | 857 | void OnEnumerateDirectoryResponse(int id, const std::vector<FilePath>& paths); |
[email protected] | 6e24cf1 | 2011-03-18 19:57:02 | [diff] [blame] | 858 | void OnExecuteEditCommand(const std::string& name, const std::string& value); |
[email protected] | fb11b6a4 | 2012-03-14 07:25:12 | [diff] [blame] | 859 | void OnFileChooserResponse( |
| 860 | const std::vector<content::SelectedFileInfo>& files); |
[email protected] | 6e24cf1 | 2011-03-18 19:57:02 | [diff] [blame] | 861 | void OnFind(int request_id, const string16&, const WebKit::WebFindOptions&); |
| 862 | void OnFindReplyAck(); |
[email protected] | 18d5be9 | 2011-07-25 18:00:19 | [diff] [blame] | 863 | void OnGetAllSavableResourceLinksForCurrentPage(const GURL& page_url); |
| 864 | void OnGetSerializedHtmlDataForCurrentPageWithLocalLinks( |
| 865 | const std::vector<GURL>& links, |
| 866 | const std::vector<FilePath>& local_paths, |
| 867 | const FilePath& local_directory_name); |
[email protected] | 6e24cf1 | 2011-03-18 19:57:02 | [diff] [blame] | 868 | void OnMediaPlayerActionAt(const gfx::Point& location, |
| 869 | const WebKit::WebMediaPlayerAction& action); |
[email protected] | 81375e87 | 2012-01-11 21:40:36 | [diff] [blame] | 870 | void OnPluginActionAt(const gfx::Point& location, |
| 871 | const WebKit::WebPluginAction& action); |
[email protected] | 6e24cf1 | 2011-03-18 19:57:02 | [diff] [blame] | 872 | void OnMoveOrResizeStarted(); |
[email protected] | f3112a5 | 2011-09-30 23:47:49 | [diff] [blame] | 873 | CONTENT_EXPORT void OnNavigate(const ViewMsg_Navigate_Params& params); |
[email protected] | 6e24cf1 | 2011-03-18 19:57:02 | [diff] [blame] | 874 | void OnPaste(); |
[email protected] | 44bf700 | 2011-10-16 02:46:15 | [diff] [blame] | 875 | void OnPasteAndMatchStyle(); |
[email protected] | 6e24cf1 | 2011-03-18 19:57:02 | [diff] [blame] | 876 | #if defined(OS_MACOSX) |
| 877 | void OnPluginImeCompositionCompleted(const string16& text, int plugin_id); |
| 878 | #endif |
[email protected] | f546640b | 2012-05-15 00:03:49 | [diff] [blame^] | 879 | void OnPostMessageEvent(const ViewMsg_PostMessage_Params& params); |
[email protected] | 6e24cf1 | 2011-03-18 19:57:02 | [diff] [blame] | 880 | void OnRedo(); |
| 881 | void OnReloadFrame(); |
| 882 | void OnReplace(const string16& text); |
[email protected] | 6e24cf1 | 2011-03-18 19:57:02 | [diff] [blame] | 883 | void OnResetPageEncodingToDefault(); |
| 884 | void OnScriptEvalRequest(const string16& frame_xpath, |
| 885 | const string16& jscript, |
| 886 | int id, |
| 887 | bool notify_result); |
| 888 | void OnSelectAll(); |
[email protected] | 4fb6014 | 2011-08-09 02:22:08 | [diff] [blame] | 889 | void OnSelectRange(const gfx::Point& start, const gfx::Point& end); |
[email protected] | 6e24cf1 | 2011-03-18 19:57:02 | [diff] [blame] | 890 | void OnSetActive(bool active); |
| 891 | void OnSetAltErrorPageURL(const GURL& gurl); |
| 892 | void OnSetBackground(const SkBitmap& background); |
[email protected] | 7a17bac0 | 2012-03-07 21:58:12 | [diff] [blame] | 893 | void OnSetNavigationStartTime( |
| 894 | const base::TimeTicks& browser_navigation_start); |
[email protected] | 6e24cf1 | 2011-03-18 19:57:02 | [diff] [blame] | 895 | void OnSetWebUIProperty(const std::string& name, const std::string& value); |
[email protected] | c5d463e | 2012-03-15 21:05:56 | [diff] [blame] | 896 | CONTENT_EXPORT void OnSetEditCommandsForNextKeyEvent( |
| 897 | const EditCommands& edit_commands); |
[email protected] | f3112a5 | 2011-09-30 23:47:49 | [diff] [blame] | 898 | CONTENT_EXPORT void OnSetHistoryLengthAndPrune(int history_length, |
| 899 | int32 minimum_page_id); |
[email protected] | 6e24cf1 | 2011-03-18 19:57:02 | [diff] [blame] | 900 | void OnSetInitialFocus(bool reverse); |
[email protected] | 54ca3ca89 | 2011-06-07 21:14:54 | [diff] [blame] | 901 | #if defined(OS_MACOSX) |
| 902 | void OnSetInLiveResize(bool in_live_resize); |
| 903 | #endif |
[email protected] | 333ec8d0 | 2011-09-16 18:59:19 | [diff] [blame] | 904 | void OnScrollFocusedEditableNodeIntoRect(const gfx::Rect& rect); |
[email protected] | 6e24cf1 | 2011-03-18 19:57:02 | [diff] [blame] | 905 | void OnSetPageEncoding(const std::string& encoding_name); |
[email protected] | daf82f8 | 2011-10-31 22:35:31 | [diff] [blame] | 906 | void OnSetRendererPrefs(const content::RendererPreferences& renderer_prefs); |
[email protected] | 6e24cf1 | 2011-03-18 19:57:02 | [diff] [blame] | 907 | #if defined(OS_MACOSX) |
| 908 | void OnSetWindowVisibility(bool visible); |
| 909 | #endif |
| 910 | void OnSetZoomLevel(double zoom_level); |
| 911 | void OnSetZoomLevelForLoadingURL(const GURL& url, double zoom_level); |
[email protected] | 8a5e0ca | 2011-08-25 06:30:47 | [diff] [blame] | 912 | void OnExitFullscreen(); |
[email protected] | 6e24cf1 | 2011-03-18 19:57:02 | [diff] [blame] | 913 | void OnShouldClose(); |
| 914 | void OnStop(); |
[email protected] | 815dd987 | 2011-11-23 18:40:30 | [diff] [blame] | 915 | void OnStopFinding(content::StopFindAction action); |
[email protected] | 73eb260 | 2012-02-09 19:50:55 | [diff] [blame] | 916 | CONTENT_EXPORT void OnSwapOut(const ViewMsg_SwapOut_Params& params); |
[email protected] | 6e24cf1 | 2011-03-18 19:57:02 | [diff] [blame] | 917 | void OnThemeChanged(); |
[email protected] | 6e24cf1 | 2011-03-18 19:57:02 | [diff] [blame] | 918 | void OnUndo(); |
[email protected] | 6e24cf1 | 2011-03-18 19:57:02 | [diff] [blame] | 919 | void OnUpdateTargetURLAck(); |
[email protected] | 6717bf27 | 2012-05-11 23:31:25 | [diff] [blame] | 920 | CONTENT_EXPORT void OnUpdateWebPreferences( |
| 921 | const webkit_glue::WebPreferences& prefs); |
[email protected] | 08bb1e72 | 2011-07-30 19:13:04 | [diff] [blame] | 922 | |
[email protected] | 6e24cf1 | 2011-03-18 19:57:02 | [diff] [blame] | 923 | #if defined(OS_MACOSX) |
| 924 | void OnWindowFrameChanged(const gfx::Rect& window_frame, |
| 925 | const gfx::Rect& view_frame); |
[email protected] | c5d463e | 2012-03-15 21:05:56 | [diff] [blame] | 926 | CONTENT_EXPORT void OnSelectPopupMenuItem(int selected_index); |
[email protected] | 6e24cf1 | 2011-03-18 19:57:02 | [diff] [blame] | 927 | #endif |
[email protected] | 54087fe | 2011-10-28 22:02:48 | [diff] [blame] | 928 | void OnZoom(content::PageZoom zoom); |
[email protected] | 47578fa0 | 2011-11-02 19:34:41 | [diff] [blame] | 929 | void OnZoomFactor(content::PageZoom zoom, int zoom_center_x, |
| 930 | int zoom_center_y); |
| 931 | |
[email protected] | 5a7b15a | 2011-08-22 22:48:18 | [diff] [blame] | 932 | void OnEnableViewSourceMode(); |
[email protected] | 6e24cf1 | 2011-03-18 19:57:02 | [diff] [blame] | 933 | |
[email protected] | 64d0e19 | 2011-12-09 14:44:20 | [diff] [blame] | 934 | void OnJavaBridgeInit(); |
[email protected] | 7f3c7af | 2011-10-20 22:52:51 | [diff] [blame] | 935 | |
[email protected] | 6e24cf1 | 2011-03-18 19:57:02 | [diff] [blame] | 936 | // Adding a new message handler? Please add it in alphabetical order above |
| 937 | // and put it in the same position in the .cc file. |
| 938 | |
| 939 | // Misc private functions ---------------------------------------------------- |
[email protected] | 47578fa0 | 2011-11-02 19:34:41 | [diff] [blame] | 940 | void ZoomFactorHelper(content::PageZoom zoom, int zoom_center_x, |
| 941 | int zoom_center_y, float scaling_increment); |
[email protected] | 6e24cf1 | 2011-03-18 19:57:02 | [diff] [blame] | 942 | |
[email protected] | 6e24cf1 | 2011-03-18 19:57:02 | [diff] [blame] | 943 | void AltErrorPageFinished(WebKit::WebFrame* frame, |
| 944 | const WebKit::WebURLError& original_error, |
| 945 | const std::string& html); |
| 946 | |
[email protected] | d812fd1 | 2011-05-27 23:05:07 | [diff] [blame] | 947 | // Check whether the preferred size has changed. |
[email protected] | 6e24cf1 | 2011-03-18 19:57:02 | [diff] [blame] | 948 | void CheckPreferredSize(); |
| 949 | |
[email protected] | 273558fb | 2012-01-12 15:03:51 | [diff] [blame] | 950 | void EnsureMediaStreamImpl(); |
| 951 | |
[email protected] | 5e56df8 | 2011-04-18 17:00:15 | [diff] [blame] | 952 | // This callback is triggered when DownloadFavicon completes, either |
| 953 | // succesfully or with a failure. See DownloadFavicon for more |
| 954 | // details. |
| 955 | void DidDownloadFavicon(webkit_glue::ImageResourceFetcher* fetcher, |
| 956 | const SkBitmap& image); |
[email protected] | 6e24cf1 | 2011-03-18 19:57:02 | [diff] [blame] | 957 | |
[email protected] | 310ebd630 | 2011-10-10 19:06:28 | [diff] [blame] | 958 | // Requests to download a favicon image. When done, the RenderView is notified |
| 959 | // by way of DidDownloadFavicon. Returns true if the request was successfully |
| 960 | // started, false otherwise. id is used to uniquely identify the request and |
| 961 | // passed back to the DidDownloadFavicon method. If the image has multiple |
| 962 | // frames, the frame whose size is image_size is returned. If the image |
| 963 | // doesn't have a frame at the specified size, the first is returned. |
[email protected] | 5e56df8 | 2011-04-18 17:00:15 | [diff] [blame] | 964 | bool DownloadFavicon(int id, const GURL& image_url, int image_size); |
[email protected] | 6e24cf1 | 2011-03-18 19:57:02 | [diff] [blame] | 965 | |
[email protected] | 6e24cf1 | 2011-03-18 19:57:02 | [diff] [blame] | 966 | GURL GetAlternateErrorPageURL(const GURL& failed_url, |
| 967 | ErrorPageType error_type); |
| 968 | |
| 969 | // Locates a sub frame with given xpath |
[email protected] | 318bf580 | 2011-08-08 17:12:41 | [diff] [blame] | 970 | WebKit::WebFrame* GetChildFrame(const string16& frame_xpath) const; |
[email protected] | 6e24cf1 | 2011-03-18 19:57:02 | [diff] [blame] | 971 | |
[email protected] | 57b9396c | 2011-10-07 19:11:59 | [diff] [blame] | 972 | // Returns the opener url if present, else an empty url. |
| 973 | GURL GetOpenerUrl() const; |
| 974 | |
[email protected] | 69ddf85 | 2012-02-21 23:21:31 | [diff] [blame] | 975 | // Returns the URL being loaded by the given frame's request. |
| 976 | GURL GetLoadingUrl(WebKit::WebFrame* frame) const; |
| 977 | |
[email protected] | 6e24cf1 | 2011-03-18 19:57:02 | [diff] [blame] | 978 | WebUIBindings* GetWebUIBindings(); |
| 979 | |
[email protected] | 6e24cf1 | 2011-03-18 19:57:02 | [diff] [blame] | 980 | // Should only be called if this object wraps a PluginDocument. |
| 981 | WebKit::WebPlugin* GetWebPluginFromPluginDocument(); |
| 982 | |
[email protected] | d466b8a | 2011-07-15 21:48:03 | [diff] [blame] | 983 | // Returns true if the |params| navigation is to an entry that has been |
| 984 | // cropped due to a recent navigation the browser did not know about. |
| 985 | bool IsBackForwardToStaleEntry(const ViewMsg_Navigate_Params& params, |
| 986 | bool is_reload); |
| 987 | |
[email protected] | 6e24cf1 | 2011-03-18 19:57:02 | [diff] [blame] | 988 | // Returns false unless this is a top-level navigation that crosses origins. |
| 989 | bool IsNonLocalTopLevelNavigation(const GURL& url, |
| 990 | WebKit::WebFrame* frame, |
| 991 | WebKit::WebNavigationType type); |
| 992 | |
[email protected] | 6e24cf1 | 2011-03-18 19:57:02 | [diff] [blame] | 993 | bool MaybeLoadAlternateErrorPage(WebKit::WebFrame* frame, |
| 994 | const WebKit::WebURLError& error, |
| 995 | bool replace); |
| 996 | |
[email protected] | 14392a5 | 2012-05-02 20:28:44 | [diff] [blame] | 997 | // Make this RenderView show an empty, unscriptable page. |
| 998 | void NavigateToSwappedOutURL(); |
| 999 | |
[email protected] | 007733c | 2011-11-17 00:34:07 | [diff] [blame] | 1000 | // If we initiated a navigation, this function will populate |document_state| |
| 1001 | // with the navigation information saved in OnNavigate(). |
[email protected] | 45d83a1 | 2012-04-06 22:57:57 | [diff] [blame] | 1002 | void PopulateDocumentStateFromPending(content::DocumentState* document_state); |
| 1003 | |
| 1004 | // Returns a new NavigationState populated with the navigation information |
| 1005 | // saved in OnNavigate(). |
| 1006 | content::NavigationState* CreateNavigationStateFromPending(); |
[email protected] | 007733c | 2011-11-17 00:34:07 | [diff] [blame] | 1007 | |
[email protected] | 5b52cd2f71 | 2012-03-28 02:12:48 | [diff] [blame] | 1008 | // Processes the command-line flags --enable-viewport and |
| 1009 | // --enable-fixed-layout[=w,h]. |
| 1010 | void ProcessViewLayoutFlags(const CommandLine& command_line); |
| 1011 | |
[email protected] | 6e24cf1 | 2011-03-18 19:57:02 | [diff] [blame] | 1012 | // Starts nav_state_sync_timer_ if it isn't already running. |
| 1013 | void StartNavStateSyncTimerIfNecessary(); |
| 1014 | |
| 1015 | // Dispatches the current navigation state to the browser. Called on a |
| 1016 | // periodic timer so we don't send too many messages. |
| 1017 | void SyncNavigationState(); |
| 1018 | |
[email protected] | b781ff28 | 2011-08-20 06:19:36 | [diff] [blame] | 1019 | // Dispatches the current state of selection on the webpage to the browser if |
| 1020 | // it has changed. |
| 1021 | // TODO(varunjain): delete this method once we figure out how to keep |
| 1022 | // selection handles in sync with the webpage. |
| 1023 | void SyncSelectionIfRequired(); |
| 1024 | |
[email protected] | c4dabe45 | 2012-02-08 23:58:12 | [diff] [blame] | 1025 | #if defined(OS_POSIX) && !defined(OS_MACOSX) && !defined(OS_ANDROID) |
[email protected] | 6e24cf1 | 2011-03-18 19:57:02 | [diff] [blame] | 1026 | void UpdateFontRenderingFromRendererPrefs(); |
| 1027 | #else |
| 1028 | void UpdateFontRenderingFromRendererPrefs() {} |
| 1029 | #endif |
| 1030 | |
| 1031 | // Update the target url and tell the browser that the target URL has changed. |
| 1032 | // If |url| is empty, show |fallback_url|. |
| 1033 | void UpdateTargetURL(const GURL& url, const GURL& fallback_url); |
| 1034 | |
[email protected] | 6e24cf1 | 2011-03-18 19:57:02 | [diff] [blame] | 1035 | // --------------------------------------------------------------------------- |
| 1036 | // ADDING NEW FUNCTIONS? Please keep private functions alphabetized and put |
| 1037 | // it in the same order in the .cc file as it was in the header. |
| 1038 | // --------------------------------------------------------------------------- |
| 1039 | |
| 1040 | // Settings ------------------------------------------------------------------ |
| 1041 | |
[email protected] | 6717bf27 | 2012-05-11 23:31:25 | [diff] [blame] | 1042 | webkit_glue::WebPreferences webkit_preferences_; |
[email protected] | daf82f8 | 2011-10-31 22:35:31 | [diff] [blame] | 1043 | content::RendererPreferences renderer_preferences_; |
[email protected] | 6e24cf1 | 2011-03-18 19:57:02 | [diff] [blame] | 1044 | |
[email protected] | 6e24cf1 | 2011-03-18 19:57:02 | [diff] [blame] | 1045 | HostZoomLevels host_zoom_levels_; |
| 1046 | |
| 1047 | // Whether content state (such as form state, scroll position and page |
| 1048 | // contents) should be sent to the browser immediately. This is normally |
| 1049 | // false, but set to true by some tests. |
| 1050 | bool send_content_state_immediately_; |
| 1051 | |
[email protected] | 6e24cf1 | 2011-03-18 19:57:02 | [diff] [blame] | 1052 | // Bitwise-ORed set of extra bindings that have been enabled. See |
| 1053 | // BindingsPolicy for details. |
| 1054 | int enabled_bindings_; |
| 1055 | |
| 1056 | // The alternate error page URL, if one exists. |
| 1057 | GURL alternate_error_page_url_; |
| 1058 | |
| 1059 | // If true, we send IPC messages when |preferred_size_| changes. |
| 1060 | bool send_preferred_size_changes_; |
| 1061 | |
| 1062 | // If non-empty, and |send_preferred_size_changes_| is true, disable drawing |
| 1063 | // scroll bars on windows smaller than this size. Used for windows that the |
| 1064 | // browser resizes to the size of the content, such as browser action popups. |
| 1065 | // If a render view is set to the minimum size of its content, webkit may add |
| 1066 | // scroll bars. This makes sense for fixed sized windows, but it does not |
| 1067 | // make sense when the size of the view was chosen to fit the content. |
| 1068 | // This setting ensures that no scroll bars are drawn. The size limit exists |
| 1069 | // because if the view grows beyond a size known to the browser, scroll bars |
| 1070 | // should be drawn. |
| 1071 | gfx::Size disable_scrollbars_size_limit_; |
| 1072 | |
[email protected] | 6e24cf1 | 2011-03-18 19:57:02 | [diff] [blame] | 1073 | // Loading state ------------------------------------------------------------- |
| 1074 | |
| 1075 | // True if the top level frame is currently being loaded. |
| 1076 | bool is_loading_; |
| 1077 | |
| 1078 | // The gesture that initiated the current navigation. |
| 1079 | NavigationGesture navigation_gesture_; |
| 1080 | |
| 1081 | // Used for popups. |
| 1082 | bool opened_by_user_gesture_; |
| 1083 | GURL creator_url_; |
| 1084 | |
| 1085 | // Whether this RenderView was created by a frame that was suppressing its |
| 1086 | // opener. If so, we may want to load pages in a separate process. See |
| 1087 | // decidePolicyForNavigation for details. |
| 1088 | bool opener_suppressed_; |
| 1089 | |
| 1090 | // If we are handling a top-level client-side redirect, this tracks the URL |
| 1091 | // of the page that initiated it. Specifically, when a load is committed this |
| 1092 | // is used to determine if that load originated from a client-side redirect. |
| 1093 | // It is empty if there is no top-level client-side redirect. |
[email protected] | 445e104 | 2011-12-03 21:03:15 | [diff] [blame] | 1094 | content::Referrer completed_client_redirect_src_; |
[email protected] | 6e24cf1 | 2011-03-18 19:57:02 | [diff] [blame] | 1095 | |
[email protected] | 6e24cf1 | 2011-03-18 19:57:02 | [diff] [blame] | 1096 | // Holds state pertaining to a navigation that we initiated. This is held by |
| 1097 | // the WebDataSource::ExtraData attribute. We use pending_navigation_state_ |
| 1098 | // as a temporary holder for the state until the WebDataSource corresponding |
| 1099 | // to the new navigation is created. See DidCreateDataSource. |
[email protected] | 007733c | 2011-11-17 00:34:07 | [diff] [blame] | 1100 | scoped_ptr<ViewMsg_Navigate_Params> pending_navigation_params_; |
[email protected] | 6e24cf1 | 2011-03-18 19:57:02 | [diff] [blame] | 1101 | |
| 1102 | // Timer used to delay the updating of nav state (see SyncNavigationState). |
[email protected] | 310ebd630 | 2011-10-10 19:06:28 | [diff] [blame] | 1103 | base::OneShotTimer<RenderViewImpl> nav_state_sync_timer_; |
[email protected] | 6e24cf1 | 2011-03-18 19:57:02 | [diff] [blame] | 1104 | |
[email protected] | 6e24cf1 | 2011-03-18 19:57:02 | [diff] [blame] | 1105 | // Page IDs ------------------------------------------------------------------ |
[email protected] | a813c8e | 2011-10-08 01:34:11 | [diff] [blame] | 1106 | // See documentation in content::RenderView. |
[email protected] | 6e24cf1 | 2011-03-18 19:57:02 | [diff] [blame] | 1107 | int32 page_id_; |
| 1108 | |
| 1109 | // Indicates the ID of the last page that we sent a FrameNavigate to the |
| 1110 | // browser for. This is used to determine if the most recent transition |
| 1111 | // generated a history entry (less than page_id_), or not (equal to or |
| 1112 | // greater than). Note that this will be greater than page_id_ if the user |
| 1113 | // goes back. |
| 1114 | int32 last_page_id_sent_to_browser_; |
| 1115 | |
[email protected] | 74ce1ad | 2011-12-16 21:51:46 | [diff] [blame] | 1116 | // The next available page ID to use for this RenderView. These IDs are |
| 1117 | // specific to a given RenderView and the frames within it. |
| 1118 | int32 next_page_id_; |
[email protected] | 6e24cf1 | 2011-03-18 19:57:02 | [diff] [blame] | 1119 | |
[email protected] | d466b8a | 2011-07-15 21:48:03 | [diff] [blame] | 1120 | // The offset of the current item in the history list. |
| 1121 | int history_list_offset_; |
| 1122 | |
| 1123 | // The RenderView's current impression of the history length. This includes |
| 1124 | // any items that have committed in this process, but because of cross-process |
| 1125 | // navigations, the history may have some entries that were committed in other |
| 1126 | // processes. We won't know about them until the next navigation in this |
| 1127 | // process. |
| 1128 | int history_list_length_; |
| 1129 | |
| 1130 | // The list of page IDs for each history item this RenderView knows about. |
| 1131 | // Some entries may be -1 if they were rendered by other processes or were |
| 1132 | // restored from a previous session. This lets us detect attempts to |
| 1133 | // navigate to stale entries that have been cropped from our history. |
| 1134 | std::vector<int32> history_page_ids_; |
| 1135 | |
[email protected] | 6e24cf1 | 2011-03-18 19:57:02 | [diff] [blame] | 1136 | // Page info ----------------------------------------------------------------- |
| 1137 | |
| 1138 | // The last gotten main frame's encoding. |
| 1139 | std::string last_encoding_name_; |
| 1140 | |
[email protected] | 6e24cf1 | 2011-03-18 19:57:02 | [diff] [blame] | 1141 | // UI state ------------------------------------------------------------------ |
| 1142 | |
| 1143 | // The state of our target_url transmissions. When we receive a request to |
| 1144 | // send a URL to the browser, we set this to TARGET_INFLIGHT until an ACK |
| 1145 | // comes back - if a new request comes in before the ACK, we store the new |
| 1146 | // URL in pending_target_url_ and set the status to TARGET_PENDING. If an |
| 1147 | // ACK comes back and we are in TARGET_PENDING, we send the stored URL and |
| 1148 | // revert to TARGET_INFLIGHT. |
| 1149 | // |
| 1150 | // We don't need a queue of URLs to send, as only the latest is useful. |
| 1151 | enum { |
| 1152 | TARGET_NONE, |
| 1153 | TARGET_INFLIGHT, // We have a request in-flight, waiting for an ACK |
| 1154 | TARGET_PENDING // INFLIGHT + we have a URL waiting to be sent |
| 1155 | } target_url_status_; |
| 1156 | |
| 1157 | // The URL we show the user in the status bar. We use this to determine if we |
| 1158 | // want to send a new one (we do not need to send duplicates). It will be |
| 1159 | // equal to either |mouse_over_url_| or |focus_url_|, depending on which was |
| 1160 | // updated last. |
| 1161 | GURL target_url_; |
| 1162 | |
| 1163 | // The URL the user's mouse is hovering over. |
| 1164 | GURL mouse_over_url_; |
| 1165 | |
| 1166 | // The URL that has keyboard focus. |
| 1167 | GURL focus_url_; |
| 1168 | |
| 1169 | // The next target URL we want to send to the browser. |
| 1170 | GURL pending_target_url_; |
| 1171 | |
[email protected] | 6e24cf1 | 2011-03-18 19:57:02 | [diff] [blame] | 1172 | // The text selection the last time DidChangeSelection got called. |
[email protected] | e99ef6f | 2011-10-16 01:13:00 | [diff] [blame] | 1173 | string16 selection_text_; |
| 1174 | size_t selection_text_offset_; |
| 1175 | ui::Range selection_range_; |
[email protected] | 6e24cf1 | 2011-03-18 19:57:02 | [diff] [blame] | 1176 | |
| 1177 | // View ---------------------------------------------------------------------- |
| 1178 | |
[email protected] | 6e24cf1 | 2011-03-18 19:57:02 | [diff] [blame] | 1179 | // Cache the preferred size of the page in order to prevent sending the IPC |
| 1180 | // when layout() recomputes but doesn't actually change sizes. |
| 1181 | gfx::Size preferred_size_; |
| 1182 | |
[email protected] | 1e0c8e0 | 2011-05-25 07:49:37 | [diff] [blame] | 1183 | // Used to delay determining the preferred size (to avoid intermediate |
| 1184 | // states for the sizes). |
[email protected] | 310ebd630 | 2011-10-10 19:06:28 | [diff] [blame] | 1185 | base::OneShotTimer<RenderViewImpl> check_preferred_size_timer_; |
[email protected] | 1e0c8e0 | 2011-05-25 07:49:37 | [diff] [blame] | 1186 | |
[email protected] | dd6afca | 2011-08-13 03:44:31 | [diff] [blame] | 1187 | // These store the "is main frame is scrolled all the way to the left |
| 1188 | // or right" state that was last sent to the browser. |
| 1189 | bool cached_is_main_frame_pinned_to_left_; |
| 1190 | bool cached_is_main_frame_pinned_to_right_; |
| 1191 | |
| 1192 | // These store the "has scrollbars" state last sent to the browser. |
| 1193 | bool cached_has_main_frame_horizontal_scrollbar_; |
| 1194 | bool cached_has_main_frame_vertical_scrollbar_; |
| 1195 | |
[email protected] | 6e24cf1 | 2011-03-18 19:57:02 | [diff] [blame] | 1196 | #if defined(OS_MACOSX) |
| 1197 | // Track the fake plugin window handles allocated on the browser side for |
| 1198 | // the accelerated compositor and (currently) accelerated plugins so that |
| 1199 | // we can discard them when the view goes away. |
| 1200 | std::set<gfx::PluginWindowHandle> fake_plugin_window_handles_; |
| 1201 | #endif |
| 1202 | |
[email protected] | 05a980d7a | 2012-02-07 22:16:42 | [diff] [blame] | 1203 | // When this view is composited, the context used for compositing may or may |
| 1204 | // not support the GL_CHROMIUM_swapbuffers_complete_callback extension. Since |
| 1205 | // querying for the existence of this extension is expensive we cache the |
| 1206 | // result. These are used to implement SupportsAsynchronousSwapBuffers(). |
| 1207 | bool context_has_swapbuffers_complete_callback_; |
| 1208 | bool queried_for_swapbuffers_complete_callback_; |
| 1209 | |
[email protected] | d0fb8a7 | 2012-03-10 18:54:52 | [diff] [blame] | 1210 | // Whether the WebGraphicsContext3D handed out by createGraphicsContext3D() a |
| 1211 | // WebGraphicsContext3DCommandBufferImpl. This is a HACK required by the fact |
| 1212 | // that there's no other way to tell whether webview()->graphicsContext3D() |
| 1213 | // has a ContentGLContext (and thus a CommandBufferProxy & associated |
| 1214 | // route_id) or not. |
| 1215 | bool context_is_web_graphics_context_3d_command_buffer_impl_; |
| 1216 | |
[email protected] | 6e24cf1 | 2011-03-18 19:57:02 | [diff] [blame] | 1217 | // Helper objects ------------------------------------------------------------ |
| 1218 | |
[email protected] | 6e24cf1 | 2011-03-18 19:57:02 | [diff] [blame] | 1219 | RendererWebCookieJarImpl cookie_jar_; |
| 1220 | |
| 1221 | // The next group of objects all implement RenderViewObserver, so are deleted |
[email protected] | 310ebd630 | 2011-10-10 19:06:28 | [diff] [blame] | 1222 | // along with the RenderView automatically. This is why we just store |
| 1223 | // weak references. |
[email protected] | 6e24cf1 | 2011-03-18 19:57:02 | [diff] [blame] | 1224 | |
[email protected] | 6e24cf1 | 2011-03-18 19:57:02 | [diff] [blame] | 1225 | // Holds a reference to the service which provides desktop notifications. |
| 1226 | NotificationProvider* notification_provider_; |
| 1227 | |
| 1228 | // The geolocation dispatcher attached to this view, lazily initialized. |
| 1229 | GeolocationDispatcher* geolocation_dispatcher_; |
| 1230 | |
[email protected] | 0d9989d | 2011-12-21 20:26:00 | [diff] [blame] | 1231 | // The intents host attached to this view. Not lazily initialized. |
| 1232 | WebIntentsHost* intents_host_; |
[email protected] | 1ef9313 | 2011-09-16 18:33:47 | [diff] [blame] | 1233 | |
[email protected] | 6e24cf1 | 2011-03-18 19:57:02 | [diff] [blame] | 1234 | // The speech dispatcher attached to this view, lazily initialized. |
[email protected] | c52b289 | 2012-03-07 11:01:02 | [diff] [blame] | 1235 | InputTagSpeechDispatcher* input_tag_speech_dispatcher_; |
[email protected] | 6e24cf1 | 2011-03-18 19:57:02 | [diff] [blame] | 1236 | |
| 1237 | // Device orientation dispatcher attached to this view; lazily initialized. |
| 1238 | DeviceOrientationDispatcher* device_orientation_dispatcher_; |
| 1239 | |
[email protected] | 273558fb | 2012-01-12 15:03:51 | [diff] [blame] | 1240 | // MediaStream dispatcher attached to this view; lazily initialized. |
| 1241 | MediaStreamDispatcher* media_stream_dispatcher_; |
| 1242 | |
[email protected] | ab2c473 | 2011-07-20 19:57:40 | [diff] [blame] | 1243 | // MediaStreamImpl attached to this view; lazily initialized. |
[email protected] | 1bc65a4 | 2012-04-23 09:31:25 | [diff] [blame] | 1244 | MediaStreamImpl* media_stream_impl_; |
[email protected] | ab2c473 | 2011-07-20 19:57:40 | [diff] [blame] | 1245 | |
[email protected] | 6e24cf1 | 2011-03-18 19:57:02 | [diff] [blame] | 1246 | // Dispatches all P2P socket used by the renderer. |
[email protected] | b3f8f972 | 2011-08-25 20:56:07 | [diff] [blame] | 1247 | content::P2PSocketDispatcher* p2p_socket_dispatcher_; |
[email protected] | 6e24cf1 | 2011-03-18 19:57:02 | [diff] [blame] | 1248 | |
[email protected] | c5c1d6d | 2011-07-28 18:42:41 | [diff] [blame] | 1249 | DevToolsAgent* devtools_agent_; |
| 1250 | |
[email protected] | 063afcb | 2011-09-29 07:54:32 | [diff] [blame] | 1251 | RendererAccessibility* renderer_accessibility_; |
| 1252 | |
[email protected] | 7f3c7af | 2011-10-20 22:52:51 | [diff] [blame] | 1253 | // Java Bridge dispatcher attached to this view; lazily initialized. |
[email protected] | 7e9c5bb0 | 2012-05-14 13:58:31 | [diff] [blame] | 1254 | JavaBridgeDispatcher* java_bridge_dispatcher_; |
[email protected] | 7f3c7af | 2011-10-20 22:52:51 | [diff] [blame] | 1255 | |
[email protected] | 217690d | 2012-01-27 07:33:11 | [diff] [blame] | 1256 | // Mouse Lock dispatcher attached to this view. |
| 1257 | MouseLockDispatcher* mouse_lock_dispatcher_; |
| 1258 | |
[email protected] | 6e24cf1 | 2011-03-18 19:57:02 | [diff] [blame] | 1259 | // Misc ---------------------------------------------------------------------- |
| 1260 | |
| 1261 | // The current and pending file chooser completion objects. If the queue is |
| 1262 | // nonempty, the first item represents the currently running file chooser |
| 1263 | // callback, and the remaining elements are the other file chooser completion |
| 1264 | // still waiting to be run (in order). |
| 1265 | struct PendingFileChooser; |
| 1266 | std::deque< linked_ptr<PendingFileChooser> > file_chooser_completions_; |
| 1267 | |
[email protected] | 600ea40 | 2011-04-12 00:01:51 | [diff] [blame] | 1268 | // The current directory enumeration callback |
| 1269 | std::map<int, WebKit::WebFileChooserCompletion*> enumeration_completions_; |
| 1270 | int enumeration_completion_id_; |
| 1271 | |
[email protected] | 6e24cf1 | 2011-03-18 19:57:02 | [diff] [blame] | 1272 | // The SessionStorage namespace that we're assigned to has an ID, and that ID |
| 1273 | // is passed to us upon creation. WebKit asks for this ID upon first use and |
| 1274 | // uses it whenever asking the browser process to allocate new storage areas. |
| 1275 | int64 session_storage_namespace_id_; |
| 1276 | |
| 1277 | // The total number of unrequested popups that exist and can be followed back |
[email protected] | 310ebd630 | 2011-10-10 19:06:28 | [diff] [blame] | 1278 | // to a common opener. This count is shared among all RenderViews created with |
| 1279 | // createView(). All popups are treated as unrequested until specifically |
| 1280 | // instructed otherwise by the Browser process. |
[email protected] | 6e24cf1 | 2011-03-18 19:57:02 | [diff] [blame] | 1281 | scoped_refptr<SharedRenderViewCounter> shared_popup_counter_; |
| 1282 | |
| 1283 | // Whether this is a top level window (instead of a popup). Top level windows |
| 1284 | // shouldn't count against their own |shared_popup_counter_|. |
| 1285 | bool decrement_shared_popup_at_destruction_; |
| 1286 | |
| 1287 | // If the browser hasn't sent us an ACK for the last FindReply we sent |
| 1288 | // to it, then we need to queue up the message (keeping only the most |
| 1289 | // recent message if new ones come in). |
| 1290 | scoped_ptr<IPC::Message> queued_find_reply_message_; |
| 1291 | |
| 1292 | // Stores edit commands associated to the next key event. |
| 1293 | // Shall be cleared as soon as the next key event is processed. |
| 1294 | EditCommands edit_commands_; |
| 1295 | |
[email protected] | 6e24cf1 | 2011-03-18 19:57:02 | [diff] [blame] | 1296 | // Allows Web UI pages (new tab page, etc.) to talk to the browser. The JS |
| 1297 | // object is only exposed when Web UI bindings are enabled. |
| 1298 | scoped_ptr<WebUIBindings> web_ui_bindings_; |
| 1299 | |
[email protected] | 6e24cf1 | 2011-03-18 19:57:02 | [diff] [blame] | 1300 | // The external popup for the currently showing select popup. |
| 1301 | scoped_ptr<ExternalPopupMenu> external_popup_menu_; |
| 1302 | |
| 1303 | // The node that the context menu was pressed over. |
| 1304 | WebKit::WebNode context_menu_node_; |
| 1305 | |
| 1306 | // Reports load progress to the browser. |
| 1307 | scoped_ptr<LoadProgressTracker> load_progress_tracker_; |
| 1308 | |
| 1309 | // All the registered observers. We expect this list to be small, so vector |
| 1310 | // is fine. |
[email protected] | 3a034ebb | 2011-10-03 19:19:44 | [diff] [blame] | 1311 | ObserverList<content::RenderViewObserver> observers_; |
[email protected] | 6e24cf1 | 2011-03-18 19:57:02 | [diff] [blame] | 1312 | |
[email protected] | 4fb6014 | 2011-08-09 02:22:08 | [diff] [blame] | 1313 | // Used to inform didChangeSelection() when it is called in the context |
| 1314 | // of handling a ViewMsg_SelectRange IPC. |
| 1315 | bool handling_select_range_; |
| 1316 | |
[email protected] | 217690d | 2012-01-27 07:33:11 | [diff] [blame] | 1317 | // Wraps the |webwidget_| as a MouseLockDispatcher::LockTarget interface. |
| 1318 | scoped_ptr<MouseLockDispatcher::LockTarget> webwidget_mouse_lock_target_; |
| 1319 | |
[email protected] | ef5e98e | 2011-12-06 09:49:18 | [diff] [blame] | 1320 | // Plugins ------------------------------------------------------------------- |
| 1321 | |
| 1322 | // All the currently active plugin delegates for this RenderView; kept so |
| 1323 | // that we can enumerate them to send updates about things like window |
| 1324 | // location or tab focus and visibily. These are non-owning references. |
| 1325 | std::set<WebPluginDelegateProxy*> plugin_delegates_; |
| 1326 | |
| 1327 | #if defined(OS_WIN) |
| 1328 | // The ID of the focused NPAPI plug-in. |
| 1329 | int focused_plugin_id_; |
| 1330 | #endif |
| 1331 | |
[email protected] | 766a708 | 2012-02-03 23:39:15 | [diff] [blame] | 1332 | // Allows JS to access DOM automation. The JS object is only exposed when the |
| 1333 | // DOM automation bindings are enabled. |
| 1334 | scoped_ptr<DomAutomationController> dom_automation_controller_; |
| 1335 | |
[email protected] | 8cca3da | 2012-03-20 08:26:34 | [diff] [blame] | 1336 | // Indicates whether this RenderView is a guest of another RenderView. |
| 1337 | bool guest_; |
| 1338 | |
[email protected] | 3e3c452 | 2012-04-13 21:16:29 | [diff] [blame] | 1339 | // The accessibility mode. |
| 1340 | AccessibilityMode accessibility_mode_; |
| 1341 | |
[email protected] | ef5e98e | 2011-12-06 09:49:18 | [diff] [blame] | 1342 | // NOTE: pepper_delegate_ should be last member because its constructor calls |
| 1343 | // AddObservers method of RenderViewImpl from c-tor. |
[email protected] | ca00e916 | 2012-04-03 05:35:36 | [diff] [blame] | 1344 | content::PepperPluginDelegateImpl pepper_delegate_; |
[email protected] | ef5e98e | 2011-12-06 09:49:18 | [diff] [blame] | 1345 | |
[email protected] | 6e24cf1 | 2011-03-18 19:57:02 | [diff] [blame] | 1346 | // --------------------------------------------------------------------------- |
| 1347 | // ADDING NEW DATA? Please see if it fits appropriately in one of the above |
| 1348 | // sections rather than throwing it randomly at the end. If you're adding a |
| 1349 | // bunch of stuff, you should probably create a helper class and put your |
[email protected] | 310ebd630 | 2011-10-10 19:06:28 | [diff] [blame] | 1350 | // data and methods on that to avoid bloating RenderView more. You can |
| 1351 | // use the Observer interface to filter IPC messages and receive frame change |
[email protected] | 6e24cf1 | 2011-03-18 19:57:02 | [diff] [blame] | 1352 | // notifications. |
| 1353 | // --------------------------------------------------------------------------- |
| 1354 | |
[email protected] | 310ebd630 | 2011-10-10 19:06:28 | [diff] [blame] | 1355 | DISALLOW_COPY_AND_ASSIGN(RenderViewImpl); |
[email protected] | 6e24cf1 | 2011-03-18 19:57:02 | [diff] [blame] | 1356 | }; |
| 1357 | |
[email protected] | 310ebd630 | 2011-10-10 19:06:28 | [diff] [blame] | 1358 | #endif // CONTENT_RENDERER_RENDER_VIEW_IMPL_H_ |