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