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