blob: 1d9963ae0533516474eddcedf90aa98fe5f37653 [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]766a7082012-02-03 23:39:1563class DomAutomationController;
[email protected]55722152011-03-22 01:33:5364class ExternalPopupMenu;
[email protected]6e24cf12011-03-18 19:57:0265class GeolocationDispatcher;
[email protected]6e24cf12011-03-18 19:57:0266class GURL;
[email protected]7f3c7af2011-10-20 22:52:5167class JavaBridgeDispatcher;
[email protected]6e24cf12011-03-18 19:57:0268class LoadProgressTracker;
[email protected]273558fb2012-01-12 15:03:5169class MediaStreamDispatcher;
[email protected]ab2c4732011-07-20 19:57:4070class MediaStreamImpl;
[email protected]217690d2012-01-27 07:33:1171class MouseLockDispatcher;
[email protected]6e24cf12011-03-18 19:57:0272class NotificationProvider;
[email protected]6e24cf12011-03-18 19:57:0273class PepperDeviceTest;
[email protected]83f93d32011-11-11 00:43:3074struct PP_NetAddress_Private;
[email protected]ea192e82011-04-11 19:16:0275class RenderWidgetFullscreenPepper;
[email protected]063afcb2011-09-29 07:54:3276class RendererAccessibility;
[email protected]6e24cf12011-03-18 19:57:0277class SkBitmap;
78class SpeechInputDispatcher;
[email protected]6e24cf12011-03-18 19:57:0279struct ViewMsg_Navigate_Params;
80struct ViewMsg_StopFinding_Params;
[email protected]83f93d32011-11-11 00:43:3081struct ViewMsg_SwapOut_Params;
[email protected]6e24cf12011-03-18 19:57:0282struct WebDropData;
[email protected]0d9989d2011-12-21 20:26:0083class WebIntentsHost;
[email protected]83f93d32011-11-11 00:43:3084class WebPluginDelegateProxy;
85class WebUIBindings;
[email protected]b3f8f9722011-08-25 20:56:0786
87namespace content {
[email protected]007733c2011-11-17 00:34:0788class DocumentState;
[email protected]b3f8f9722011-08-25 20:56:0789class P2PSocketDispatcher;
[email protected]3a034ebb2011-10-03 19:19:4490class RenderViewObserver;
[email protected]007733c2011-11-17 00:34:0791class RenderViewTest;
[email protected]8caadeb2011-11-22 02:45:2392struct FileChooserParams;
[email protected]b3f8f9722011-08-25 20:56:0793} // namespace content
[email protected]6e24cf12011-03-18 19:57:0294
[email protected]6e24cf12011-03-18 19:57:0295namespace gfx {
96class Point;
97class Rect;
[email protected]b3f8f9722011-08-25 20:56:0798} // namespace gfx
[email protected]6e24cf12011-03-18 19:57:0299
100namespace webkit {
101
[email protected]6e24cf12011-03-18 19:57:02102namespace ppapi {
[email protected]6e24cf12011-03-18 19:57:02103class PluginInstance;
[email protected]6e24cf12011-03-18 19:57:02104} // namespace ppapi
105
106} // namespace webkit
107
108namespace webkit_glue {
109struct CustomContextMenuContext;
110class ImageResourceFetcher;
[email protected]6e24cf12011-03-18 19:57:02111class ResourceFetcher;
112}
113
114namespace WebKit {
[email protected]6e24cf12011-03-18 19:57:02115class WebApplicationCacheHost;
116class WebApplicationCacheHostClient;
117class WebDataSource;
[email protected]6e24cf12011-03-18 19:57:02118class WebDragData;
[email protected]6e24cf12011-03-18 19:57:02119class WebGeolocationClient;
[email protected]42054a252011-05-17 18:02:13120class WebIconURL;
[email protected]6e24cf12011-03-18 19:57:02121class WebImage;
[email protected]6e24cf12011-03-18 19:57:02122class WebMediaPlayer;
123class WebMediaPlayerClient;
124class WebMouseEvent;
[email protected]273558fb2012-01-12 15:03:51125class WebPeerConnectionHandler;
126class WebPeerConnectionHandlerClient;
[email protected]6e24cf12011-03-18 19:57:02127class WebSpeechInputController;
128class WebSpeechInputListener;
129class WebStorageNamespace;
[email protected]2d0f2e92011-10-03 09:02:24130class WebTouchEvent;
[email protected]b00ba702011-08-17 01:41:03131class WebURLLoader;
[email protected]6e24cf12011-03-18 19:57:02132class WebURLRequest;
[email protected]273558fb2012-01-12 15:03:51133class WebUserMediaClient;
[email protected]6e24cf12011-03-18 19:57:02134struct WebFileChooserParams;
135struct WebFindOptions;
136struct WebMediaPlayerAction;
[email protected]81375e872012-01-11 21:40:36137struct WebPluginAction;
[email protected]6e24cf12011-03-18 19:57:02138struct WebPoint;
139struct WebWindowFeatures;
140}
141
142// We need to prevent a page from trying to create infinite popups. It is not
143// as simple as keeping a count of the number of immediate children
144// popups. Having an html file that window.open()s itself would create
145// an unlimited chain of RenderViews who only have one RenderView child.
146//
147// Therefore, each new top level RenderView creates a new counter and shares it
[email protected]310ebd6302011-10-10 19:06:28148// with all its children and grandchildren popup RenderViewImpls created with
[email protected]6e24cf12011-03-18 19:57:02149// createView() to have a sort of global limit for the page so no more than
150// kMaximumNumberOfPopups popups are created.
151//
152// This is a RefCounted holder of an int because I can't say
153// scoped_refptr<int>.
154typedef base::RefCountedData<int> SharedRenderViewCounter;
155
156//
157// RenderView is an object that manages a WebView object, and provides a
158// communication interface with an embedding application process
159//
[email protected]310ebd6302011-10-10 19:06:28160class RenderViewImpl : public RenderWidget,
161 public WebKit::WebViewClient,
162 public WebKit::WebFrameClient,
163 public WebKit::WebPageSerializerClient,
164 public content::RenderView,
165 public webkit::npapi::WebPluginPageDelegate,
[email protected]a9288f52011-11-17 05:18:16166 public webkit_media::WebMediaPlayerDelegate,
[email protected]310ebd6302011-10-10 19:06:28167 public base::SupportsWeakPtr<RenderViewImpl> {
[email protected]6e24cf12011-03-18 19:57:02168 public:
169 // Creates a new RenderView. The parent_hwnd specifies a HWND to use as the
[email protected]5f9de5882011-09-30 23:36:28170 // parent of the WebView HWND that will be created. If this is a blocked
[email protected]6e24cf12011-03-18 19:57:02171 // popup or as a new tab, opener_id is the routing ID of the RenderView
172 // responsible for creating this RenderView (corresponding to parent_hwnd).
173 // |counter| is either a currently initialized counter, or NULL (in which case
174 // we treat this RenderView as a top level window).
[email protected]310ebd6302011-10-10 19:06:28175 CONTENT_EXPORT static RenderViewImpl* Create(
[email protected]6e24cf12011-03-18 19:57:02176 gfx::NativeViewId parent_hwnd,
177 int32 opener_id,
[email protected]daf82f82011-10-31 22:35:31178 const content::RendererPreferences& renderer_prefs,
[email protected]6e24cf12011-03-18 19:57:02179 const WebPreferences& webkit_prefs,
180 SharedRenderViewCounter* counter,
181 int32 routing_id,
[email protected]9f4f3322012-01-18 22:29:56182 int32 surface_id,
[email protected]6e24cf12011-03-18 19:57:02183 int64 session_storage_namespace_id,
[email protected]74ce1ad2011-12-16 21:51:46184 const string16& frame_name,
185 int32 next_page_id);
[email protected]6e24cf12011-03-18 19:57:02186
[email protected]310ebd6302011-10-10 19:06:28187 // Returns the RenderViewImpl containing the given WebView.
188 CONTENT_EXPORT static RenderViewImpl* FromWebView(WebKit::WebView* webview);
[email protected]6e24cf12011-03-18 19:57:02189
[email protected]6e24cf12011-03-18 19:57:02190 // May return NULL when the view is closing.
[email protected]8d128d62011-09-13 22:11:57191 CONTENT_EXPORT WebKit::WebView* webview() const;
[email protected]6e24cf12011-03-18 19:57:02192
[email protected]65225772011-05-12 21:10:24193 // Called by a GraphicsContext associated with this view when swapbuffers
[email protected]37a6f302011-07-11 23:43:08194 // is posted, completes or is aborted.
195 void OnViewContextSwapBuffersPosted();
[email protected]65225772011-05-12 21:10:24196 void OnViewContextSwapBuffersComplete();
197 void OnViewContextSwapBuffersAborted();
198
[email protected]d466b8a2011-07-15 21:48:03199 int history_list_offset() const { return history_list_offset_; }
[email protected]6e24cf12011-03-18 19:57:02200
[email protected]6e24cf12011-03-18 19:57:02201 const WebPreferences& webkit_preferences() const {
202 return webkit_preferences_;
203 }
204
205 void set_send_content_state_immediately(bool value) {
206 send_content_state_immediately_ = value;
207 }
208
[email protected]273558fb2012-01-12 15:03:51209 MediaStreamDispatcher* media_stream_dispatcher() {
210 return media_stream_dispatcher_;
211 }
212
[email protected]6e24cf12011-03-18 19:57:02213 // Current P2PSocketDispatcher. Set to NULL if P2P API is disabled.
[email protected]b3f8f9722011-08-25 20:56:07214 content::P2PSocketDispatcher* p2p_socket_dispatcher() {
[email protected]6e24cf12011-03-18 19:57:02215 return p2p_socket_dispatcher_;
216 }
217
[email protected]217690d2012-01-27 07:33:11218 MouseLockDispatcher* mouse_lock_dispatcher() {
219 return mouse_lock_dispatcher_;
220 }
221
[email protected]273558fb2012-01-12 15:03:51222 WebKit::WebPeerConnectionHandler* CreatePeerConnectionHandler(
223 WebKit::WebPeerConnectionHandlerClient* client);
224
[email protected]6e24cf12011-03-18 19:57:02225 // Functions to add and remove observers for this object.
[email protected]3a034ebb2011-10-03 19:19:44226 void AddObserver(content::RenderViewObserver* observer);
227 void RemoveObserver(content::RenderViewObserver* observer);
[email protected]6e24cf12011-03-18 19:57:02228
[email protected]6e24cf12011-03-18 19:57:02229 // Adds the given file chooser request to the file_chooser_completion_ queue
230 // (see that var for more) and requests the chooser be displayed if there are
231 // no other waiting items in the queue.
232 //
233 // Returns true if the chooser was successfully scheduled. False means we
234 // didn't schedule anything.
[email protected]8caadeb2011-11-22 02:45:23235 bool ScheduleFileChooser(const content::FileChooserParams& params,
[email protected]6e24cf12011-03-18 19:57:02236 WebKit::WebFileChooserCompletion* completion);
237
[email protected]6e24cf12011-03-18 19:57:02238 // Sets whether the renderer should report load progress to the browser.
239 void SetReportLoadProgressEnabled(bool enabled);
240
[email protected]a2ef54c2011-10-10 16:20:31241 void LoadNavigationErrorPage(
[email protected]8d128d62011-09-13 22:11:57242 WebKit::WebFrame* frame,
243 const WebKit::WebURLRequest& failed_request,
244 const WebKit::WebURLError& error,
245 const std::string& html,
246 bool replace);
[email protected]9966325b2011-04-18 05:00:10247
[email protected]6e24cf12011-03-18 19:57:02248 // Plugin-related functions --------------------------------------------------
249 // (See also WebPluginPageDelegate implementation.)
250
251 // Notification that the given plugin has crashed.
252 void PluginCrashed(const FilePath& plugin_path);
253
[email protected]6e24cf12011-03-18 19:57:02254 // Creates a fullscreen container for a pepper plugin instance.
[email protected]ea192e82011-04-11 19:16:02255 RenderWidgetFullscreenPepper* CreatePepperFullscreenContainer(
[email protected]6e24cf12011-03-18 19:57:02256 webkit::ppapi::PluginInstance* plugin);
257
[email protected]56ea1a62011-05-30 07:05:57258 // Informs the render view that a PPAPI plugin has gained or lost focus.
259 void PpapiPluginFocusChanged();
260
[email protected]73bf95812011-10-12 11:38:32261 // Informs the render view that a PPAPI plugin has changed text input status.
262 void PpapiPluginTextInputTypeChanged();
[email protected]3f783362011-10-21 22:40:50263 void PpapiPluginCaretPositionChanged();
[email protected]73bf95812011-10-12 11:38:32264
265 // Cancels current composition.
266 void PpapiPluginCancelComposition();
267
[email protected]b25b3ee2012-01-13 05:19:54268 // Retrieves the current caret position if a PPAPI plugin has focus.
269 bool GetPpapiPluginCaretBounds(gfx::Rect* rect);
270
[email protected]e6ae0f6c2011-10-04 10:39:23271#if defined(OS_MACOSX) || defined(OS_WIN)
[email protected]6e24cf12011-03-18 19:57:02272 // Informs the render view that the given plugin has gained or lost focus.
273 void PluginFocusChanged(bool focused, int plugin_id);
[email protected]e6ae0f6c2011-10-04 10:39:23274#endif
[email protected]6e24cf12011-03-18 19:57:02275
[email protected]e6ae0f6c2011-10-04 10:39:23276#if defined(OS_MACOSX)
[email protected]6e24cf12011-03-18 19:57:02277 // Starts plugin IME.
278 void StartPluginIme();
279
280 // Helper routines for accelerated plugin support. Used by the
281 // WebPluginDelegateProxy, which has a pointer to the RenderView.
282 gfx::PluginWindowHandle AllocateFakePluginWindowHandle(bool opaque,
283 bool root);
284 void DestroyFakePluginWindowHandle(gfx::PluginWindowHandle window);
285 void AcceleratedSurfaceSetIOSurface(gfx::PluginWindowHandle window,
286 int32 width,
287 int32 height,
288 uint64 io_surface_identifier);
289 TransportDIB::Handle AcceleratedSurfaceAllocTransportDIB(size_t size);
290 void AcceleratedSurfaceFreeTransportDIB(TransportDIB::Id dib_id);
291 void AcceleratedSurfaceSetTransportDIB(gfx::PluginWindowHandle window,
292 int32 width,
293 int32 height,
294 TransportDIB::Handle transport_dib);
295 void AcceleratedSurfaceBuffersSwapped(gfx::PluginWindowHandle window,
296 uint64 surface_id);
297#endif
298
299 void RegisterPluginDelegate(WebPluginDelegateProxy* delegate);
300 void UnregisterPluginDelegate(WebPluginDelegateProxy* delegate);
301
[email protected]4a7d6392011-09-19 20:55:08302 // Helper function to retrieve information about a plugin for a URL and mime
303 // type. Returns false if no plugin was found.
304 // |actual_mime_type| is the actual mime type supported by the
305 // plugin found that match the URL given (one for each item in
306 // |info|).
[email protected]84c13c032011-09-23 00:12:22307 CONTENT_EXPORT bool GetPluginInfo(const GURL& url,
308 const GURL& page_url,
309 const std::string& mime_type,
310 webkit::WebPluginInfo* plugin_info,
311 std::string* actual_mime_type);
[email protected]4a7d6392011-09-19 20:55:08312
[email protected]6e24cf12011-03-18 19:57:02313 // IPC::Channel::Listener implementation -------------------------------------
314
[email protected]edc64de2011-11-17 20:07:38315 virtual bool OnMessageReceived(const IPC::Message& msg) OVERRIDE;
[email protected]6e24cf12011-03-18 19:57:02316
317 // WebKit::WebWidgetClient implementation ------------------------------------
318
319 // Most methods are handled by RenderWidget.
320 virtual void didFocus();
321 virtual void didBlur();
322 virtual void show(WebKit::WebNavigationPolicy policy);
323 virtual void runModal();
[email protected]2b624c562011-10-27 22:58:26324 virtual bool enterFullScreen();
325 virtual void exitFullScreen();
[email protected]217690d2012-01-27 07:33:11326 virtual bool requestPointerLock();
327 virtual void requestPointerUnlock();
328 virtual bool isPointerLocked();
[email protected]6e24cf12011-03-18 19:57:02329
330 // WebKit::WebViewClient implementation --------------------------------------
331
332 virtual WebKit::WebView* createView(
333 WebKit::WebFrame* creator,
334 const WebKit::WebURLRequest& request,
335 const WebKit::WebWindowFeatures& features,
336 const WebKit::WebString& frame_name);
337 virtual WebKit::WebWidget* createPopupMenu(WebKit::WebPopupType popup_type);
338 virtual WebKit::WebWidget* createPopupMenu(
339 const WebKit::WebPopupMenuInfo& info);
340 virtual WebKit::WebExternalPopupMenu* createExternalPopupMenu(
341 const WebKit::WebPopupMenuInfo& popup_menu_info,
342 WebKit::WebExternalPopupMenuClient* popup_menu_client);
343 virtual WebKit::WebStorageNamespace* createSessionStorageNamespace(
344 unsigned quota);
[email protected]7e8b4d12012-01-20 23:39:51345 virtual WebKit::WebGraphicsContext3D* createGraphicsContext3D(
[email protected]01e69032012-01-31 05:39:06346 const WebKit::WebGraphicsContext3D::Attributes& attributes,
[email protected]7e8b4d12012-01-20 23:39:51347 bool direct);
[email protected]6e24cf12011-03-18 19:57:02348 virtual void didAddMessageToConsole(
349 const WebKit::WebConsoleMessage& message,
350 const WebKit::WebString& source_name,
351 unsigned source_line);
352 virtual void printPage(WebKit::WebFrame* frame);
353 virtual WebKit::WebNotificationPresenter* notificationPresenter();
[email protected]8a58c1c2011-04-19 18:40:12354 virtual bool enumerateChosenDirectory(
355 const WebKit::WebString& path,
356 WebKit::WebFileChooserCompletion* chooser_completion);
[email protected]6e24cf12011-03-18 19:57:02357 virtual void didStartLoading();
358 virtual void didStopLoading();
359 virtual void didChangeLoadProgress(WebKit::WebFrame* frame,
360 double load_progress);
361 virtual bool isSmartInsertDeleteEnabled();
362 virtual bool isSelectTrailingWhitespaceEnabled();
363 virtual void didChangeSelection(bool is_selection_empty);
364 virtual void didExecuteCommand(const WebKit::WebString& command_name);
365 virtual bool handleCurrentKeyboardEvent();
[email protected]6e24cf12011-03-18 19:57:02366 virtual bool runFileChooser(
367 const WebKit::WebFileChooserParams& params,
368 WebKit::WebFileChooserCompletion* chooser_completion);
369 virtual void runModalAlertDialog(WebKit::WebFrame* frame,
370 const WebKit::WebString& message);
371 virtual bool runModalConfirmDialog(WebKit::WebFrame* frame,
372 const WebKit::WebString& message);
373 virtual bool runModalPromptDialog(WebKit::WebFrame* frame,
374 const WebKit::WebString& message,
375 const WebKit::WebString& default_value,
376 WebKit::WebString* actual_value);
377 virtual bool runModalBeforeUnloadDialog(WebKit::WebFrame* frame,
378 const WebKit::WebString& message);
379 virtual void showContextMenu(WebKit::WebFrame* frame,
380 const WebKit::WebContextMenuData& data);
[email protected]2b624c562011-10-27 22:58:26381 virtual void enterFullscreen();
382 virtual void exitFullscreen();
[email protected]6e24cf12011-03-18 19:57:02383 virtual void setStatusText(const WebKit::WebString& text);
384 virtual void setMouseOverURL(const WebKit::WebURL& url);
385 virtual void setKeyboardFocusURL(const WebKit::WebURL& url);
[email protected]6e24cf12011-03-18 19:57:02386 virtual void startDragging(const WebKit::WebDragData& data,
387 WebKit::WebDragOperationsMask mask,
388 const WebKit::WebImage& image,
389 const WebKit::WebPoint& imageOffset);
390 virtual bool acceptsLoadDrops();
391 virtual void focusNext();
392 virtual void focusPrevious();
393 virtual void focusedNodeChanged(const WebKit::WebNode& node);
[email protected]169d4282011-11-30 19:33:59394 virtual void didUpdateLayout();
[email protected]6e24cf12011-03-18 19:57:02395 virtual void navigateBackForwardSoon(int offset);
396 virtual int historyBackListCount();
397 virtual int historyForwardListCount();
398 virtual void postAccessibilityNotification(
399 const WebKit::WebAccessibilityObject& obj,
400 WebKit::WebAccessibilityNotification notification);
401 virtual void didUpdateInspectorSetting(const WebKit::WebString& key,
402 const WebKit::WebString& value);
403 virtual WebKit::WebGeolocationClient* geolocationClient();
404 virtual WebKit::WebSpeechInputController* speechInputController(
405 WebKit::WebSpeechInputListener* listener);
406 virtual WebKit::WebDeviceOrientationClient* deviceOrientationClient();
407 virtual void zoomLimitsChanged(double minimum_level, double maximum_level);
408 virtual void zoomLevelChanged();
409 virtual void registerProtocolHandler(const WebKit::WebString& scheme,
410 const WebKit::WebString& base_url,
411 const WebKit::WebString& url,
412 const WebKit::WebString& title);
[email protected]94dec932011-05-26 20:04:21413 virtual WebKit::WebPageVisibilityState visibilityState() const;
[email protected]273558fb2012-01-12 15:03:51414 virtual WebKit::WebUserMediaClient* userMediaClient();
[email protected]6e24cf12011-03-18 19:57:02415
416 // WebKit::WebFrameClient implementation -------------------------------------
417
418 virtual WebKit::WebPlugin* createPlugin(
419 WebKit::WebFrame* frame,
420 const WebKit::WebPluginParams& params);
[email protected]6e24cf12011-03-18 19:57:02421 virtual WebKit::WebSharedWorker* createSharedWorker(
422 WebKit::WebFrame* frame, const WebKit::WebURL& url,
423 const WebKit::WebString& name, unsigned long long documentId);
424 virtual WebKit::WebMediaPlayer* createMediaPlayer(
425 WebKit::WebFrame* frame,
426 WebKit::WebMediaPlayerClient* client);
427 virtual WebKit::WebApplicationCacheHost* createApplicationCacheHost(
428 WebKit::WebFrame* frame,
429 WebKit::WebApplicationCacheHostClient* client);
430 virtual WebKit::WebCookieJar* cookieJar(WebKit::WebFrame* frame);
431 virtual void frameDetached(WebKit::WebFrame* frame);
432 virtual void willClose(WebKit::WebFrame* frame);
[email protected]6e24cf12011-03-18 19:57:02433 virtual void loadURLExternally(WebKit::WebFrame* frame,
434 const WebKit::WebURLRequest& request,
435 WebKit::WebNavigationPolicy policy);
[email protected]0622875ab2011-07-27 12:10:34436 virtual void loadURLExternally(WebKit::WebFrame* frame,
437 const WebKit::WebURLRequest& request,
438 WebKit::WebNavigationPolicy policy,
439 const WebKit::WebString& suggested_name);
[email protected]6e24cf12011-03-18 19:57:02440 virtual WebKit::WebNavigationPolicy decidePolicyForNavigation(
441 WebKit::WebFrame* frame,
442 const WebKit::WebURLRequest& request,
443 WebKit::WebNavigationType type,
444 const WebKit::WebNode&,
445 WebKit::WebNavigationPolicy default_policy,
446 bool is_redirect);
447 virtual bool canHandleRequest(WebKit::WebFrame* frame,
448 const WebKit::WebURLRequest& request);
449 virtual WebKit::WebURLError cannotHandleRequestError(
450 WebKit::WebFrame* frame,
451 const WebKit::WebURLRequest& request);
452 virtual WebKit::WebURLError cancelledError(
453 WebKit::WebFrame* frame,
454 const WebKit::WebURLRequest& request);
455 virtual void unableToImplementPolicyWithError(
456 WebKit::WebFrame* frame,
457 const WebKit::WebURLError& error);
458 virtual void willSendSubmitEvent(WebKit::WebFrame* frame,
459 const WebKit::WebFormElement& form);
460 virtual void willSubmitForm(WebKit::WebFrame* frame,
461 const WebKit::WebFormElement& form);
462 virtual void willPerformClientRedirect(WebKit::WebFrame* frame,
463 const WebKit::WebURL& from,
464 const WebKit::WebURL& to,
465 double interval,
466 double fire_time);
467 virtual void didCancelClientRedirect(WebKit::WebFrame* frame);
468 virtual void didCompleteClientRedirect(WebKit::WebFrame* frame,
469 const WebKit::WebURL& from);
470 virtual void didCreateDataSource(WebKit::WebFrame* frame,
471 WebKit::WebDataSource* datasource);
472 virtual void didStartProvisionalLoad(WebKit::WebFrame* frame);
473 virtual void didReceiveServerRedirectForProvisionalLoad(
474 WebKit::WebFrame* frame);
475 virtual void didFailProvisionalLoad(WebKit::WebFrame* frame,
476 const WebKit::WebURLError& error);
477 virtual void didReceiveDocumentData(WebKit::WebFrame* frame,
478 const char* data, size_t length,
479 bool& prevent_default);
480 virtual void didCommitProvisionalLoad(WebKit::WebFrame* frame,
481 bool is_new_navigation);
482 virtual void didClearWindowObject(WebKit::WebFrame* frame);
483 virtual void didCreateDocumentElement(WebKit::WebFrame* frame);
484 virtual void didReceiveTitle(WebKit::WebFrame* frame,
[email protected]a3bc4d12011-04-20 17:22:21485 const WebKit::WebString& title,
486 WebKit::WebTextDirection direction);
[email protected]42054a252011-05-17 18:02:13487 virtual void didChangeIcon(WebKit::WebFrame*,
488 WebKit::WebIconURL::Type) OVERRIDE;
[email protected]6e24cf12011-03-18 19:57:02489 virtual void didFinishDocumentLoad(WebKit::WebFrame* frame);
490 virtual void didHandleOnloadEvents(WebKit::WebFrame* frame);
491 virtual void didFailLoad(WebKit::WebFrame* frame,
492 const WebKit::WebURLError& error);
493 virtual void didFinishLoad(WebKit::WebFrame* frame);
494 virtual void didNavigateWithinPage(WebKit::WebFrame* frame,
495 bool is_new_navigation);
496 virtual void didUpdateCurrentHistoryItem(WebKit::WebFrame* frame);
497 virtual void assignIdentifierToRequest(WebKit::WebFrame* frame,
498 unsigned identifier,
499 const WebKit::WebURLRequest& request);
500 virtual void willSendRequest(WebKit::WebFrame* frame,
501 unsigned identifier,
502 WebKit::WebURLRequest& request,
503 const WebKit::WebURLResponse& redirect_response);
504 virtual void didReceiveResponse(WebKit::WebFrame* frame,
505 unsigned identifier,
506 const WebKit::WebURLResponse& response);
507 virtual void didFinishResourceLoad(WebKit::WebFrame* frame,
508 unsigned identifier);
509 virtual void didFailResourceLoad(WebKit::WebFrame* frame,
510 unsigned identifier,
511 const WebKit::WebURLError& error);
512 virtual void didLoadResourceFromMemoryCache(
513 WebKit::WebFrame* frame,
514 const WebKit::WebURLRequest& request,
515 const WebKit::WebURLResponse&);
516 virtual void didDisplayInsecureContent(WebKit::WebFrame* frame);
517 virtual void didRunInsecureContent(
518 WebKit::WebFrame* frame,
519 const WebKit::WebSecurityOrigin& origin,
520 const WebKit::WebURL& target);
[email protected]b00ba702011-08-17 01:41:03521 virtual void didAdoptURLLoader(WebKit::WebURLLoader* loader);
[email protected]6e24cf12011-03-18 19:57:02522 virtual void didExhaustMemoryAvailableForScript(WebKit::WebFrame* frame);
[email protected]5bc10932011-09-21 21:03:30523 virtual void didCreateScriptContext(WebKit::WebFrame* frame,
524 v8::Handle<v8::Context>,
525 int world_id);
526 virtual void willReleaseScriptContext(WebKit::WebFrame* frame,
527 v8::Handle<v8::Context>,
528 int world_id);
[email protected]6e24cf12011-03-18 19:57:02529 virtual void didChangeScrollOffset(WebKit::WebFrame* frame);
[email protected]dd6afca2011-08-13 03:44:31530 virtual void numberOfWheelEventHandlersChanged(unsigned num_handlers);
531 virtual void didChangeContentsSize(WebKit::WebFrame* frame,
532 const WebKit::WebSize& size);
[email protected]6e24cf12011-03-18 19:57:02533 virtual void reportFindInPageMatchCount(int request_id,
534 int count,
535 bool final_update);
536 virtual void reportFindInPageSelection(int request_id,
537 int active_match_ordinal,
538 const WebKit::WebRect& sel);
539
540 virtual void openFileSystem(WebKit::WebFrame* frame,
541 WebKit::WebFileSystem::Type type,
542 long long size,
543 bool create,
544 WebKit::WebFileSystemCallbacks* callbacks);
545
[email protected]10e5cf12011-04-13 04:10:40546 virtual void queryStorageUsageAndQuota(
547 WebKit::WebFrame* frame,
548 WebKit::WebStorageQuotaType type,
549 WebKit::WebStorageQuotaCallbacks* callbacks);
550
551 virtual void requestStorageQuota(
552 WebKit::WebFrame* frame,
553 WebKit::WebStorageQuotaType type,
554 unsigned long long requested_size,
555 WebKit::WebStorageQuotaCallbacks* callbacks);
556
[email protected]8b5af492011-11-28 21:50:58557 virtual void registerIntentService(
558 WebKit::WebFrame* frame,
559 const WebKit::WebIntentServiceInfo& service);
560 virtual void dispatchIntent(WebKit::WebFrame* frame,
[email protected]ffc8bed2012-01-21 01:23:15561 const WebKit::WebIntentRequest& intentRequest);
[email protected]8b5af492011-11-28 21:50:58562
[email protected]18d5be92011-07-25 18:00:19563 // WebKit::WebPageSerializerClient implementation ----------------------------
564
565 virtual void didSerializeDataForFrame(
566 const WebKit::WebURL& frame_url,
567 const WebKit::WebCString& data,
568 PageSerializationStatus status) OVERRIDE;
569
[email protected]a2ef54c2011-10-10 16:20:31570 // content::RenderView implementation ----------------------------------------
571
572 virtual bool Send(IPC::Message* message) OVERRIDE;
573 virtual int GetRoutingId() const OVERRIDE;
574 virtual int GetPageId() OVERRIDE;
575 virtual gfx::Size GetSize() OVERRIDE;
576 virtual gfx::NativeViewId GetHostWindow() OVERRIDE;
577 virtual WebPreferences& GetWebkitPreferences() OVERRIDE;
578 virtual WebKit::WebView* GetWebView() OVERRIDE;
579 virtual WebKit::WebNode GetFocusedNode() const OVERRIDE;
580 virtual WebKit::WebNode GetContextMenuNode() const OVERRIDE;
581 virtual bool IsEditableNode(const WebKit::WebNode& node) OVERRIDE;
582 virtual WebKit::WebPlugin* CreatePlugin(
583 WebKit::WebFrame* frame,
584 const webkit::WebPluginInfo& info,
585 const WebKit::WebPluginParams& params) OVERRIDE;
586 virtual void EvaluateScript(const string16& frame_xpath,
587 const string16& jscript,
588 int id,
589 bool notify_result) OVERRIDE;
590 virtual bool ShouldDisplayScrollbars(int width, int height) const OVERRIDE;
591 virtual int GetEnabledBindings() OVERRIDE;
[email protected]a2ef54c2011-10-10 16:20:31592 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
[email protected]766a7082012-02-03 23:39:151253 // Allows JS to access DOM automation. The JS object is only exposed when the
1254 // DOM automation bindings are enabled.
1255 scoped_ptr<DomAutomationController> dom_automation_controller_;
1256
[email protected]ef5e98e2011-12-06 09:49:181257 // NOTE: pepper_delegate_ should be last member because its constructor calls
1258 // AddObservers method of RenderViewImpl from c-tor.
1259 PepperPluginDelegateImpl pepper_delegate_;
1260
[email protected]6e24cf12011-03-18 19:57:021261 // ---------------------------------------------------------------------------
1262 // ADDING NEW DATA? Please see if it fits appropriately in one of the above
1263 // sections rather than throwing it randomly at the end. If you're adding a
1264 // bunch of stuff, you should probably create a helper class and put your
[email protected]310ebd6302011-10-10 19:06:281265 // data and methods on that to avoid bloating RenderView more. You can
1266 // use the Observer interface to filter IPC messages and receive frame change
[email protected]6e24cf12011-03-18 19:57:021267 // notifications.
1268 // ---------------------------------------------------------------------------
1269
[email protected]310ebd6302011-10-10 19:06:281270 DISALLOW_COPY_AND_ASSIGN(RenderViewImpl);
[email protected]6e24cf12011-03-18 19:57:021271};
1272
[email protected]310ebd6302011-10-10 19:06:281273#endif // CONTENT_RENDERER_RENDER_VIEW_IMPL_H_