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