blob: e8728f4f292232d4982d2300f6d6c78d36769b3b [file] [log] [blame]
[email protected]81375e872012-01-11 21:40:361// Copyright (c) 2012 The Chromium Authors. All rights reserved.
[email protected]6e24cf12011-03-18 19:57:022// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
[email protected]310ebd6302011-10-10 19:06:285#ifndef CONTENT_RENDERER_RENDER_VIEW_IMPL_H_
6#define CONTENT_RENDERER_RENDER_VIEW_IMPL_H_
[email protected]6e24cf12011-03-18 19:57:027#pragma once
8
9#include <deque>
10#include <map>
11#include <queue>
12#include <set>
13#include <string>
14#include <vector>
15
[email protected]6e24cf12011-03-18 19:57:0216#include "base/basictypes.h"
17#include "base/gtest_prod_util.h"
18#include "base/id_map.h"
[email protected]3b63f8f42011-03-28 01:54:1519#include "base/memory/linked_ptr.h"
20#include "base/memory/weak_ptr.h"
[email protected]6e24cf12011-03-18 19:57:0221#include "base/observer_list.h"
22#include "base/timer.h"
[email protected]6e24cf12011-03-18 19:57:0223#include "build/build_config.h"
[email protected]b781ff282011-08-20 06:19:3624#include "content/renderer/render_view_selection.h"
[email protected]6e24cf12011-03-18 19:57:0225#include "content/renderer/renderer_webcookiejar_impl.h"
[email protected]8d128d62011-09-13 22:11:5726#include "content/common/content_export.h"
[email protected]55722152011-03-22 01:33:5327#include "content/common/edit_command.h"
[email protected]6e24cf12011-03-18 19:57:0228#include "content/common/navigation_gesture.h"
[email protected]54087fe2011-10-28 22:02:4829#include "content/public/common/page_zoom.h"
[email protected]445e1042011-12-03 21:03:1530#include "content/public/common/referrer.h"
[email protected]daf82f82011-10-31 22:35:3131#include "content/public/common/renderer_preferences.h"
[email protected]815dd9872011-11-23 18:40:3032#include "content/public/common/stop_find_action.h"
[email protected]a2ef54c2011-10-10 16:20:3133#include "content/public/renderer/render_view.h"
[email protected]6e24cf12011-03-18 19:57:0234#include "content/renderer/pepper_plugin_delegate_impl.h"
35#include "content/renderer/render_widget.h"
36#include "ipc/ipc_platform_file.h"
[email protected]6e24cf12011-03-18 19:57:0237#include "third_party/WebKit/Source/WebKit/chromium/public/WebConsoleMessage.h"
[email protected]e6e90dc2011-12-03 00:01:3738#include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebFileSystem.h"
[email protected]6e24cf12011-03-18 19:57:0239#include "third_party/WebKit/Source/WebKit/chromium/public/WebFrameClient.h"
[email protected]42054a252011-05-17 18:02:1340#include "third_party/WebKit/Source/WebKit/chromium/public/WebIconURL.h"
[email protected]6e24cf12011-03-18 19:57:0241#include "third_party/WebKit/Source/WebKit/chromium/public/WebNode.h"
[email protected]18d5be92011-07-25 18:00:1942#include "third_party/WebKit/Source/WebKit/chromium/public/WebPageSerializerClient.h"
[email protected]94dec932011-05-26 20:04:2143#include "third_party/WebKit/Source/WebKit/chromium/public/WebPageVisibilityState.h"
[email protected]6e24cf12011-03-18 19:57:0244#include "third_party/WebKit/Source/WebKit/chromium/public/WebTextDirection.h"
45#include "third_party/WebKit/Source/WebKit/chromium/public/WebViewClient.h"
46#include "third_party/WebKit/Source/WebKit/chromium/public/WebNavigationType.h"
[email protected]7e8b4d12012-01-20 23:39:5147#include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebGraphicsContext3D.h"
[email protected]269f86d2011-12-07 02:43:4748#include "ui/base/javascript_message_type.h"
[email protected]b9b751f22011-03-25 14:04:1249#include "ui/gfx/surface/transport_dib.h"
[email protected]6e24cf12011-03-18 19:57:0250#include "webkit/glue/webpreferences.h"
[email protected]a9288f52011-11-17 05:18:1651#include "webkit/media/webmediaplayer_delegate.h"
[email protected]6e24cf12011-03-18 19:57:0252#include "webkit/plugins/npapi/webplugin_page_delegate.h"
53
54#if defined(OS_WIN)
[email protected]310ebd6302011-10-10 19:06:2855// RenderViewImpl is a diamond-shaped hierarchy, with WebWidgetClient at the
56// root. VS warns when we inherit the WebWidgetClient method implementations
57// from RenderWidget. It's safe to ignore that warning.
[email protected]6e24cf12011-03-18 19:57:0258#pragma warning(disable: 4250)
59#endif
60
[email protected]6e24cf12011-03-18 19:57:0261class DeviceOrientationDispatcher;
[email protected]c5c1d6d2011-07-28 18:42:4162class DevToolsAgent;
[email protected]55722152011-03-22 01:33:5363class ExternalPopupMenu;
[email protected]6e24cf12011-03-18 19:57:0264class GeolocationDispatcher;
[email protected]6e24cf12011-03-18 19:57:0265class GURL;
[email protected]7f3c7af2011-10-20 22:52:5166class JavaBridgeDispatcher;
[email protected]6e24cf12011-03-18 19:57:0267class LoadProgressTracker;
[email protected]273558fb2012-01-12 15:03:5168class MediaStreamDispatcher;
[email protected]ab2c4732011-07-20 19:57:4069class MediaStreamImpl;
[email protected]217690d2012-01-27 07:33:1170class MouseLockDispatcher;
[email protected]6e24cf12011-03-18 19:57:0271class NotificationProvider;
[email protected]6e24cf12011-03-18 19:57:0272class PepperDeviceTest;
[email protected]83f93d32011-11-11 00:43:3073struct PP_NetAddress_Private;
[email protected]ea192e82011-04-11 19:16:0274class RenderWidgetFullscreenPepper;
[email protected]063afcb2011-09-29 07:54:3275class RendererAccessibility;
[email protected]6e24cf12011-03-18 19:57:0276class SkBitmap;
77class SpeechInputDispatcher;
[email protected]6e24cf12011-03-18 19:57:0278struct ViewMsg_Navigate_Params;
79struct ViewMsg_StopFinding_Params;
[email protected]83f93d32011-11-11 00:43:3080struct ViewMsg_SwapOut_Params;
[email protected]6e24cf12011-03-18 19:57:0281struct WebDropData;
[email protected]0d9989d2011-12-21 20:26:0082class WebIntentsHost;
[email protected]83f93d32011-11-11 00:43:3083class WebPluginDelegateProxy;
84class WebUIBindings;
[email protected]b3f8f9722011-08-25 20:56:0785
86namespace content {
[email protected]007733c2011-11-17 00:34:0787class DocumentState;
[email protected]b3f8f9722011-08-25 20:56:0788class P2PSocketDispatcher;
[email protected]3a034ebb2011-10-03 19:19:4489class RenderViewObserver;
[email protected]007733c2011-11-17 00:34:0790class RenderViewTest;
[email protected]8caadeb2011-11-22 02:45:2391struct FileChooserParams;
[email protected]b3f8f9722011-08-25 20:56:0792} // namespace content
[email protected]6e24cf12011-03-18 19:57:0293
[email protected]6e24cf12011-03-18 19:57:0294namespace gfx {
95class Point;
96class Rect;
[email protected]b3f8f9722011-08-25 20:56:0797} // namespace gfx
[email protected]6e24cf12011-03-18 19:57:0298
99namespace webkit {
100
[email protected]6e24cf12011-03-18 19:57:02101namespace ppapi {
[email protected]6e24cf12011-03-18 19:57:02102class PluginInstance;
[email protected]6e24cf12011-03-18 19:57:02103} // namespace ppapi
104
105} // namespace webkit
106
107namespace webkit_glue {
108struct CustomContextMenuContext;
109class ImageResourceFetcher;
[email protected]6e24cf12011-03-18 19:57:02110class ResourceFetcher;
111}
112
113namespace WebKit {
[email protected]6e24cf12011-03-18 19:57:02114class WebApplicationCacheHost;
115class WebApplicationCacheHostClient;
116class WebDataSource;
[email protected]6e24cf12011-03-18 19:57:02117class WebDragData;
[email protected]6e24cf12011-03-18 19:57:02118class WebGeolocationClient;
[email protected]42054a252011-05-17 18:02:13119class WebIconURL;
[email protected]6e24cf12011-03-18 19:57:02120class WebImage;
[email protected]6e24cf12011-03-18 19:57:02121class WebMediaPlayer;
122class WebMediaPlayerClient;
123class WebMouseEvent;
[email protected]273558fb2012-01-12 15:03:51124class WebPeerConnectionHandler;
125class WebPeerConnectionHandlerClient;
[email protected]6e24cf12011-03-18 19:57:02126class WebSpeechInputController;
127class WebSpeechInputListener;
128class WebStorageNamespace;
[email protected]2d0f2e92011-10-03 09:02:24129class WebTouchEvent;
[email protected]b00ba702011-08-17 01:41:03130class WebURLLoader;
[email protected]6e24cf12011-03-18 19:57:02131class WebURLRequest;
[email protected]273558fb2012-01-12 15:03:51132class WebUserMediaClient;
[email protected]6e24cf12011-03-18 19:57:02133struct WebFileChooserParams;
134struct WebFindOptions;
135struct WebMediaPlayerAction;
[email protected]81375e872012-01-11 21:40:36136struct WebPluginAction;
[email protected]6e24cf12011-03-18 19:57:02137struct WebPoint;
138struct WebWindowFeatures;
139}
140
141// We need to prevent a page from trying to create infinite popups. It is not
142// as simple as keeping a count of the number of immediate children
143// popups. Having an html file that window.open()s itself would create
144// an unlimited chain of RenderViews who only have one RenderView child.
145//
146// Therefore, each new top level RenderView creates a new counter and shares it
[email protected]310ebd6302011-10-10 19:06:28147// with all its children and grandchildren popup RenderViewImpls created with
[email protected]6e24cf12011-03-18 19:57:02148// createView() to have a sort of global limit for the page so no more than
149// kMaximumNumberOfPopups popups are created.
150//
151// This is a RefCounted holder of an int because I can't say
152// scoped_refptr<int>.
153typedef base::RefCountedData<int> SharedRenderViewCounter;
154
155//
156// RenderView is an object that manages a WebView object, and provides a
157// communication interface with an embedding application process
158//
[email protected]310ebd6302011-10-10 19:06:28159class RenderViewImpl : public RenderWidget,
160 public WebKit::WebViewClient,
161 public WebKit::WebFrameClient,
162 public WebKit::WebPageSerializerClient,
163 public content::RenderView,
164 public webkit::npapi::WebPluginPageDelegate,
[email protected]a9288f52011-11-17 05:18:16165 public webkit_media::WebMediaPlayerDelegate,
[email protected]310ebd6302011-10-10 19:06:28166 public base::SupportsWeakPtr<RenderViewImpl> {
[email protected]6e24cf12011-03-18 19:57:02167 public:
168 // Creates a new RenderView. The parent_hwnd specifies a HWND to use as the
[email protected]5f9de5882011-09-30 23:36:28169 // parent of the WebView HWND that will be created. If this is a blocked
[email protected]6e24cf12011-03-18 19:57:02170 // popup or as a new tab, opener_id is the routing ID of the RenderView
171 // responsible for creating this RenderView (corresponding to parent_hwnd).
172 // |counter| is either a currently initialized counter, or NULL (in which case
173 // we treat this RenderView as a top level window).
[email protected]310ebd6302011-10-10 19:06:28174 CONTENT_EXPORT static RenderViewImpl* Create(
[email protected]6e24cf12011-03-18 19:57:02175 gfx::NativeViewId parent_hwnd,
176 int32 opener_id,
[email protected]daf82f82011-10-31 22:35:31177 const content::RendererPreferences& renderer_prefs,
[email protected]6e24cf12011-03-18 19:57:02178 const WebPreferences& webkit_prefs,
179 SharedRenderViewCounter* counter,
180 int32 routing_id,
[email protected]9f4f3322012-01-18 22:29:56181 int32 surface_id,
[email protected]6e24cf12011-03-18 19:57:02182 int64 session_storage_namespace_id,
[email protected]74ce1ad2011-12-16 21:51:46183 const string16& frame_name,
184 int32 next_page_id);
[email protected]6e24cf12011-03-18 19:57:02185
[email protected]310ebd6302011-10-10 19:06:28186 // Returns the RenderViewImpl containing the given WebView.
187 CONTENT_EXPORT static RenderViewImpl* FromWebView(WebKit::WebView* webview);
[email protected]6e24cf12011-03-18 19:57:02188
[email protected]6e24cf12011-03-18 19:57:02189 // May return NULL when the view is closing.
[email protected]8d128d62011-09-13 22:11:57190 CONTENT_EXPORT WebKit::WebView* webview() const;
[email protected]6e24cf12011-03-18 19:57:02191
[email protected]65225772011-05-12 21:10:24192 // Called by a GraphicsContext associated with this view when swapbuffers
[email protected]37a6f302011-07-11 23:43:08193 // is posted, completes or is aborted.
194 void OnViewContextSwapBuffersPosted();
[email protected]65225772011-05-12 21:10:24195 void OnViewContextSwapBuffersComplete();
196 void OnViewContextSwapBuffersAborted();
197
[email protected]d466b8a2011-07-15 21:48:03198 int history_list_offset() const { return history_list_offset_; }
[email protected]6e24cf12011-03-18 19:57:02199
[email protected]6e24cf12011-03-18 19:57:02200 const WebPreferences& webkit_preferences() const {
201 return webkit_preferences_;
202 }
203
204 void set_send_content_state_immediately(bool value) {
205 send_content_state_immediately_ = value;
206 }
207
[email protected]273558fb2012-01-12 15:03:51208 MediaStreamDispatcher* media_stream_dispatcher() {
209 return media_stream_dispatcher_;
210 }
211
[email protected]6e24cf12011-03-18 19:57:02212 // Current P2PSocketDispatcher. Set to NULL if P2P API is disabled.
[email protected]b3f8f9722011-08-25 20:56:07213 content::P2PSocketDispatcher* p2p_socket_dispatcher() {
[email protected]6e24cf12011-03-18 19:57:02214 return p2p_socket_dispatcher_;
215 }
216
[email protected]217690d2012-01-27 07:33:11217 MouseLockDispatcher* mouse_lock_dispatcher() {
218 return mouse_lock_dispatcher_;
219 }
220
[email protected]273558fb2012-01-12 15:03:51221 WebKit::WebPeerConnectionHandler* CreatePeerConnectionHandler(
222 WebKit::WebPeerConnectionHandlerClient* client);
223
[email protected]6e24cf12011-03-18 19:57:02224 // Functions to add and remove observers for this object.
[email protected]3a034ebb2011-10-03 19:19:44225 void AddObserver(content::RenderViewObserver* observer);
226 void RemoveObserver(content::RenderViewObserver* observer);
[email protected]6e24cf12011-03-18 19:57:02227
[email protected]6e24cf12011-03-18 19:57:02228 // Adds the given file chooser request to the file_chooser_completion_ queue
229 // (see that var for more) and requests the chooser be displayed if there are
230 // no other waiting items in the queue.
231 //
232 // Returns true if the chooser was successfully scheduled. False means we
233 // didn't schedule anything.
[email protected]8caadeb2011-11-22 02:45:23234 bool ScheduleFileChooser(const content::FileChooserParams& params,
[email protected]6e24cf12011-03-18 19:57:02235 WebKit::WebFileChooserCompletion* completion);
236
[email protected]6e24cf12011-03-18 19:57:02237 // Sets whether the renderer should report load progress to the browser.
238 void SetReportLoadProgressEnabled(bool enabled);
239
[email protected]a2ef54c2011-10-10 16:20:31240 void LoadNavigationErrorPage(
[email protected]8d128d62011-09-13 22:11:57241 WebKit::WebFrame* frame,
242 const WebKit::WebURLRequest& failed_request,
243 const WebKit::WebURLError& error,
244 const std::string& html,
245 bool replace);
[email protected]9966325b2011-04-18 05:00:10246
[email protected]6e24cf12011-03-18 19:57:02247 // Plugin-related functions --------------------------------------------------
248 // (See also WebPluginPageDelegate implementation.)
249
250 // Notification that the given plugin has crashed.
251 void PluginCrashed(const FilePath& plugin_path);
252
[email protected]6e24cf12011-03-18 19:57:02253 // Creates a fullscreen container for a pepper plugin instance.
[email protected]ea192e82011-04-11 19:16:02254 RenderWidgetFullscreenPepper* CreatePepperFullscreenContainer(
[email protected]6e24cf12011-03-18 19:57:02255 webkit::ppapi::PluginInstance* plugin);
256
[email protected]56ea1a62011-05-30 07:05:57257 // Informs the render view that a PPAPI plugin has gained or lost focus.
258 void PpapiPluginFocusChanged();
259
[email protected]73bf95812011-10-12 11:38:32260 // Informs the render view that a PPAPI plugin has changed text input status.
261 void PpapiPluginTextInputTypeChanged();
[email protected]3f783362011-10-21 22:40:50262 void PpapiPluginCaretPositionChanged();
[email protected]73bf95812011-10-12 11:38:32263
264 // Cancels current composition.
265 void PpapiPluginCancelComposition();
266
[email protected]b25b3ee2012-01-13 05:19:54267 // Retrieves the current caret position if a PPAPI plugin has focus.
268 bool GetPpapiPluginCaretBounds(gfx::Rect* rect);
269
[email protected]e6ae0f6c2011-10-04 10:39:23270#if defined(OS_MACOSX) || defined(OS_WIN)
[email protected]6e24cf12011-03-18 19:57:02271 // Informs the render view that the given plugin has gained or lost focus.
272 void PluginFocusChanged(bool focused, int plugin_id);
[email protected]e6ae0f6c2011-10-04 10:39:23273#endif
[email protected]6e24cf12011-03-18 19:57:02274
[email protected]e6ae0f6c2011-10-04 10:39:23275#if defined(OS_MACOSX)
[email protected]6e24cf12011-03-18 19:57:02276 // Starts plugin IME.
277 void StartPluginIme();
278
279 // Helper routines for accelerated plugin support. Used by the
280 // WebPluginDelegateProxy, which has a pointer to the RenderView.
281 gfx::PluginWindowHandle AllocateFakePluginWindowHandle(bool opaque,
282 bool root);
283 void DestroyFakePluginWindowHandle(gfx::PluginWindowHandle window);
284 void AcceleratedSurfaceSetIOSurface(gfx::PluginWindowHandle window,
285 int32 width,
286 int32 height,
287 uint64 io_surface_identifier);
288 TransportDIB::Handle AcceleratedSurfaceAllocTransportDIB(size_t size);
289 void AcceleratedSurfaceFreeTransportDIB(TransportDIB::Id dib_id);
290 void AcceleratedSurfaceSetTransportDIB(gfx::PluginWindowHandle window,
291 int32 width,
292 int32 height,
293 TransportDIB::Handle transport_dib);
294 void AcceleratedSurfaceBuffersSwapped(gfx::PluginWindowHandle window,
295 uint64 surface_id);
296#endif
297
298 void RegisterPluginDelegate(WebPluginDelegateProxy* delegate);
299 void UnregisterPluginDelegate(WebPluginDelegateProxy* delegate);
300
[email protected]4a7d6392011-09-19 20:55:08301 // Helper function to retrieve information about a plugin for a URL and mime
302 // type. Returns false if no plugin was found.
303 // |actual_mime_type| is the actual mime type supported by the
304 // plugin found that match the URL given (one for each item in
305 // |info|).
[email protected]84c13c032011-09-23 00:12:22306 CONTENT_EXPORT bool GetPluginInfo(const GURL& url,
307 const GURL& page_url,
308 const std::string& mime_type,
309 webkit::WebPluginInfo* plugin_info,
310 std::string* actual_mime_type);
[email protected]4a7d6392011-09-19 20:55:08311
[email protected]6e24cf12011-03-18 19:57:02312 // IPC::Channel::Listener implementation -------------------------------------
313
[email protected]edc64de2011-11-17 20:07:38314 virtual bool OnMessageReceived(const IPC::Message& msg) OVERRIDE;
[email protected]6e24cf12011-03-18 19:57:02315
316 // WebKit::WebWidgetClient implementation ------------------------------------
317
318 // Most methods are handled by RenderWidget.
319 virtual void didFocus();
320 virtual void didBlur();
321 virtual void show(WebKit::WebNavigationPolicy policy);
322 virtual void runModal();
[email protected]2b624c562011-10-27 22:58:26323 virtual bool enterFullScreen();
324 virtual void exitFullScreen();
[email protected]217690d2012-01-27 07:33:11325 virtual bool requestPointerLock();
326 virtual void requestPointerUnlock();
327 virtual bool isPointerLocked();
[email protected]6e24cf12011-03-18 19:57:02328
329 // WebKit::WebViewClient implementation --------------------------------------
330
331 virtual WebKit::WebView* createView(
332 WebKit::WebFrame* creator,
333 const WebKit::WebURLRequest& request,
334 const WebKit::WebWindowFeatures& features,
335 const WebKit::WebString& frame_name);
336 virtual WebKit::WebWidget* createPopupMenu(WebKit::WebPopupType popup_type);
337 virtual WebKit::WebWidget* createPopupMenu(
338 const WebKit::WebPopupMenuInfo& info);
339 virtual WebKit::WebExternalPopupMenu* createExternalPopupMenu(
340 const WebKit::WebPopupMenuInfo& popup_menu_info,
341 WebKit::WebExternalPopupMenuClient* popup_menu_client);
342 virtual WebKit::WebStorageNamespace* createSessionStorageNamespace(
343 unsigned quota);
[email protected]7e8b4d12012-01-20 23:39:51344 virtual WebKit::WebGraphicsContext3D* createGraphicsContext3D(
345 WebKit::WebGraphicsContext3D::Attributes attributes,
346 bool direct);
[email protected]6e24cf12011-03-18 19:57:02347 virtual void didAddMessageToConsole(
348 const WebKit::WebConsoleMessage& message,
349 const WebKit::WebString& source_name,
350 unsigned source_line);
351 virtual void printPage(WebKit::WebFrame* frame);
352 virtual WebKit::WebNotificationPresenter* notificationPresenter();
[email protected]8a58c1c2011-04-19 18:40:12353 virtual bool enumerateChosenDirectory(
354 const WebKit::WebString& path,
355 WebKit::WebFileChooserCompletion* chooser_completion);
[email protected]6e24cf12011-03-18 19:57:02356 virtual void didStartLoading();
357 virtual void didStopLoading();
358 virtual void didChangeLoadProgress(WebKit::WebFrame* frame,
359 double load_progress);
360 virtual bool isSmartInsertDeleteEnabled();
361 virtual bool isSelectTrailingWhitespaceEnabled();
362 virtual void didChangeSelection(bool is_selection_empty);
363 virtual void didExecuteCommand(const WebKit::WebString& command_name);
364 virtual bool handleCurrentKeyboardEvent();
[email protected]6e24cf12011-03-18 19:57:02365 virtual bool runFileChooser(
366 const WebKit::WebFileChooserParams& params,
367 WebKit::WebFileChooserCompletion* chooser_completion);
368 virtual void runModalAlertDialog(WebKit::WebFrame* frame,
369 const WebKit::WebString& message);
370 virtual bool runModalConfirmDialog(WebKit::WebFrame* frame,
371 const WebKit::WebString& message);
372 virtual bool runModalPromptDialog(WebKit::WebFrame* frame,
373 const WebKit::WebString& message,
374 const WebKit::WebString& default_value,
375 WebKit::WebString* actual_value);
376 virtual bool runModalBeforeUnloadDialog(WebKit::WebFrame* frame,
377 const WebKit::WebString& message);
378 virtual void showContextMenu(WebKit::WebFrame* frame,
379 const WebKit::WebContextMenuData& data);
[email protected]2b624c562011-10-27 22:58:26380 virtual void enterFullscreen();
381 virtual void exitFullscreen();
[email protected]6e24cf12011-03-18 19:57:02382 virtual void setStatusText(const WebKit::WebString& text);
383 virtual void setMouseOverURL(const WebKit::WebURL& url);
384 virtual void setKeyboardFocusURL(const WebKit::WebURL& url);
[email protected]6e24cf12011-03-18 19:57:02385 virtual void startDragging(const WebKit::WebDragData& data,
386 WebKit::WebDragOperationsMask mask,
387 const WebKit::WebImage& image,
388 const WebKit::WebPoint& imageOffset);
389 virtual bool acceptsLoadDrops();
390 virtual void focusNext();
391 virtual void focusPrevious();
392 virtual void focusedNodeChanged(const WebKit::WebNode& node);
[email protected]169d4282011-11-30 19:33:59393 virtual void didUpdateLayout();
[email protected]6e24cf12011-03-18 19:57:02394 virtual void navigateBackForwardSoon(int offset);
395 virtual int historyBackListCount();
396 virtual int historyForwardListCount();
397 virtual void postAccessibilityNotification(
398 const WebKit::WebAccessibilityObject& obj,
399 WebKit::WebAccessibilityNotification notification);
400 virtual void didUpdateInspectorSetting(const WebKit::WebString& key,
401 const WebKit::WebString& value);
402 virtual WebKit::WebGeolocationClient* geolocationClient();
403 virtual WebKit::WebSpeechInputController* speechInputController(
404 WebKit::WebSpeechInputListener* listener);
405 virtual WebKit::WebDeviceOrientationClient* deviceOrientationClient();
406 virtual void zoomLimitsChanged(double minimum_level, double maximum_level);
407 virtual void zoomLevelChanged();
408 virtual void registerProtocolHandler(const WebKit::WebString& scheme,
409 const WebKit::WebString& base_url,
410 const WebKit::WebString& url,
411 const WebKit::WebString& title);
[email protected]94dec932011-05-26 20:04:21412 virtual WebKit::WebPageVisibilityState visibilityState() const;
[email protected]273558fb2012-01-12 15:03:51413 virtual WebKit::WebUserMediaClient* userMediaClient();
[email protected]6e24cf12011-03-18 19:57:02414
415 // WebKit::WebFrameClient implementation -------------------------------------
416
417 virtual WebKit::WebPlugin* createPlugin(
418 WebKit::WebFrame* frame,
419 const WebKit::WebPluginParams& params);
[email protected]6e24cf12011-03-18 19:57:02420 virtual WebKit::WebSharedWorker* createSharedWorker(
421 WebKit::WebFrame* frame, const WebKit::WebURL& url,
422 const WebKit::WebString& name, unsigned long long documentId);
423 virtual WebKit::WebMediaPlayer* createMediaPlayer(
424 WebKit::WebFrame* frame,
425 WebKit::WebMediaPlayerClient* client);
426 virtual WebKit::WebApplicationCacheHost* createApplicationCacheHost(
427 WebKit::WebFrame* frame,
428 WebKit::WebApplicationCacheHostClient* client);
429 virtual WebKit::WebCookieJar* cookieJar(WebKit::WebFrame* frame);
430 virtual void frameDetached(WebKit::WebFrame* frame);
431 virtual void willClose(WebKit::WebFrame* frame);
[email protected]6e24cf12011-03-18 19:57:02432 virtual void loadURLExternally(WebKit::WebFrame* frame,
433 const WebKit::WebURLRequest& request,
434 WebKit::WebNavigationPolicy policy);
[email protected]0622875ab2011-07-27 12:10:34435 virtual void loadURLExternally(WebKit::WebFrame* frame,
436 const WebKit::WebURLRequest& request,
437 WebKit::WebNavigationPolicy policy,
438 const WebKit::WebString& suggested_name);
[email protected]6e24cf12011-03-18 19:57:02439 virtual WebKit::WebNavigationPolicy decidePolicyForNavigation(
440 WebKit::WebFrame* frame,
441 const WebKit::WebURLRequest& request,
442 WebKit::WebNavigationType type,
443 const WebKit::WebNode&,
444 WebKit::WebNavigationPolicy default_policy,
445 bool is_redirect);
446 virtual bool canHandleRequest(WebKit::WebFrame* frame,
447 const WebKit::WebURLRequest& request);
448 virtual WebKit::WebURLError cannotHandleRequestError(
449 WebKit::WebFrame* frame,
450 const WebKit::WebURLRequest& request);
451 virtual WebKit::WebURLError cancelledError(
452 WebKit::WebFrame* frame,
453 const WebKit::WebURLRequest& request);
454 virtual void unableToImplementPolicyWithError(
455 WebKit::WebFrame* frame,
456 const WebKit::WebURLError& error);
457 virtual void willSendSubmitEvent(WebKit::WebFrame* frame,
458 const WebKit::WebFormElement& form);
459 virtual void willSubmitForm(WebKit::WebFrame* frame,
460 const WebKit::WebFormElement& form);
461 virtual void willPerformClientRedirect(WebKit::WebFrame* frame,
462 const WebKit::WebURL& from,
463 const WebKit::WebURL& to,
464 double interval,
465 double fire_time);
466 virtual void didCancelClientRedirect(WebKit::WebFrame* frame);
467 virtual void didCompleteClientRedirect(WebKit::WebFrame* frame,
468 const WebKit::WebURL& from);
469 virtual void didCreateDataSource(WebKit::WebFrame* frame,
470 WebKit::WebDataSource* datasource);
471 virtual void didStartProvisionalLoad(WebKit::WebFrame* frame);
472 virtual void didReceiveServerRedirectForProvisionalLoad(
473 WebKit::WebFrame* frame);
474 virtual void didFailProvisionalLoad(WebKit::WebFrame* frame,
475 const WebKit::WebURLError& error);
476 virtual void didReceiveDocumentData(WebKit::WebFrame* frame,
477 const char* data, size_t length,
478 bool& prevent_default);
479 virtual void didCommitProvisionalLoad(WebKit::WebFrame* frame,
480 bool is_new_navigation);
481 virtual void didClearWindowObject(WebKit::WebFrame* frame);
482 virtual void didCreateDocumentElement(WebKit::WebFrame* frame);
483 virtual void didReceiveTitle(WebKit::WebFrame* frame,
[email protected]a3bc4d12011-04-20 17:22:21484 const WebKit::WebString& title,
485 WebKit::WebTextDirection direction);
[email protected]42054a252011-05-17 18:02:13486 virtual void didChangeIcon(WebKit::WebFrame*,
487 WebKit::WebIconURL::Type) OVERRIDE;
[email protected]6e24cf12011-03-18 19:57:02488 virtual void didFinishDocumentLoad(WebKit::WebFrame* frame);
489 virtual void didHandleOnloadEvents(WebKit::WebFrame* frame);
490 virtual void didFailLoad(WebKit::WebFrame* frame,
491 const WebKit::WebURLError& error);
492 virtual void didFinishLoad(WebKit::WebFrame* frame);
493 virtual void didNavigateWithinPage(WebKit::WebFrame* frame,
494 bool is_new_navigation);
495 virtual void didUpdateCurrentHistoryItem(WebKit::WebFrame* frame);
496 virtual void assignIdentifierToRequest(WebKit::WebFrame* frame,
497 unsigned identifier,
498 const WebKit::WebURLRequest& request);
499 virtual void willSendRequest(WebKit::WebFrame* frame,
500 unsigned identifier,
501 WebKit::WebURLRequest& request,
502 const WebKit::WebURLResponse& redirect_response);
503 virtual void didReceiveResponse(WebKit::WebFrame* frame,
504 unsigned identifier,
505 const WebKit::WebURLResponse& response);
506 virtual void didFinishResourceLoad(WebKit::WebFrame* frame,
507 unsigned identifier);
508 virtual void didFailResourceLoad(WebKit::WebFrame* frame,
509 unsigned identifier,
510 const WebKit::WebURLError& error);
511 virtual void didLoadResourceFromMemoryCache(
512 WebKit::WebFrame* frame,
513 const WebKit::WebURLRequest& request,
514 const WebKit::WebURLResponse&);
515 virtual void didDisplayInsecureContent(WebKit::WebFrame* frame);
516 virtual void didRunInsecureContent(
517 WebKit::WebFrame* frame,
518 const WebKit::WebSecurityOrigin& origin,
519 const WebKit::WebURL& target);
[email protected]b00ba702011-08-17 01:41:03520 virtual void didAdoptURLLoader(WebKit::WebURLLoader* loader);
[email protected]6e24cf12011-03-18 19:57:02521 virtual void didExhaustMemoryAvailableForScript(WebKit::WebFrame* frame);
[email protected]5bc10932011-09-21 21:03:30522 virtual void didCreateScriptContext(WebKit::WebFrame* frame,
523 v8::Handle<v8::Context>,
524 int world_id);
525 virtual void willReleaseScriptContext(WebKit::WebFrame* frame,
526 v8::Handle<v8::Context>,
527 int world_id);
[email protected]6e24cf12011-03-18 19:57:02528 virtual void didChangeScrollOffset(WebKit::WebFrame* frame);
[email protected]dd6afca2011-08-13 03:44:31529 virtual void numberOfWheelEventHandlersChanged(unsigned num_handlers);
530 virtual void didChangeContentsSize(WebKit::WebFrame* frame,
531 const WebKit::WebSize& size);
[email protected]6e24cf12011-03-18 19:57:02532 virtual void reportFindInPageMatchCount(int request_id,
533 int count,
534 bool final_update);
535 virtual void reportFindInPageSelection(int request_id,
536 int active_match_ordinal,
537 const WebKit::WebRect& sel);
538
539 virtual void openFileSystem(WebKit::WebFrame* frame,
540 WebKit::WebFileSystem::Type type,
541 long long size,
542 bool create,
543 WebKit::WebFileSystemCallbacks* callbacks);
544
[email protected]10e5cf12011-04-13 04:10:40545 virtual void queryStorageUsageAndQuota(
546 WebKit::WebFrame* frame,
547 WebKit::WebStorageQuotaType type,
548 WebKit::WebStorageQuotaCallbacks* callbacks);
549
550 virtual void requestStorageQuota(
551 WebKit::WebFrame* frame,
552 WebKit::WebStorageQuotaType type,
553 unsigned long long requested_size,
554 WebKit::WebStorageQuotaCallbacks* callbacks);
555
[email protected]8b5af492011-11-28 21:50:58556 virtual void registerIntentService(
557 WebKit::WebFrame* frame,
558 const WebKit::WebIntentServiceInfo& service);
559 virtual void dispatchIntent(WebKit::WebFrame* frame,
[email protected]ffc8bed2012-01-21 01:23:15560 const WebKit::WebIntentRequest& intentRequest);
[email protected]8b5af492011-11-28 21:50:58561
[email protected]18d5be92011-07-25 18:00:19562 // WebKit::WebPageSerializerClient implementation ----------------------------
563
564 virtual void didSerializeDataForFrame(
565 const WebKit::WebURL& frame_url,
566 const WebKit::WebCString& data,
567 PageSerializationStatus status) OVERRIDE;
568
[email protected]a2ef54c2011-10-10 16:20:31569 // content::RenderView implementation ----------------------------------------
570
571 virtual bool Send(IPC::Message* message) OVERRIDE;
572 virtual int GetRoutingId() const OVERRIDE;
573 virtual int GetPageId() OVERRIDE;
574 virtual gfx::Size GetSize() OVERRIDE;
575 virtual gfx::NativeViewId GetHostWindow() OVERRIDE;
576 virtual WebPreferences& GetWebkitPreferences() OVERRIDE;
577 virtual WebKit::WebView* GetWebView() OVERRIDE;
578 virtual WebKit::WebNode GetFocusedNode() const OVERRIDE;
579 virtual WebKit::WebNode GetContextMenuNode() const OVERRIDE;
580 virtual bool IsEditableNode(const WebKit::WebNode& node) OVERRIDE;
581 virtual WebKit::WebPlugin* CreatePlugin(
582 WebKit::WebFrame* frame,
583 const webkit::WebPluginInfo& info,
584 const WebKit::WebPluginParams& params) OVERRIDE;
585 virtual void EvaluateScript(const string16& frame_xpath,
586 const string16& jscript,
587 int id,
588 bool notify_result) OVERRIDE;
589 virtual bool ShouldDisplayScrollbars(int width, int height) const OVERRIDE;
590 virtual int GetEnabledBindings() OVERRIDE;
591 virtual void SetEnabledBindings(int enabled_bindings) OVERRIDE;
592 virtual bool GetContentStateImmediately() OVERRIDE;
593 virtual float GetFilteredTimePerFrame() OVERRIDE;
594 virtual void ShowContextMenu(WebKit::WebFrame* frame,
595 const WebKit::WebContextMenuData& data) OVERRIDE;
596 virtual WebKit::WebPageVisibilityState GetVisibilityState() const OVERRIDE;
597 virtual void RunModalAlertDialog(WebKit::WebFrame* frame,
598 const WebKit::WebString& message) OVERRIDE;
599 virtual void LoadURLExternally(
600 WebKit::WebFrame* frame,
601 const WebKit::WebURLRequest& request,
602 WebKit::WebNavigationPolicy policy) OVERRIDE;
603
[email protected]6e24cf12011-03-18 19:57:02604 // webkit_glue::WebPluginPageDelegate implementation -------------------------
605
606 virtual webkit::npapi::WebPluginDelegate* CreatePluginDelegate(
607 const FilePath& file_path,
[email protected]edc64de2011-11-17 20:07:38608 const std::string& mime_type) OVERRIDE;
609 virtual void CreatedPluginWindow(gfx::PluginWindowHandle handle) OVERRIDE;
610 virtual void WillDestroyPluginWindow(gfx::PluginWindowHandle handle) OVERRIDE;
611 virtual void DidMovePlugin(
612 const webkit::npapi::WebPluginGeometry& move) OVERRIDE;
613 virtual void DidStartLoadingForPlugin() OVERRIDE;
614 virtual void DidStopLoadingForPlugin() OVERRIDE;
615 virtual WebKit::WebCookieJar* GetCookieJar() OVERRIDE;
[email protected]6e24cf12011-03-18 19:57:02616
[email protected]a9288f52011-11-17 05:18:16617 // webkit_media::WebMediaPlayerDelegate implementation -----------------------
[email protected]baff4512011-10-19 18:21:07618
[email protected]a9288f52011-11-17 05:18:16619 virtual void DidPlay(webkit_media::WebMediaPlayerImpl* player) OVERRIDE;
620 virtual void DidPause(webkit_media::WebMediaPlayerImpl* player) OVERRIDE;
621 virtual void PlayerGone(webkit_media::WebMediaPlayerImpl* player) OVERRIDE;
[email protected]baff4512011-10-19 18:21:07622
[email protected]6e24cf12011-03-18 19:57:02623 // Please do not add your stuff randomly to the end here. If there is an
624 // appropriate section, add it there. If not, there are some random functions
625 // nearer to the top you can add it to.
[email protected]edc64de2011-11-17 20:07:38626 virtual void DidFlushPaint() OVERRIDE;
[email protected]6e24cf12011-03-18 19:57:02627
[email protected]38b592902011-04-16 02:08:42628 // Cannot use std::set unfortunately since linked_ptr<> does not support
629 // operator<.
630 typedef std::vector<linked_ptr<webkit_glue::ImageResourceFetcher> >
631 ImageResourceFetcherList;
632
[email protected]6e24cf12011-03-18 19:57:02633 protected:
634 // RenderWidget overrides:
[email protected]edc64de2011-11-17 20:07:38635 virtual void Close() OVERRIDE;
[email protected]6e24cf12011-03-18 19:57:02636 virtual void OnResize(const gfx::Size& new_size,
[email protected]ee41e7d22011-10-14 19:34:09637 const gfx::Rect& resizer_rect,
[email protected]edc64de2011-11-17 20:07:38638 bool is_fullscreen) OVERRIDE;
639 virtual void DidInitiatePaint() OVERRIDE;
[email protected]6e24cf12011-03-18 19:57:02640 virtual webkit::ppapi::PluginInstance* GetBitmapForOptimizedPluginPaint(
641 const gfx::Rect& paint_bounds,
642 TransportDIB** dib,
643 gfx::Rect* location,
[email protected]edc64de2011-11-17 20:07:38644 gfx::Rect* clip) OVERRIDE;
645 virtual gfx::Point GetScrollOffset() OVERRIDE;
646 virtual void DidHandleKeyEvent() OVERRIDE;
[email protected]67bfb83f2011-09-22 03:36:37647 virtual bool WillHandleMouseEvent(
648 const WebKit::WebMouseEvent& event) OVERRIDE;
[email protected]edc64de2011-11-17 20:07:38649 virtual void DidHandleMouseEvent(const WebKit::WebMouseEvent& event) OVERRIDE;
650 virtual void DidHandleTouchEvent(const WebKit::WebTouchEvent& event) OVERRIDE;
651 virtual void OnSetFocus(bool enable) OVERRIDE;
652 virtual void OnWasHidden() OVERRIDE;
653 virtual void OnWasRestored(bool needs_repainting) OVERRIDE;
[email protected]65225772011-05-12 21:10:24654 virtual bool SupportsAsynchronousSwapBuffers() OVERRIDE;
[email protected]56ea1a62011-05-30 07:05:57655 virtual void OnImeSetComposition(
656 const string16& text,
657 const std::vector<WebKit::WebCompositionUnderline>& underlines,
658 int selection_start,
659 int selection_end) OVERRIDE;
[email protected]4de6d1692011-10-12 08:45:44660 virtual void OnImeConfirmComposition(
661 const string16& text, const ui::Range& replacement_range) OVERRIDE;
[email protected]ad26ef42011-06-17 07:59:45662 virtual ui::TextInputType GetTextInputType() OVERRIDE;
[email protected]3f783362011-10-21 22:40:50663 virtual void GetSelectionBounds(gfx::Rect* start, gfx::Rect* end) OVERRIDE;
[email protected]ad26ef42011-06-17 07:59:45664 virtual bool CanComposeInline() OVERRIDE;
[email protected]c3d45532011-10-07 19:20:40665 virtual bool WebWidgetHandlesCompositorScheduling() const OVERRIDE;
[email protected]6e24cf12011-03-18 19:57:02666
667 private:
[email protected]6e24cf12011-03-18 19:57:02668 // For unit tests.
669 friend class ExternalPopupMenuTest;
670 friend class PepperDeviceTest;
[email protected]c6d068ff2011-10-14 17:28:23671 friend class content::RenderViewTest;
[email protected]6e24cf12011-03-18 19:57:02672
673 FRIEND_TEST_ALL_PREFIXES(ExternalPopupMenuRemoveTest, RemoveOnChange);
674 FRIEND_TEST_ALL_PREFIXES(ExternalPopupMenuTest, NormalCase);
675 FRIEND_TEST_ALL_PREFIXES(ExternalPopupMenuTest, ShowPopupThenNavigate);
[email protected]068970d2011-10-11 00:05:16676 FRIEND_TEST_ALL_PREFIXES(RenderViewImplTest,
677 DontIgnoreBackAfterNavEntryLimit);
678 FRIEND_TEST_ALL_PREFIXES(RenderViewImplTest, ImeComposition);
679 FRIEND_TEST_ALL_PREFIXES(RenderViewImplTest, InsertCharacters);
680 FRIEND_TEST_ALL_PREFIXES(RenderViewImplTest, JSBlockSentAfterPageLoad);
681 FRIEND_TEST_ALL_PREFIXES(RenderViewImplTest, LastCommittedUpdateState);
682 FRIEND_TEST_ALL_PREFIXES(RenderViewImplTest, OnHandleKeyboardEvent);
683 FRIEND_TEST_ALL_PREFIXES(RenderViewImplTest, OnImeStateChanged);
684 FRIEND_TEST_ALL_PREFIXES(RenderViewImplTest, OnNavStateChanged);
685 FRIEND_TEST_ALL_PREFIXES(RenderViewImplTest, OnSetTextDirection);
686 FRIEND_TEST_ALL_PREFIXES(RenderViewImplTest, OnUpdateWebPreferences);
687 FRIEND_TEST_ALL_PREFIXES(RenderViewImplTest, StaleNavigationsIgnored);
688 FRIEND_TEST_ALL_PREFIXES(RenderViewImplTest, UpdateTargetURLWithInvalidURL);
[email protected]6e24cf12011-03-18 19:57:02689#if defined(OS_MACOSX)
690 FRIEND_TEST_ALL_PREFIXES(RenderViewTest, MacTestCmdUp);
691#endif
[email protected]068970d2011-10-11 00:05:16692 FRIEND_TEST_ALL_PREFIXES(RenderViewImplTest, SetHistoryLengthAndPrune);
[email protected]6e24cf12011-03-18 19:57:02693
[email protected]6e24cf12011-03-18 19:57:02694 typedef std::map<GURL, double> HostZoomLevels;
695
[email protected]6e24cf12011-03-18 19:57:02696 enum ErrorPageType {
697 DNS_ERROR,
698 HTTP_404,
699 CONNECTION_ERROR,
700 };
701
[email protected]310ebd6302011-10-10 19:06:28702 RenderViewImpl(gfx::NativeViewId parent_hwnd,
703 int32 opener_id,
[email protected]daf82f82011-10-31 22:35:31704 const content::RendererPreferences& renderer_prefs,
[email protected]310ebd6302011-10-10 19:06:28705 const WebPreferences& webkit_prefs,
706 SharedRenderViewCounter* counter,
707 int32 routing_id,
[email protected]9f4f3322012-01-18 22:29:56708 int32 surface_id,
[email protected]310ebd6302011-10-10 19:06:28709 int64 session_storage_namespace_id,
[email protected]74ce1ad2011-12-16 21:51:46710 const string16& frame_name,
711 int32 next_page_id);
[email protected]6e24cf12011-03-18 19:57:02712
713 // Do not delete directly. This class is reference counted.
[email protected]310ebd6302011-10-10 19:06:28714 virtual ~RenderViewImpl();
[email protected]6e24cf12011-03-18 19:57:02715
716 void UpdateURL(WebKit::WebFrame* frame);
[email protected]a49e10b2011-08-01 23:57:46717 void UpdateTitle(WebKit::WebFrame* frame, const string16& title,
718 WebKit::WebTextDirection title_direction);
[email protected]6e24cf12011-03-18 19:57:02719 void UpdateSessionHistory(WebKit::WebFrame* frame);
720
721 // Update current main frame's encoding and send it to browser window.
722 // Since we want to let users see the right encoding info from menu
723 // before finishing loading, we call the UpdateEncoding in
724 // a) function:DidCommitLoadForFrame. When this function is called,
725 // that means we have got first data. In here we try to get encoding
726 // of page if it has been specified in http header.
727 // b) function:DidReceiveTitle. When this function is called,
728 // that means we have got specified title. Because in most of webpages,
729 // title tags will follow meta tags. In here we try to get encoding of
730 // page if it has been specified in meta tag.
731 // c) function:DidFinishDocumentLoadForFrame. When this function is
732 // called, that means we have got whole html page. In here we should
733 // finally get right encoding of page.
734 void UpdateEncoding(WebKit::WebFrame* frame,
735 const std::string& encoding_name);
736
[email protected]ae5184d62011-10-06 19:25:58737 void OpenURL(WebKit::WebFrame* frame,
738 const GURL& url,
[email protected]445e1042011-12-03 21:03:15739 const content::Referrer& referrer,
[email protected]6e24cf12011-03-18 19:57:02740 WebKit::WebNavigationPolicy policy);
741
[email protected]269f86d2011-12-07 02:43:47742 bool RunJavaScriptMessage(ui::JavascriptMessageType type,
[email protected]4f5ce842011-05-27 19:34:41743 const string16& message,
744 const string16& default_value,
[email protected]6e24cf12011-03-18 19:57:02745 const GURL& frame_url,
[email protected]4f5ce842011-05-27 19:34:41746 string16* result);
[email protected]6e24cf12011-03-18 19:57:02747
748 // Sends a message and runs a nested message loop.
749 bool SendAndRunNestedMessageLoop(IPC::SyncMessage* message);
750
[email protected]dd6afca2011-08-13 03:44:31751 // Called when the "pinned to left/right edge" state needs to be updated.
752 void UpdateScrollState(WebKit::WebFrame* frame);
753
[email protected]6e24cf12011-03-18 19:57:02754 // IPC message handlers ------------------------------------------------------
755 //
756 // The documentation for these functions should be in
757 // render_messages_internal.h for the message that the function is handling.
758
[email protected]6e24cf12011-03-18 19:57:02759 void OnAllowBindings(int enabled_bindings_flags);
[email protected]6e24cf12011-03-18 19:57:02760 void OnAllowScriptToClose(bool script_can_close);
761 void OnAsyncFileOpened(base::PlatformFileError error_code,
762 IPC::PlatformFileForTransit file_for_transit,
763 int message_id);
[email protected]eb415bf0e2011-04-14 02:45:42764 void OnPpapiBrokerChannelCreated(int request_id,
[email protected]2b657fd2011-04-18 16:00:47765 base::ProcessHandle broker_process_handle,
[email protected]d54305072011-06-22 20:58:43766 const IPC::ChannelHandle& handle);
[email protected]6e24cf12011-03-18 19:57:02767 void OnCancelDownload(int32 download_id);
768 void OnClearFocusedNode();
[email protected]992db4c2011-05-12 15:37:15769 void OnClosePage();
[email protected]6e24cf12011-03-18 19:57:02770#if defined(ENABLE_FLAPPER_HACKS)
771 void OnConnectTcpACK(int request_id,
772 IPC::PlatformFileForTransit socket_for_transit,
[email protected]5a2b68f2011-11-10 00:00:49773 const PP_NetAddress_Private& local_addr,
774 const PP_NetAddress_Private& remote_addr);
[email protected]6e24cf12011-03-18 19:57:02775#endif
776 void OnContextMenuClosed(
777 const webkit_glue::CustomContextMenuContext& custom_context);
778 void OnCopy();
779 void OnCopyImageAt(int x, int y);
780#if defined(OS_MACOSX)
781 void OnCopyToFindPboard();
782#endif
783 void OnCut();
[email protected]318bf5802011-08-08 17:12:41784 void OnCSSInsertRequest(const string16& frame_xpath,
[email protected]01cf589c2011-07-28 18:04:03785 const std::string& css);
[email protected]6e24cf12011-03-18 19:57:02786 void OnCustomContextMenuAction(
787 const webkit_glue::CustomContextMenuContext& custom_context,
788 unsigned action);
789 void OnDelete();
790 void OnDeterminePageLanguage();
791 void OnDisableScrollbarsForSmallWindows(
792 const gfx::Size& disable_scrollbars_size_limit);
793 void OnDisassociateFromPopupCount();
[email protected]6e24cf12011-03-18 19:57:02794 void OnDragSourceEndedOrMoved(const gfx::Point& client_point,
795 const gfx::Point& screen_point,
796 bool ended,
797 WebKit::WebDragOperation drag_operation);
798 void OnDragSourceSystemDragEnded();
799 void OnDragTargetDrop(const gfx::Point& client_pt,
800 const gfx::Point& screen_pt);
801 void OnDragTargetDragEnter(const WebDropData& drop_data,
802 const gfx::Point& client_pt,
803 const gfx::Point& screen_pt,
804 WebKit::WebDragOperationsMask operations_allowed);
805 void OnDragTargetDragLeave();
806 void OnDragTargetDragOver(const gfx::Point& client_pt,
807 const gfx::Point& screen_pt,
808 WebKit::WebDragOperationsMask operations_allowed);
[email protected]2bf834f2011-11-17 20:02:21809 void OnEnablePreferredSizeChangedMode();
[email protected]244ac1892011-12-02 17:04:47810 void OnEnableAutoResize(const gfx::Size& min_size, const gfx::Size& max_size);
[email protected]600ea402011-04-12 00:01:51811 void OnEnumerateDirectoryResponse(int id, const std::vector<FilePath>& paths);
[email protected]6e24cf12011-03-18 19:57:02812 void OnExecuteEditCommand(const std::string& name, const std::string& value);
[email protected]6e24cf12011-03-18 19:57:02813 void OnFileChooserResponse(const std::vector<FilePath>& paths);
814 void OnFind(int request_id, const string16&, const WebKit::WebFindOptions&);
815 void OnFindReplyAck();
[email protected]18d5be92011-07-25 18:00:19816 void OnGetAllSavableResourceLinksForCurrentPage(const GURL& page_url);
817 void OnGetSerializedHtmlDataForCurrentPageWithLocalLinks(
818 const std::vector<GURL>& links,
819 const std::vector<FilePath>& local_paths,
820 const FilePath& local_directory_name);
[email protected]6e24cf12011-03-18 19:57:02821 void OnMediaPlayerActionAt(const gfx::Point& location,
822 const WebKit::WebMediaPlayerAction& action);
[email protected]81375e872012-01-11 21:40:36823 void OnPluginActionAt(const gfx::Point& location,
824 const WebKit::WebPluginAction& action);
[email protected]6e24cf12011-03-18 19:57:02825 void OnMoveOrResizeStarted();
[email protected]f3112a52011-09-30 23:47:49826 CONTENT_EXPORT void OnNavigate(const ViewMsg_Navigate_Params& params);
[email protected]6e24cf12011-03-18 19:57:02827 void OnPaste();
[email protected]44bf7002011-10-16 02:46:15828 void OnPasteAndMatchStyle();
[email protected]6e24cf12011-03-18 19:57:02829#if defined(OS_MACOSX)
830 void OnPluginImeCompositionCompleted(const string16& text, int plugin_id);
831#endif
832 void OnRedo();
833 void OnReloadFrame();
834 void OnReplace(const string16& text);
[email protected]6e24cf12011-03-18 19:57:02835 void OnResetPageEncodingToDefault();
836 void OnScriptEvalRequest(const string16& frame_xpath,
837 const string16& jscript,
838 int id,
839 bool notify_result);
840 void OnSelectAll();
[email protected]4fb60142011-08-09 02:22:08841 void OnSelectRange(const gfx::Point& start, const gfx::Point& end);
[email protected]6e24cf12011-03-18 19:57:02842 void OnSetActive(bool active);
843 void OnSetAltErrorPageURL(const GURL& gurl);
844 void OnSetBackground(const SkBitmap& background);
[email protected]6e24cf12011-03-18 19:57:02845 void OnSetWebUIProperty(const std::string& name, const std::string& value);
846 void OnSetEditCommandsForNextKeyEvent(const EditCommands& edit_commands);
[email protected]f3112a52011-09-30 23:47:49847 CONTENT_EXPORT void OnSetHistoryLengthAndPrune(int history_length,
848 int32 minimum_page_id);
[email protected]6e24cf12011-03-18 19:57:02849 void OnSetInitialFocus(bool reverse);
[email protected]54ca3ca892011-06-07 21:14:54850#if defined(OS_MACOSX)
851 void OnSetInLiveResize(bool in_live_resize);
852#endif
[email protected]333ec8d02011-09-16 18:59:19853 void OnScrollFocusedEditableNodeIntoRect(const gfx::Rect& rect);
[email protected]6e24cf12011-03-18 19:57:02854 void OnSetPageEncoding(const std::string& encoding_name);
[email protected]daf82f82011-10-31 22:35:31855 void OnSetRendererPrefs(const content::RendererPreferences& renderer_prefs);
[email protected]6e24cf12011-03-18 19:57:02856#if defined(OS_MACOSX)
857 void OnSetWindowVisibility(bool visible);
858#endif
859 void OnSetZoomLevel(double zoom_level);
860 void OnSetZoomLevelForLoadingURL(const GURL& url, double zoom_level);
[email protected]8a5e0ca2011-08-25 06:30:47861 void OnExitFullscreen();
[email protected]6e24cf12011-03-18 19:57:02862 void OnShouldClose();
863 void OnStop();
[email protected]815dd9872011-11-23 18:40:30864 void OnStopFinding(content::StopFindAction action);
[email protected]992db4c2011-05-12 15:37:15865 void OnSwapOut(const ViewMsg_SwapOut_Params& params);
[email protected]6e24cf12011-03-18 19:57:02866 void OnThemeChanged();
[email protected]6e24cf12011-03-18 19:57:02867 void OnUndo();
[email protected]6e24cf12011-03-18 19:57:02868 void OnUpdateTargetURLAck();
869 void OnUpdateWebPreferences(const WebPreferences& prefs);
[email protected]08bb1e722011-07-30 19:13:04870
[email protected]6e24cf12011-03-18 19:57:02871#if defined(OS_MACOSX)
872 void OnWindowFrameChanged(const gfx::Rect& window_frame,
873 const gfx::Rect& view_frame);
874 void OnSelectPopupMenuItem(int selected_index);
875#endif
[email protected]54087fe2011-10-28 22:02:48876 void OnZoom(content::PageZoom zoom);
[email protected]47578fa02011-11-02 19:34:41877 void OnZoomFactor(content::PageZoom zoom, int zoom_center_x,
878 int zoom_center_y);
879
[email protected]5a7b15a2011-08-22 22:48:18880 void OnEnableViewSourceMode();
[email protected]6e24cf12011-03-18 19:57:02881
[email protected]64d0e192011-12-09 14:44:20882 void OnJavaBridgeInit();
[email protected]7f3c7af2011-10-20 22:52:51883
[email protected]6e24cf12011-03-18 19:57:02884 // Adding a new message handler? Please add it in alphabetical order above
885 // and put it in the same position in the .cc file.
886
887 // Misc private functions ----------------------------------------------------
[email protected]47578fa02011-11-02 19:34:41888 void ZoomFactorHelper(content::PageZoom zoom, int zoom_center_x,
889 int zoom_center_y, float scaling_increment);
[email protected]6e24cf12011-03-18 19:57:02890
[email protected]6e24cf12011-03-18 19:57:02891 void AltErrorPageFinished(WebKit::WebFrame* frame,
892 const WebKit::WebURLError& original_error,
893 const std::string& html);
894
[email protected]d812fd12011-05-27 23:05:07895 // Check whether the preferred size has changed.
[email protected]6e24cf12011-03-18 19:57:02896 void CheckPreferredSize();
897
[email protected]273558fb2012-01-12 15:03:51898 void EnsureMediaStreamImpl();
899
[email protected]5e56df82011-04-18 17:00:15900 // This callback is triggered when DownloadFavicon completes, either
901 // succesfully or with a failure. See DownloadFavicon for more
902 // details.
903 void DidDownloadFavicon(webkit_glue::ImageResourceFetcher* fetcher,
904 const SkBitmap& image);
[email protected]6e24cf12011-03-18 19:57:02905
[email protected]310ebd6302011-10-10 19:06:28906 // Requests to download a favicon image. When done, the RenderView is notified
907 // by way of DidDownloadFavicon. Returns true if the request was successfully
908 // started, false otherwise. id is used to uniquely identify the request and
909 // passed back to the DidDownloadFavicon method. If the image has multiple
910 // frames, the frame whose size is image_size is returned. If the image
911 // doesn't have a frame at the specified size, the first is returned.
[email protected]5e56df82011-04-18 17:00:15912 bool DownloadFavicon(int id, const GURL& image_url, int image_size);
[email protected]6e24cf12011-03-18 19:57:02913
[email protected]6e24cf12011-03-18 19:57:02914 GURL GetAlternateErrorPageURL(const GURL& failed_url,
915 ErrorPageType error_type);
916
917 // Locates a sub frame with given xpath
[email protected]318bf5802011-08-08 17:12:41918 WebKit::WebFrame* GetChildFrame(const string16& frame_xpath) const;
[email protected]6e24cf12011-03-18 19:57:02919
[email protected]57b9396c2011-10-07 19:11:59920 // Returns the opener url if present, else an empty url.
921 GURL GetOpenerUrl() const;
922
[email protected]6e24cf12011-03-18 19:57:02923 WebUIBindings* GetWebUIBindings();
924
[email protected]6e24cf12011-03-18 19:57:02925 // Should only be called if this object wraps a PluginDocument.
926 WebKit::WebPlugin* GetWebPluginFromPluginDocument();
927
[email protected]d466b8a2011-07-15 21:48:03928 // Returns true if the |params| navigation is to an entry that has been
929 // cropped due to a recent navigation the browser did not know about.
930 bool IsBackForwardToStaleEntry(const ViewMsg_Navigate_Params& params,
931 bool is_reload);
932
[email protected]6e24cf12011-03-18 19:57:02933 // Returns false unless this is a top-level navigation that crosses origins.
934 bool IsNonLocalTopLevelNavigation(const GURL& url,
935 WebKit::WebFrame* frame,
936 WebKit::WebNavigationType type);
937
[email protected]6e24cf12011-03-18 19:57:02938 bool MaybeLoadAlternateErrorPage(WebKit::WebFrame* frame,
939 const WebKit::WebURLError& error,
940 bool replace);
941
[email protected]007733c2011-11-17 00:34:07942 // If we initiated a navigation, this function will populate |document_state|
943 // with the navigation information saved in OnNavigate().
944 void PopulateStateFromPendingNavigationParams(
945 content::DocumentState* document_state);
946
[email protected]6e24cf12011-03-18 19:57:02947 // Starts nav_state_sync_timer_ if it isn't already running.
948 void StartNavStateSyncTimerIfNecessary();
949
950 // Dispatches the current navigation state to the browser. Called on a
951 // periodic timer so we don't send too many messages.
952 void SyncNavigationState();
953
[email protected]b781ff282011-08-20 06:19:36954 // Dispatches the current state of selection on the webpage to the browser if
955 // it has changed.
956 // TODO(varunjain): delete this method once we figure out how to keep
957 // selection handles in sync with the webpage.
958 void SyncSelectionIfRequired();
959
[email protected]e63c4d72011-05-31 22:38:29960#if defined(OS_POSIX) && !defined(OS_MACOSX)
[email protected]6e24cf12011-03-18 19:57:02961 void UpdateFontRenderingFromRendererPrefs();
962#else
963 void UpdateFontRenderingFromRendererPrefs() {}
964#endif
965
966 // Update the target url and tell the browser that the target URL has changed.
967 // If |url| is empty, show |fallback_url|.
968 void UpdateTargetURL(const GURL& url, const GURL& fallback_url);
969
[email protected]6e24cf12011-03-18 19:57:02970 // ---------------------------------------------------------------------------
971 // ADDING NEW FUNCTIONS? Please keep private functions alphabetized and put
972 // it in the same order in the .cc file as it was in the header.
973 // ---------------------------------------------------------------------------
974
975 // Settings ------------------------------------------------------------------
976
977 WebPreferences webkit_preferences_;
[email protected]daf82f82011-10-31 22:35:31978 content::RendererPreferences renderer_preferences_;
[email protected]6e24cf12011-03-18 19:57:02979
[email protected]6e24cf12011-03-18 19:57:02980 HostZoomLevels host_zoom_levels_;
981
982 // Whether content state (such as form state, scroll position and page
983 // contents) should be sent to the browser immediately. This is normally
984 // false, but set to true by some tests.
985 bool send_content_state_immediately_;
986
[email protected]6e24cf12011-03-18 19:57:02987 // Bitwise-ORed set of extra bindings that have been enabled. See
988 // BindingsPolicy for details.
989 int enabled_bindings_;
990
991 // The alternate error page URL, if one exists.
992 GURL alternate_error_page_url_;
993
994 // If true, we send IPC messages when |preferred_size_| changes.
995 bool send_preferred_size_changes_;
996
997 // If non-empty, and |send_preferred_size_changes_| is true, disable drawing
998 // scroll bars on windows smaller than this size. Used for windows that the
999 // browser resizes to the size of the content, such as browser action popups.
1000 // If a render view is set to the minimum size of its content, webkit may add
1001 // scroll bars. This makes sense for fixed sized windows, but it does not
1002 // make sense when the size of the view was chosen to fit the content.
1003 // This setting ensures that no scroll bars are drawn. The size limit exists
1004 // because if the view grows beyond a size known to the browser, scroll bars
1005 // should be drawn.
1006 gfx::Size disable_scrollbars_size_limit_;
1007
[email protected]6e24cf12011-03-18 19:57:021008 // Loading state -------------------------------------------------------------
1009
1010 // True if the top level frame is currently being loaded.
1011 bool is_loading_;
1012
1013 // The gesture that initiated the current navigation.
1014 NavigationGesture navigation_gesture_;
1015
1016 // Used for popups.
1017 bool opened_by_user_gesture_;
1018 GURL creator_url_;
1019
1020 // Whether this RenderView was created by a frame that was suppressing its
1021 // opener. If so, we may want to load pages in a separate process. See
1022 // decidePolicyForNavigation for details.
1023 bool opener_suppressed_;
1024
1025 // If we are handling a top-level client-side redirect, this tracks the URL
1026 // of the page that initiated it. Specifically, when a load is committed this
1027 // is used to determine if that load originated from a client-side redirect.
1028 // It is empty if there is no top-level client-side redirect.
[email protected]445e1042011-12-03 21:03:151029 content::Referrer completed_client_redirect_src_;
[email protected]6e24cf12011-03-18 19:57:021030
[email protected]6e24cf12011-03-18 19:57:021031 // Holds state pertaining to a navigation that we initiated. This is held by
1032 // the WebDataSource::ExtraData attribute. We use pending_navigation_state_
1033 // as a temporary holder for the state until the WebDataSource corresponding
1034 // to the new navigation is created. See DidCreateDataSource.
[email protected]007733c2011-11-17 00:34:071035 scoped_ptr<ViewMsg_Navigate_Params> pending_navigation_params_;
[email protected]6e24cf12011-03-18 19:57:021036
1037 // Timer used to delay the updating of nav state (see SyncNavigationState).
[email protected]310ebd6302011-10-10 19:06:281038 base::OneShotTimer<RenderViewImpl> nav_state_sync_timer_;
[email protected]6e24cf12011-03-18 19:57:021039
[email protected]6e24cf12011-03-18 19:57:021040 // Page IDs ------------------------------------------------------------------
[email protected]a813c8e2011-10-08 01:34:111041 // See documentation in content::RenderView.
[email protected]6e24cf12011-03-18 19:57:021042 int32 page_id_;
1043
1044 // Indicates the ID of the last page that we sent a FrameNavigate to the
1045 // browser for. This is used to determine if the most recent transition
1046 // generated a history entry (less than page_id_), or not (equal to or
1047 // greater than). Note that this will be greater than page_id_ if the user
1048 // goes back.
1049 int32 last_page_id_sent_to_browser_;
1050
[email protected]74ce1ad2011-12-16 21:51:461051 // The next available page ID to use for this RenderView. These IDs are
1052 // specific to a given RenderView and the frames within it.
1053 int32 next_page_id_;
[email protected]6e24cf12011-03-18 19:57:021054
[email protected]d466b8a2011-07-15 21:48:031055 // The offset of the current item in the history list.
1056 int history_list_offset_;
1057
1058 // The RenderView's current impression of the history length. This includes
1059 // any items that have committed in this process, but because of cross-process
1060 // navigations, the history may have some entries that were committed in other
1061 // processes. We won't know about them until the next navigation in this
1062 // process.
1063 int history_list_length_;
1064
1065 // The list of page IDs for each history item this RenderView knows about.
1066 // Some entries may be -1 if they were rendered by other processes or were
1067 // restored from a previous session. This lets us detect attempts to
1068 // navigate to stale entries that have been cropped from our history.
1069 std::vector<int32> history_page_ids_;
1070
[email protected]6e24cf12011-03-18 19:57:021071 // Page info -----------------------------------------------------------------
1072
1073 // The last gotten main frame's encoding.
1074 std::string last_encoding_name_;
1075
[email protected]6e24cf12011-03-18 19:57:021076 // UI state ------------------------------------------------------------------
1077
1078 // The state of our target_url transmissions. When we receive a request to
1079 // send a URL to the browser, we set this to TARGET_INFLIGHT until an ACK
1080 // comes back - if a new request comes in before the ACK, we store the new
1081 // URL in pending_target_url_ and set the status to TARGET_PENDING. If an
1082 // ACK comes back and we are in TARGET_PENDING, we send the stored URL and
1083 // revert to TARGET_INFLIGHT.
1084 //
1085 // We don't need a queue of URLs to send, as only the latest is useful.
1086 enum {
1087 TARGET_NONE,
1088 TARGET_INFLIGHT, // We have a request in-flight, waiting for an ACK
1089 TARGET_PENDING // INFLIGHT + we have a URL waiting to be sent
1090 } target_url_status_;
1091
1092 // The URL we show the user in the status bar. We use this to determine if we
1093 // want to send a new one (we do not need to send duplicates). It will be
1094 // equal to either |mouse_over_url_| or |focus_url_|, depending on which was
1095 // updated last.
1096 GURL target_url_;
1097
1098 // The URL the user's mouse is hovering over.
1099 GURL mouse_over_url_;
1100
1101 // The URL that has keyboard focus.
1102 GURL focus_url_;
1103
1104 // The next target URL we want to send to the browser.
1105 GURL pending_target_url_;
1106
[email protected]6e24cf12011-03-18 19:57:021107 // The text selection the last time DidChangeSelection got called.
[email protected]e99ef6f2011-10-16 01:13:001108 string16 selection_text_;
1109 size_t selection_text_offset_;
1110 ui::Range selection_range_;
[email protected]6e24cf12011-03-18 19:57:021111
1112 // View ----------------------------------------------------------------------
1113
[email protected]6e24cf12011-03-18 19:57:021114 // Cache the preferred size of the page in order to prevent sending the IPC
1115 // when layout() recomputes but doesn't actually change sizes.
1116 gfx::Size preferred_size_;
1117
[email protected]1e0c8e02011-05-25 07:49:371118 // Used to delay determining the preferred size (to avoid intermediate
1119 // states for the sizes).
[email protected]310ebd6302011-10-10 19:06:281120 base::OneShotTimer<RenderViewImpl> check_preferred_size_timer_;
[email protected]1e0c8e02011-05-25 07:49:371121
[email protected]dd6afca2011-08-13 03:44:311122 // These store the "is main frame is scrolled all the way to the left
1123 // or right" state that was last sent to the browser.
1124 bool cached_is_main_frame_pinned_to_left_;
1125 bool cached_is_main_frame_pinned_to_right_;
1126
1127 // These store the "has scrollbars" state last sent to the browser.
1128 bool cached_has_main_frame_horizontal_scrollbar_;
1129 bool cached_has_main_frame_vertical_scrollbar_;
1130
[email protected]6e24cf12011-03-18 19:57:021131#if defined(OS_MACOSX)
1132 // Track the fake plugin window handles allocated on the browser side for
1133 // the accelerated compositor and (currently) accelerated plugins so that
1134 // we can discard them when the view goes away.
1135 std::set<gfx::PluginWindowHandle> fake_plugin_window_handles_;
1136#endif
1137
[email protected]6e24cf12011-03-18 19:57:021138 // Helper objects ------------------------------------------------------------
1139
[email protected]6e24cf12011-03-18 19:57:021140 RendererWebCookieJarImpl cookie_jar_;
1141
1142 // The next group of objects all implement RenderViewObserver, so are deleted
[email protected]310ebd6302011-10-10 19:06:281143 // along with the RenderView automatically. This is why we just store
1144 // weak references.
[email protected]6e24cf12011-03-18 19:57:021145
[email protected]6e24cf12011-03-18 19:57:021146 // Holds a reference to the service which provides desktop notifications.
1147 NotificationProvider* notification_provider_;
1148
1149 // The geolocation dispatcher attached to this view, lazily initialized.
1150 GeolocationDispatcher* geolocation_dispatcher_;
1151
[email protected]0d9989d2011-12-21 20:26:001152 // The intents host attached to this view. Not lazily initialized.
1153 WebIntentsHost* intents_host_;
[email protected]1ef93132011-09-16 18:33:471154
[email protected]6e24cf12011-03-18 19:57:021155 // The speech dispatcher attached to this view, lazily initialized.
1156 SpeechInputDispatcher* speech_input_dispatcher_;
1157
1158 // Device orientation dispatcher attached to this view; lazily initialized.
1159 DeviceOrientationDispatcher* device_orientation_dispatcher_;
1160
[email protected]273558fb2012-01-12 15:03:511161 // MediaStream dispatcher attached to this view; lazily initialized.
1162 MediaStreamDispatcher* media_stream_dispatcher_;
1163
[email protected]ab2c4732011-07-20 19:57:401164 // MediaStreamImpl attached to this view; lazily initialized.
1165 scoped_refptr<MediaStreamImpl> media_stream_impl_;
1166
[email protected]6e24cf12011-03-18 19:57:021167 // Dispatches all P2P socket used by the renderer.
[email protected]b3f8f9722011-08-25 20:56:071168 content::P2PSocketDispatcher* p2p_socket_dispatcher_;
[email protected]6e24cf12011-03-18 19:57:021169
[email protected]c5c1d6d2011-07-28 18:42:411170 DevToolsAgent* devtools_agent_;
1171
[email protected]063afcb2011-09-29 07:54:321172 RendererAccessibility* renderer_accessibility_;
1173
[email protected]7f3c7af2011-10-20 22:52:511174 // Java Bridge dispatcher attached to this view; lazily initialized.
1175 scoped_ptr<JavaBridgeDispatcher> java_bridge_dispatcher_;
1176
[email protected]217690d2012-01-27 07:33:111177 // Mouse Lock dispatcher attached to this view.
1178 MouseLockDispatcher* mouse_lock_dispatcher_;
1179
[email protected]6e24cf12011-03-18 19:57:021180 // Misc ----------------------------------------------------------------------
1181
1182 // The current and pending file chooser completion objects. If the queue is
1183 // nonempty, the first item represents the currently running file chooser
1184 // callback, and the remaining elements are the other file chooser completion
1185 // still waiting to be run (in order).
1186 struct PendingFileChooser;
1187 std::deque< linked_ptr<PendingFileChooser> > file_chooser_completions_;
1188
[email protected]600ea402011-04-12 00:01:511189 // The current directory enumeration callback
1190 std::map<int, WebKit::WebFileChooserCompletion*> enumeration_completions_;
1191 int enumeration_completion_id_;
1192
[email protected]6e24cf12011-03-18 19:57:021193 // The SessionStorage namespace that we're assigned to has an ID, and that ID
1194 // is passed to us upon creation. WebKit asks for this ID upon first use and
1195 // uses it whenever asking the browser process to allocate new storage areas.
1196 int64 session_storage_namespace_id_;
1197
1198 // The total number of unrequested popups that exist and can be followed back
[email protected]310ebd6302011-10-10 19:06:281199 // to a common opener. This count is shared among all RenderViews created with
1200 // createView(). All popups are treated as unrequested until specifically
1201 // instructed otherwise by the Browser process.
[email protected]6e24cf12011-03-18 19:57:021202 scoped_refptr<SharedRenderViewCounter> shared_popup_counter_;
1203
1204 // Whether this is a top level window (instead of a popup). Top level windows
1205 // shouldn't count against their own |shared_popup_counter_|.
1206 bool decrement_shared_popup_at_destruction_;
1207
1208 // If the browser hasn't sent us an ACK for the last FindReply we sent
1209 // to it, then we need to queue up the message (keeping only the most
1210 // recent message if new ones come in).
1211 scoped_ptr<IPC::Message> queued_find_reply_message_;
1212
1213 // Stores edit commands associated to the next key event.
1214 // Shall be cleared as soon as the next key event is processed.
1215 EditCommands edit_commands_;
1216
[email protected]6e24cf12011-03-18 19:57:021217 // Allows Web UI pages (new tab page, etc.) to talk to the browser. The JS
1218 // object is only exposed when Web UI bindings are enabled.
1219 scoped_ptr<WebUIBindings> web_ui_bindings_;
1220
[email protected]6e24cf12011-03-18 19:57:021221 // The external popup for the currently showing select popup.
1222 scoped_ptr<ExternalPopupMenu> external_popup_menu_;
1223
1224 // The node that the context menu was pressed over.
1225 WebKit::WebNode context_menu_node_;
1226
1227 // Reports load progress to the browser.
1228 scoped_ptr<LoadProgressTracker> load_progress_tracker_;
1229
1230 // All the registered observers. We expect this list to be small, so vector
1231 // is fine.
[email protected]3a034ebb2011-10-03 19:19:441232 ObserverList<content::RenderViewObserver> observers_;
[email protected]6e24cf12011-03-18 19:57:021233
[email protected]4fb60142011-08-09 02:22:081234 // Used to inform didChangeSelection() when it is called in the context
1235 // of handling a ViewMsg_SelectRange IPC.
1236 bool handling_select_range_;
1237
[email protected]217690d2012-01-27 07:33:111238 // Wraps the |webwidget_| as a MouseLockDispatcher::LockTarget interface.
1239 scoped_ptr<MouseLockDispatcher::LockTarget> webwidget_mouse_lock_target_;
1240
[email protected]ef5e98e2011-12-06 09:49:181241 // Plugins -------------------------------------------------------------------
1242
1243 // All the currently active plugin delegates for this RenderView; kept so
1244 // that we can enumerate them to send updates about things like window
1245 // location or tab focus and visibily. These are non-owning references.
1246 std::set<WebPluginDelegateProxy*> plugin_delegates_;
1247
1248#if defined(OS_WIN)
1249 // The ID of the focused NPAPI plug-in.
1250 int focused_plugin_id_;
1251#endif
1252
1253 // NOTE: pepper_delegate_ should be last member because its constructor calls
1254 // AddObservers method of RenderViewImpl from c-tor.
1255 PepperPluginDelegateImpl pepper_delegate_;
1256
[email protected]6e24cf12011-03-18 19:57:021257 // ---------------------------------------------------------------------------
1258 // ADDING NEW DATA? Please see if it fits appropriately in one of the above
1259 // sections rather than throwing it randomly at the end. If you're adding a
1260 // bunch of stuff, you should probably create a helper class and put your
[email protected]310ebd6302011-10-10 19:06:281261 // data and methods on that to avoid bloating RenderView more. You can
1262 // use the Observer interface to filter IPC messages and receive frame change
[email protected]6e24cf12011-03-18 19:57:021263 // notifications.
1264 // ---------------------------------------------------------------------------
1265
[email protected]310ebd6302011-10-10 19:06:281266 DISALLOW_COPY_AND_ASSIGN(RenderViewImpl);
[email protected]6e24cf12011-03-18 19:57:021267};
1268
[email protected]310ebd6302011-10-10 19:06:281269#endif // CONTENT_RENDERER_RENDER_VIEW_IMPL_H_