blob: cf82759797c1ede75ed31575f82f578463799818 [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]6e24cf12011-03-18 19:57:0270class NotificationProvider;
[email protected]6e24cf12011-03-18 19:57:0271class PepperDeviceTest;
[email protected]83f93d32011-11-11 00:43:3072struct PP_NetAddress_Private;
[email protected]ea192e82011-04-11 19:16:0273class RenderWidgetFullscreenPepper;
[email protected]063afcb2011-09-29 07:54:3274class RendererAccessibility;
[email protected]6e24cf12011-03-18 19:57:0275class SkBitmap;
76class SpeechInputDispatcher;
[email protected]6e24cf12011-03-18 19:57:0277struct ViewMsg_Navigate_Params;
78struct ViewMsg_StopFinding_Params;
[email protected]83f93d32011-11-11 00:43:3079struct ViewMsg_SwapOut_Params;
[email protected]6e24cf12011-03-18 19:57:0280struct WebDropData;
[email protected]0d9989d2011-12-21 20:26:0081class WebIntentsHost;
[email protected]83f93d32011-11-11 00:43:3082class WebPluginDelegateProxy;
83class WebUIBindings;
[email protected]b3f8f9722011-08-25 20:56:0784
85namespace content {
[email protected]007733c2011-11-17 00:34:0786class DocumentState;
[email protected]b3f8f9722011-08-25 20:56:0787class P2PSocketDispatcher;
[email protected]3a034ebb2011-10-03 19:19:4488class RenderViewObserver;
[email protected]007733c2011-11-17 00:34:0789class RenderViewTest;
[email protected]8caadeb2011-11-22 02:45:2390struct FileChooserParams;
[email protected]b3f8f9722011-08-25 20:56:0791} // namespace content
[email protected]6e24cf12011-03-18 19:57:0292
[email protected]6e24cf12011-03-18 19:57:0293namespace gfx {
94class Point;
95class Rect;
[email protected]b3f8f9722011-08-25 20:56:0796} // namespace gfx
[email protected]6e24cf12011-03-18 19:57:0297
98namespace webkit {
99
[email protected]6e24cf12011-03-18 19:57:02100namespace ppapi {
[email protected]6e24cf12011-03-18 19:57:02101class PluginInstance;
[email protected]6e24cf12011-03-18 19:57:02102} // namespace ppapi
103
104} // namespace webkit
105
106namespace webkit_glue {
107struct CustomContextMenuContext;
108class ImageResourceFetcher;
[email protected]6e24cf12011-03-18 19:57:02109class ResourceFetcher;
110}
111
112namespace WebKit {
[email protected]6e24cf12011-03-18 19:57:02113class WebApplicationCacheHost;
114class WebApplicationCacheHostClient;
115class WebDataSource;
[email protected]6e24cf12011-03-18 19:57:02116class WebDragData;
[email protected]6e24cf12011-03-18 19:57:02117class WebGeolocationClient;
[email protected]42054a252011-05-17 18:02:13118class WebIconURL;
[email protected]6e24cf12011-03-18 19:57:02119class WebImage;
[email protected]6e24cf12011-03-18 19:57:02120class WebMediaPlayer;
121class WebMediaPlayerClient;
122class WebMouseEvent;
[email protected]273558fb2012-01-12 15:03:51123class WebPeerConnectionHandler;
124class WebPeerConnectionHandlerClient;
[email protected]6e24cf12011-03-18 19:57:02125class WebSpeechInputController;
126class WebSpeechInputListener;
127class WebStorageNamespace;
[email protected]2d0f2e92011-10-03 09:02:24128class WebTouchEvent;
[email protected]b00ba702011-08-17 01:41:03129class WebURLLoader;
[email protected]6e24cf12011-03-18 19:57:02130class WebURLRequest;
[email protected]273558fb2012-01-12 15:03:51131class WebUserMediaClient;
[email protected]6e24cf12011-03-18 19:57:02132struct WebFileChooserParams;
133struct WebFindOptions;
134struct WebMediaPlayerAction;
[email protected]81375e872012-01-11 21:40:36135struct WebPluginAction;
[email protected]6e24cf12011-03-18 19:57:02136struct WebPoint;
137struct WebWindowFeatures;
138}
139
140// We need to prevent a page from trying to create infinite popups. It is not
141// as simple as keeping a count of the number of immediate children
142// popups. Having an html file that window.open()s itself would create
143// an unlimited chain of RenderViews who only have one RenderView child.
144//
145// Therefore, each new top level RenderView creates a new counter and shares it
[email protected]310ebd6302011-10-10 19:06:28146// with all its children and grandchildren popup RenderViewImpls created with
[email protected]6e24cf12011-03-18 19:57:02147// createView() to have a sort of global limit for the page so no more than
148// kMaximumNumberOfPopups popups are created.
149//
150// This is a RefCounted holder of an int because I can't say
151// scoped_refptr<int>.
152typedef base::RefCountedData<int> SharedRenderViewCounter;
153
154//
155// RenderView is an object that manages a WebView object, and provides a
156// communication interface with an embedding application process
157//
[email protected]310ebd6302011-10-10 19:06:28158class RenderViewImpl : public RenderWidget,
159 public WebKit::WebViewClient,
160 public WebKit::WebFrameClient,
161 public WebKit::WebPageSerializerClient,
162 public content::RenderView,
163 public webkit::npapi::WebPluginPageDelegate,
[email protected]a9288f52011-11-17 05:18:16164 public webkit_media::WebMediaPlayerDelegate,
[email protected]310ebd6302011-10-10 19:06:28165 public base::SupportsWeakPtr<RenderViewImpl> {
[email protected]6e24cf12011-03-18 19:57:02166 public:
167 // Creates a new RenderView. The parent_hwnd specifies a HWND to use as the
[email protected]5f9de5882011-09-30 23:36:28168 // parent of the WebView HWND that will be created. If this is a blocked
[email protected]6e24cf12011-03-18 19:57:02169 // popup or as a new tab, opener_id is the routing ID of the RenderView
170 // responsible for creating this RenderView (corresponding to parent_hwnd).
171 // |counter| is either a currently initialized counter, or NULL (in which case
172 // we treat this RenderView as a top level window).
[email protected]310ebd6302011-10-10 19:06:28173 CONTENT_EXPORT static RenderViewImpl* Create(
[email protected]6e24cf12011-03-18 19:57:02174 gfx::NativeViewId parent_hwnd,
175 int32 opener_id,
[email protected]daf82f82011-10-31 22:35:31176 const content::RendererPreferences& renderer_prefs,
[email protected]6e24cf12011-03-18 19:57:02177 const WebPreferences& webkit_prefs,
178 SharedRenderViewCounter* counter,
179 int32 routing_id,
[email protected]9f4f3322012-01-18 22:29:56180 int32 surface_id,
[email protected]6e24cf12011-03-18 19:57:02181 int64 session_storage_namespace_id,
[email protected]74ce1ad2011-12-16 21:51:46182 const string16& frame_name,
183 int32 next_page_id);
[email protected]6e24cf12011-03-18 19:57:02184
[email protected]310ebd6302011-10-10 19:06:28185 // Returns the RenderViewImpl containing the given WebView.
186 CONTENT_EXPORT static RenderViewImpl* FromWebView(WebKit::WebView* webview);
[email protected]6e24cf12011-03-18 19:57:02187
[email protected]6e24cf12011-03-18 19:57:02188 // May return NULL when the view is closing.
[email protected]8d128d62011-09-13 22:11:57189 CONTENT_EXPORT WebKit::WebView* webview() const;
[email protected]6e24cf12011-03-18 19:57:02190
[email protected]65225772011-05-12 21:10:24191 // Called by a GraphicsContext associated with this view when swapbuffers
[email protected]37a6f302011-07-11 23:43:08192 // is posted, completes or is aborted.
193 void OnViewContextSwapBuffersPosted();
[email protected]65225772011-05-12 21:10:24194 void OnViewContextSwapBuffersComplete();
195 void OnViewContextSwapBuffersAborted();
196
[email protected]d466b8a2011-07-15 21:48:03197 int history_list_offset() const { return history_list_offset_; }
[email protected]6e24cf12011-03-18 19:57:02198
[email protected]6e24cf12011-03-18 19:57:02199 const WebPreferences& webkit_preferences() const {
200 return webkit_preferences_;
201 }
202
203 void set_send_content_state_immediately(bool value) {
204 send_content_state_immediately_ = value;
205 }
206
[email protected]273558fb2012-01-12 15:03:51207 MediaStreamDispatcher* media_stream_dispatcher() {
208 return media_stream_dispatcher_;
209 }
210
[email protected]6e24cf12011-03-18 19:57:02211 // Current P2PSocketDispatcher. Set to NULL if P2P API is disabled.
[email protected]b3f8f9722011-08-25 20:56:07212 content::P2PSocketDispatcher* p2p_socket_dispatcher() {
[email protected]6e24cf12011-03-18 19:57:02213 return p2p_socket_dispatcher_;
214 }
215
[email protected]273558fb2012-01-12 15:03:51216 WebKit::WebPeerConnectionHandler* CreatePeerConnectionHandler(
217 WebKit::WebPeerConnectionHandlerClient* client);
218
[email protected]6e24cf12011-03-18 19:57:02219 // Functions to add and remove observers for this object.
[email protected]3a034ebb2011-10-03 19:19:44220 void AddObserver(content::RenderViewObserver* observer);
221 void RemoveObserver(content::RenderViewObserver* observer);
[email protected]6e24cf12011-03-18 19:57:02222
[email protected]6e24cf12011-03-18 19:57:02223 // Adds the given file chooser request to the file_chooser_completion_ queue
224 // (see that var for more) and requests the chooser be displayed if there are
225 // no other waiting items in the queue.
226 //
227 // Returns true if the chooser was successfully scheduled. False means we
228 // didn't schedule anything.
[email protected]8caadeb2011-11-22 02:45:23229 bool ScheduleFileChooser(const content::FileChooserParams& params,
[email protected]6e24cf12011-03-18 19:57:02230 WebKit::WebFileChooserCompletion* completion);
231
[email protected]6e24cf12011-03-18 19:57:02232 // Sets whether the renderer should report load progress to the browser.
233 void SetReportLoadProgressEnabled(bool enabled);
234
[email protected]a2ef54c2011-10-10 16:20:31235 void LoadNavigationErrorPage(
[email protected]8d128d62011-09-13 22:11:57236 WebKit::WebFrame* frame,
237 const WebKit::WebURLRequest& failed_request,
238 const WebKit::WebURLError& error,
239 const std::string& html,
240 bool replace);
[email protected]9966325b2011-04-18 05:00:10241
[email protected]6e24cf12011-03-18 19:57:02242 // Plugin-related functions --------------------------------------------------
243 // (See also WebPluginPageDelegate implementation.)
244
245 // Notification that the given plugin has crashed.
246 void PluginCrashed(const FilePath& plugin_path);
247
[email protected]6e24cf12011-03-18 19:57:02248 // Creates a fullscreen container for a pepper plugin instance.
[email protected]ea192e82011-04-11 19:16:02249 RenderWidgetFullscreenPepper* CreatePepperFullscreenContainer(
[email protected]6e24cf12011-03-18 19:57:02250 webkit::ppapi::PluginInstance* plugin);
251
[email protected]56ea1a62011-05-30 07:05:57252 // Informs the render view that a PPAPI plugin has gained or lost focus.
253 void PpapiPluginFocusChanged();
254
[email protected]73bf95812011-10-12 11:38:32255 // Informs the render view that a PPAPI plugin has changed text input status.
256 void PpapiPluginTextInputTypeChanged();
[email protected]3f783362011-10-21 22:40:50257 void PpapiPluginCaretPositionChanged();
[email protected]73bf95812011-10-12 11:38:32258
259 // Cancels current composition.
260 void PpapiPluginCancelComposition();
261
[email protected]b25b3ee2012-01-13 05:19:54262 // Retrieves the current caret position if a PPAPI plugin has focus.
263 bool GetPpapiPluginCaretBounds(gfx::Rect* rect);
264
[email protected]e6ae0f6c2011-10-04 10:39:23265#if defined(OS_MACOSX) || defined(OS_WIN)
[email protected]6e24cf12011-03-18 19:57:02266 // Informs the render view that the given plugin has gained or lost focus.
267 void PluginFocusChanged(bool focused, int plugin_id);
[email protected]e6ae0f6c2011-10-04 10:39:23268#endif
[email protected]6e24cf12011-03-18 19:57:02269
[email protected]e6ae0f6c2011-10-04 10:39:23270#if defined(OS_MACOSX)
[email protected]6e24cf12011-03-18 19:57:02271 // Starts plugin IME.
272 void StartPluginIme();
273
274 // Helper routines for accelerated plugin support. Used by the
275 // WebPluginDelegateProxy, which has a pointer to the RenderView.
276 gfx::PluginWindowHandle AllocateFakePluginWindowHandle(bool opaque,
277 bool root);
278 void DestroyFakePluginWindowHandle(gfx::PluginWindowHandle window);
279 void AcceleratedSurfaceSetIOSurface(gfx::PluginWindowHandle window,
280 int32 width,
281 int32 height,
282 uint64 io_surface_identifier);
283 TransportDIB::Handle AcceleratedSurfaceAllocTransportDIB(size_t size);
284 void AcceleratedSurfaceFreeTransportDIB(TransportDIB::Id dib_id);
285 void AcceleratedSurfaceSetTransportDIB(gfx::PluginWindowHandle window,
286 int32 width,
287 int32 height,
288 TransportDIB::Handle transport_dib);
289 void AcceleratedSurfaceBuffersSwapped(gfx::PluginWindowHandle window,
290 uint64 surface_id);
291#endif
292
293 void RegisterPluginDelegate(WebPluginDelegateProxy* delegate);
294 void UnregisterPluginDelegate(WebPluginDelegateProxy* delegate);
295
[email protected]4a7d6392011-09-19 20:55:08296 // Helper function to retrieve information about a plugin for a URL and mime
297 // type. Returns false if no plugin was found.
298 // |actual_mime_type| is the actual mime type supported by the
299 // plugin found that match the URL given (one for each item in
300 // |info|).
[email protected]84c13c032011-09-23 00:12:22301 CONTENT_EXPORT bool GetPluginInfo(const GURL& url,
302 const GURL& page_url,
303 const std::string& mime_type,
304 webkit::WebPluginInfo* plugin_info,
305 std::string* actual_mime_type);
[email protected]4a7d6392011-09-19 20:55:08306
[email protected]6e24cf12011-03-18 19:57:02307 // IPC::Channel::Listener implementation -------------------------------------
308
[email protected]edc64de2011-11-17 20:07:38309 virtual bool OnMessageReceived(const IPC::Message& msg) OVERRIDE;
[email protected]6e24cf12011-03-18 19:57:02310
311 // WebKit::WebWidgetClient implementation ------------------------------------
312
313 // Most methods are handled by RenderWidget.
314 virtual void didFocus();
315 virtual void didBlur();
316 virtual void show(WebKit::WebNavigationPolicy policy);
317 virtual void runModal();
[email protected]2b624c562011-10-27 22:58:26318 virtual bool enterFullScreen();
319 virtual void exitFullScreen();
[email protected]6e24cf12011-03-18 19:57:02320
321 // WebKit::WebViewClient implementation --------------------------------------
322
323 virtual WebKit::WebView* createView(
324 WebKit::WebFrame* creator,
325 const WebKit::WebURLRequest& request,
326 const WebKit::WebWindowFeatures& features,
327 const WebKit::WebString& frame_name);
328 virtual WebKit::WebWidget* createPopupMenu(WebKit::WebPopupType popup_type);
329 virtual WebKit::WebWidget* createPopupMenu(
330 const WebKit::WebPopupMenuInfo& info);
331 virtual WebKit::WebExternalPopupMenu* createExternalPopupMenu(
332 const WebKit::WebPopupMenuInfo& popup_menu_info,
333 WebKit::WebExternalPopupMenuClient* popup_menu_client);
334 virtual WebKit::WebStorageNamespace* createSessionStorageNamespace(
335 unsigned quota);
[email protected]7e8b4d12012-01-20 23:39:51336 virtual WebKit::WebGraphicsContext3D* createGraphicsContext3D(
337 WebKit::WebGraphicsContext3D::Attributes attributes,
338 bool direct);
[email protected]6e24cf12011-03-18 19:57:02339 virtual void didAddMessageToConsole(
340 const WebKit::WebConsoleMessage& message,
341 const WebKit::WebString& source_name,
342 unsigned source_line);
343 virtual void printPage(WebKit::WebFrame* frame);
344 virtual WebKit::WebNotificationPresenter* notificationPresenter();
[email protected]8a58c1c2011-04-19 18:40:12345 virtual bool enumerateChosenDirectory(
346 const WebKit::WebString& path,
347 WebKit::WebFileChooserCompletion* chooser_completion);
[email protected]6e24cf12011-03-18 19:57:02348 virtual void didStartLoading();
349 virtual void didStopLoading();
350 virtual void didChangeLoadProgress(WebKit::WebFrame* frame,
351 double load_progress);
352 virtual bool isSmartInsertDeleteEnabled();
353 virtual bool isSelectTrailingWhitespaceEnabled();
354 virtual void didChangeSelection(bool is_selection_empty);
355 virtual void didExecuteCommand(const WebKit::WebString& command_name);
356 virtual bool handleCurrentKeyboardEvent();
[email protected]6e24cf12011-03-18 19:57:02357 virtual bool runFileChooser(
358 const WebKit::WebFileChooserParams& params,
359 WebKit::WebFileChooserCompletion* chooser_completion);
360 virtual void runModalAlertDialog(WebKit::WebFrame* frame,
361 const WebKit::WebString& message);
362 virtual bool runModalConfirmDialog(WebKit::WebFrame* frame,
363 const WebKit::WebString& message);
364 virtual bool runModalPromptDialog(WebKit::WebFrame* frame,
365 const WebKit::WebString& message,
366 const WebKit::WebString& default_value,
367 WebKit::WebString* actual_value);
368 virtual bool runModalBeforeUnloadDialog(WebKit::WebFrame* frame,
369 const WebKit::WebString& message);
370 virtual void showContextMenu(WebKit::WebFrame* frame,
371 const WebKit::WebContextMenuData& data);
[email protected]2b624c562011-10-27 22:58:26372 virtual void enterFullscreen();
373 virtual void exitFullscreen();
[email protected]6e24cf12011-03-18 19:57:02374 virtual void setStatusText(const WebKit::WebString& text);
375 virtual void setMouseOverURL(const WebKit::WebURL& url);
376 virtual void setKeyboardFocusURL(const WebKit::WebURL& url);
[email protected]6e24cf12011-03-18 19:57:02377 virtual void startDragging(const WebKit::WebDragData& data,
378 WebKit::WebDragOperationsMask mask,
379 const WebKit::WebImage& image,
380 const WebKit::WebPoint& imageOffset);
381 virtual bool acceptsLoadDrops();
382 virtual void focusNext();
383 virtual void focusPrevious();
384 virtual void focusedNodeChanged(const WebKit::WebNode& node);
[email protected]169d4282011-11-30 19:33:59385 virtual void didUpdateLayout();
[email protected]6e24cf12011-03-18 19:57:02386 virtual void navigateBackForwardSoon(int offset);
387 virtual int historyBackListCount();
388 virtual int historyForwardListCount();
389 virtual void postAccessibilityNotification(
390 const WebKit::WebAccessibilityObject& obj,
391 WebKit::WebAccessibilityNotification notification);
392 virtual void didUpdateInspectorSetting(const WebKit::WebString& key,
393 const WebKit::WebString& value);
394 virtual WebKit::WebGeolocationClient* geolocationClient();
395 virtual WebKit::WebSpeechInputController* speechInputController(
396 WebKit::WebSpeechInputListener* listener);
397 virtual WebKit::WebDeviceOrientationClient* deviceOrientationClient();
398 virtual void zoomLimitsChanged(double minimum_level, double maximum_level);
399 virtual void zoomLevelChanged();
400 virtual void registerProtocolHandler(const WebKit::WebString& scheme,
401 const WebKit::WebString& base_url,
402 const WebKit::WebString& url,
403 const WebKit::WebString& title);
[email protected]94dec932011-05-26 20:04:21404 virtual WebKit::WebPageVisibilityState visibilityState() const;
[email protected]273558fb2012-01-12 15:03:51405 virtual WebKit::WebUserMediaClient* userMediaClient();
[email protected]6e24cf12011-03-18 19:57:02406
407 // WebKit::WebFrameClient implementation -------------------------------------
408
409 virtual WebKit::WebPlugin* createPlugin(
410 WebKit::WebFrame* frame,
411 const WebKit::WebPluginParams& params);
[email protected]6e24cf12011-03-18 19:57:02412 virtual WebKit::WebSharedWorker* createSharedWorker(
413 WebKit::WebFrame* frame, const WebKit::WebURL& url,
414 const WebKit::WebString& name, unsigned long long documentId);
415 virtual WebKit::WebMediaPlayer* createMediaPlayer(
416 WebKit::WebFrame* frame,
417 WebKit::WebMediaPlayerClient* client);
418 virtual WebKit::WebApplicationCacheHost* createApplicationCacheHost(
419 WebKit::WebFrame* frame,
420 WebKit::WebApplicationCacheHostClient* client);
421 virtual WebKit::WebCookieJar* cookieJar(WebKit::WebFrame* frame);
422 virtual void frameDetached(WebKit::WebFrame* frame);
423 virtual void willClose(WebKit::WebFrame* frame);
[email protected]6e24cf12011-03-18 19:57:02424 virtual void loadURLExternally(WebKit::WebFrame* frame,
425 const WebKit::WebURLRequest& request,
426 WebKit::WebNavigationPolicy policy);
[email protected]0622875ab2011-07-27 12:10:34427 virtual void loadURLExternally(WebKit::WebFrame* frame,
428 const WebKit::WebURLRequest& request,
429 WebKit::WebNavigationPolicy policy,
430 const WebKit::WebString& suggested_name);
[email protected]6e24cf12011-03-18 19:57:02431 virtual WebKit::WebNavigationPolicy decidePolicyForNavigation(
432 WebKit::WebFrame* frame,
433 const WebKit::WebURLRequest& request,
434 WebKit::WebNavigationType type,
435 const WebKit::WebNode&,
436 WebKit::WebNavigationPolicy default_policy,
437 bool is_redirect);
438 virtual bool canHandleRequest(WebKit::WebFrame* frame,
439 const WebKit::WebURLRequest& request);
440 virtual WebKit::WebURLError cannotHandleRequestError(
441 WebKit::WebFrame* frame,
442 const WebKit::WebURLRequest& request);
443 virtual WebKit::WebURLError cancelledError(
444 WebKit::WebFrame* frame,
445 const WebKit::WebURLRequest& request);
446 virtual void unableToImplementPolicyWithError(
447 WebKit::WebFrame* frame,
448 const WebKit::WebURLError& error);
449 virtual void willSendSubmitEvent(WebKit::WebFrame* frame,
450 const WebKit::WebFormElement& form);
451 virtual void willSubmitForm(WebKit::WebFrame* frame,
452 const WebKit::WebFormElement& form);
453 virtual void willPerformClientRedirect(WebKit::WebFrame* frame,
454 const WebKit::WebURL& from,
455 const WebKit::WebURL& to,
456 double interval,
457 double fire_time);
458 virtual void didCancelClientRedirect(WebKit::WebFrame* frame);
459 virtual void didCompleteClientRedirect(WebKit::WebFrame* frame,
460 const WebKit::WebURL& from);
461 virtual void didCreateDataSource(WebKit::WebFrame* frame,
462 WebKit::WebDataSource* datasource);
463 virtual void didStartProvisionalLoad(WebKit::WebFrame* frame);
464 virtual void didReceiveServerRedirectForProvisionalLoad(
465 WebKit::WebFrame* frame);
466 virtual void didFailProvisionalLoad(WebKit::WebFrame* frame,
467 const WebKit::WebURLError& error);
468 virtual void didReceiveDocumentData(WebKit::WebFrame* frame,
469 const char* data, size_t length,
470 bool& prevent_default);
471 virtual void didCommitProvisionalLoad(WebKit::WebFrame* frame,
472 bool is_new_navigation);
473 virtual void didClearWindowObject(WebKit::WebFrame* frame);
474 virtual void didCreateDocumentElement(WebKit::WebFrame* frame);
475 virtual void didReceiveTitle(WebKit::WebFrame* frame,
[email protected]a3bc4d12011-04-20 17:22:21476 const WebKit::WebString& title,
477 WebKit::WebTextDirection direction);
[email protected]42054a252011-05-17 18:02:13478 virtual void didChangeIcon(WebKit::WebFrame*,
479 WebKit::WebIconURL::Type) OVERRIDE;
[email protected]6e24cf12011-03-18 19:57:02480 virtual void didFinishDocumentLoad(WebKit::WebFrame* frame);
481 virtual void didHandleOnloadEvents(WebKit::WebFrame* frame);
482 virtual void didFailLoad(WebKit::WebFrame* frame,
483 const WebKit::WebURLError& error);
484 virtual void didFinishLoad(WebKit::WebFrame* frame);
485 virtual void didNavigateWithinPage(WebKit::WebFrame* frame,
486 bool is_new_navigation);
487 virtual void didUpdateCurrentHistoryItem(WebKit::WebFrame* frame);
488 virtual void assignIdentifierToRequest(WebKit::WebFrame* frame,
489 unsigned identifier,
490 const WebKit::WebURLRequest& request);
491 virtual void willSendRequest(WebKit::WebFrame* frame,
492 unsigned identifier,
493 WebKit::WebURLRequest& request,
494 const WebKit::WebURLResponse& redirect_response);
495 virtual void didReceiveResponse(WebKit::WebFrame* frame,
496 unsigned identifier,
497 const WebKit::WebURLResponse& response);
498 virtual void didFinishResourceLoad(WebKit::WebFrame* frame,
499 unsigned identifier);
500 virtual void didFailResourceLoad(WebKit::WebFrame* frame,
501 unsigned identifier,
502 const WebKit::WebURLError& error);
503 virtual void didLoadResourceFromMemoryCache(
504 WebKit::WebFrame* frame,
505 const WebKit::WebURLRequest& request,
506 const WebKit::WebURLResponse&);
507 virtual void didDisplayInsecureContent(WebKit::WebFrame* frame);
508 virtual void didRunInsecureContent(
509 WebKit::WebFrame* frame,
510 const WebKit::WebSecurityOrigin& origin,
511 const WebKit::WebURL& target);
[email protected]b00ba702011-08-17 01:41:03512 virtual void didAdoptURLLoader(WebKit::WebURLLoader* loader);
[email protected]6e24cf12011-03-18 19:57:02513 virtual void didExhaustMemoryAvailableForScript(WebKit::WebFrame* frame);
[email protected]5bc10932011-09-21 21:03:30514 virtual void didCreateScriptContext(WebKit::WebFrame* frame,
515 v8::Handle<v8::Context>,
516 int world_id);
517 virtual void willReleaseScriptContext(WebKit::WebFrame* frame,
518 v8::Handle<v8::Context>,
519 int world_id);
[email protected]6e24cf12011-03-18 19:57:02520 virtual void didChangeScrollOffset(WebKit::WebFrame* frame);
[email protected]dd6afca2011-08-13 03:44:31521 virtual void numberOfWheelEventHandlersChanged(unsigned num_handlers);
522 virtual void didChangeContentsSize(WebKit::WebFrame* frame,
523 const WebKit::WebSize& size);
[email protected]6e24cf12011-03-18 19:57:02524 virtual void reportFindInPageMatchCount(int request_id,
525 int count,
526 bool final_update);
527 virtual void reportFindInPageSelection(int request_id,
528 int active_match_ordinal,
529 const WebKit::WebRect& sel);
530
531 virtual void openFileSystem(WebKit::WebFrame* frame,
532 WebKit::WebFileSystem::Type type,
533 long long size,
534 bool create,
535 WebKit::WebFileSystemCallbacks* callbacks);
536
[email protected]10e5cf12011-04-13 04:10:40537 virtual void queryStorageUsageAndQuota(
538 WebKit::WebFrame* frame,
539 WebKit::WebStorageQuotaType type,
540 WebKit::WebStorageQuotaCallbacks* callbacks);
541
542 virtual void requestStorageQuota(
543 WebKit::WebFrame* frame,
544 WebKit::WebStorageQuotaType type,
545 unsigned long long requested_size,
546 WebKit::WebStorageQuotaCallbacks* callbacks);
547
[email protected]8b5af492011-11-28 21:50:58548 virtual void registerIntentService(
549 WebKit::WebFrame* frame,
550 const WebKit::WebIntentServiceInfo& service);
551 virtual void dispatchIntent(WebKit::WebFrame* frame,
[email protected]ffc8bed2012-01-21 01:23:15552 const WebKit::WebIntentRequest& intentRequest);
[email protected]8b5af492011-11-28 21:50:58553
[email protected]18d5be92011-07-25 18:00:19554 // WebKit::WebPageSerializerClient implementation ----------------------------
555
556 virtual void didSerializeDataForFrame(
557 const WebKit::WebURL& frame_url,
558 const WebKit::WebCString& data,
559 PageSerializationStatus status) OVERRIDE;
560
[email protected]a2ef54c2011-10-10 16:20:31561 // content::RenderView implementation ----------------------------------------
562
563 virtual bool Send(IPC::Message* message) OVERRIDE;
564 virtual int GetRoutingId() const OVERRIDE;
565 virtual int GetPageId() OVERRIDE;
566 virtual gfx::Size GetSize() OVERRIDE;
567 virtual gfx::NativeViewId GetHostWindow() OVERRIDE;
568 virtual WebPreferences& GetWebkitPreferences() OVERRIDE;
569 virtual WebKit::WebView* GetWebView() OVERRIDE;
570 virtual WebKit::WebNode GetFocusedNode() const OVERRIDE;
571 virtual WebKit::WebNode GetContextMenuNode() const OVERRIDE;
572 virtual bool IsEditableNode(const WebKit::WebNode& node) OVERRIDE;
573 virtual WebKit::WebPlugin* CreatePlugin(
574 WebKit::WebFrame* frame,
575 const webkit::WebPluginInfo& info,
576 const WebKit::WebPluginParams& params) OVERRIDE;
577 virtual void EvaluateScript(const string16& frame_xpath,
578 const string16& jscript,
579 int id,
580 bool notify_result) OVERRIDE;
581 virtual bool ShouldDisplayScrollbars(int width, int height) const OVERRIDE;
582 virtual int GetEnabledBindings() OVERRIDE;
583 virtual void SetEnabledBindings(int enabled_bindings) OVERRIDE;
584 virtual bool GetContentStateImmediately() OVERRIDE;
585 virtual float GetFilteredTimePerFrame() OVERRIDE;
586 virtual void ShowContextMenu(WebKit::WebFrame* frame,
587 const WebKit::WebContextMenuData& data) OVERRIDE;
588 virtual WebKit::WebPageVisibilityState GetVisibilityState() const OVERRIDE;
589 virtual void RunModalAlertDialog(WebKit::WebFrame* frame,
590 const WebKit::WebString& message) OVERRIDE;
591 virtual void LoadURLExternally(
592 WebKit::WebFrame* frame,
593 const WebKit::WebURLRequest& request,
594 WebKit::WebNavigationPolicy policy) OVERRIDE;
595
[email protected]6e24cf12011-03-18 19:57:02596 // webkit_glue::WebPluginPageDelegate implementation -------------------------
597
598 virtual webkit::npapi::WebPluginDelegate* CreatePluginDelegate(
599 const FilePath& file_path,
[email protected]edc64de2011-11-17 20:07:38600 const std::string& mime_type) OVERRIDE;
601 virtual void CreatedPluginWindow(gfx::PluginWindowHandle handle) OVERRIDE;
602 virtual void WillDestroyPluginWindow(gfx::PluginWindowHandle handle) OVERRIDE;
603 virtual void DidMovePlugin(
604 const webkit::npapi::WebPluginGeometry& move) OVERRIDE;
605 virtual void DidStartLoadingForPlugin() OVERRIDE;
606 virtual void DidStopLoadingForPlugin() OVERRIDE;
607 virtual WebKit::WebCookieJar* GetCookieJar() OVERRIDE;
[email protected]6e24cf12011-03-18 19:57:02608
[email protected]a9288f52011-11-17 05:18:16609 // webkit_media::WebMediaPlayerDelegate implementation -----------------------
[email protected]baff4512011-10-19 18:21:07610
[email protected]a9288f52011-11-17 05:18:16611 virtual void DidPlay(webkit_media::WebMediaPlayerImpl* player) OVERRIDE;
612 virtual void DidPause(webkit_media::WebMediaPlayerImpl* player) OVERRIDE;
613 virtual void PlayerGone(webkit_media::WebMediaPlayerImpl* player) OVERRIDE;
[email protected]baff4512011-10-19 18:21:07614
[email protected]6e24cf12011-03-18 19:57:02615 // Please do not add your stuff randomly to the end here. If there is an
616 // appropriate section, add it there. If not, there are some random functions
617 // nearer to the top you can add it to.
[email protected]edc64de2011-11-17 20:07:38618 virtual void DidFlushPaint() OVERRIDE;
[email protected]6e24cf12011-03-18 19:57:02619
[email protected]38b592902011-04-16 02:08:42620 // Cannot use std::set unfortunately since linked_ptr<> does not support
621 // operator<.
622 typedef std::vector<linked_ptr<webkit_glue::ImageResourceFetcher> >
623 ImageResourceFetcherList;
624
[email protected]6e24cf12011-03-18 19:57:02625 protected:
626 // RenderWidget overrides:
[email protected]edc64de2011-11-17 20:07:38627 virtual void Close() OVERRIDE;
[email protected]6e24cf12011-03-18 19:57:02628 virtual void OnResize(const gfx::Size& new_size,
[email protected]ee41e7d22011-10-14 19:34:09629 const gfx::Rect& resizer_rect,
[email protected]edc64de2011-11-17 20:07:38630 bool is_fullscreen) OVERRIDE;
631 virtual void DidInitiatePaint() OVERRIDE;
[email protected]6e24cf12011-03-18 19:57:02632 virtual webkit::ppapi::PluginInstance* GetBitmapForOptimizedPluginPaint(
633 const gfx::Rect& paint_bounds,
634 TransportDIB** dib,
635 gfx::Rect* location,
[email protected]edc64de2011-11-17 20:07:38636 gfx::Rect* clip) OVERRIDE;
637 virtual gfx::Point GetScrollOffset() OVERRIDE;
638 virtual void DidHandleKeyEvent() OVERRIDE;
[email protected]67bfb83f2011-09-22 03:36:37639 virtual bool WillHandleMouseEvent(
640 const WebKit::WebMouseEvent& event) OVERRIDE;
[email protected]edc64de2011-11-17 20:07:38641 virtual void DidHandleMouseEvent(const WebKit::WebMouseEvent& event) OVERRIDE;
642 virtual void DidHandleTouchEvent(const WebKit::WebTouchEvent& event) OVERRIDE;
643 virtual void OnSetFocus(bool enable) OVERRIDE;
644 virtual void OnWasHidden() OVERRIDE;
645 virtual void OnWasRestored(bool needs_repainting) OVERRIDE;
[email protected]65225772011-05-12 21:10:24646 virtual bool SupportsAsynchronousSwapBuffers() OVERRIDE;
[email protected]56ea1a62011-05-30 07:05:57647 virtual void OnImeSetComposition(
648 const string16& text,
649 const std::vector<WebKit::WebCompositionUnderline>& underlines,
650 int selection_start,
651 int selection_end) OVERRIDE;
[email protected]4de6d1692011-10-12 08:45:44652 virtual void OnImeConfirmComposition(
653 const string16& text, const ui::Range& replacement_range) OVERRIDE;
[email protected]ad26ef42011-06-17 07:59:45654 virtual ui::TextInputType GetTextInputType() OVERRIDE;
[email protected]3f783362011-10-21 22:40:50655 virtual void GetSelectionBounds(gfx::Rect* start, gfx::Rect* end) OVERRIDE;
[email protected]ad26ef42011-06-17 07:59:45656 virtual bool CanComposeInline() OVERRIDE;
[email protected]c3d45532011-10-07 19:20:40657 virtual bool WebWidgetHandlesCompositorScheduling() const OVERRIDE;
[email protected]6e24cf12011-03-18 19:57:02658
659 private:
[email protected]6e24cf12011-03-18 19:57:02660 // For unit tests.
661 friend class ExternalPopupMenuTest;
662 friend class PepperDeviceTest;
[email protected]c6d068ff2011-10-14 17:28:23663 friend class content::RenderViewTest;
[email protected]6e24cf12011-03-18 19:57:02664
665 FRIEND_TEST_ALL_PREFIXES(ExternalPopupMenuRemoveTest, RemoveOnChange);
666 FRIEND_TEST_ALL_PREFIXES(ExternalPopupMenuTest, NormalCase);
667 FRIEND_TEST_ALL_PREFIXES(ExternalPopupMenuTest, ShowPopupThenNavigate);
[email protected]068970d2011-10-11 00:05:16668 FRIEND_TEST_ALL_PREFIXES(RenderViewImplTest,
669 DontIgnoreBackAfterNavEntryLimit);
670 FRIEND_TEST_ALL_PREFIXES(RenderViewImplTest, ImeComposition);
671 FRIEND_TEST_ALL_PREFIXES(RenderViewImplTest, InsertCharacters);
672 FRIEND_TEST_ALL_PREFIXES(RenderViewImplTest, JSBlockSentAfterPageLoad);
673 FRIEND_TEST_ALL_PREFIXES(RenderViewImplTest, LastCommittedUpdateState);
674 FRIEND_TEST_ALL_PREFIXES(RenderViewImplTest, OnHandleKeyboardEvent);
675 FRIEND_TEST_ALL_PREFIXES(RenderViewImplTest, OnImeStateChanged);
676 FRIEND_TEST_ALL_PREFIXES(RenderViewImplTest, OnNavStateChanged);
677 FRIEND_TEST_ALL_PREFIXES(RenderViewImplTest, OnSetTextDirection);
678 FRIEND_TEST_ALL_PREFIXES(RenderViewImplTest, OnUpdateWebPreferences);
679 FRIEND_TEST_ALL_PREFIXES(RenderViewImplTest, StaleNavigationsIgnored);
680 FRIEND_TEST_ALL_PREFIXES(RenderViewImplTest, UpdateTargetURLWithInvalidURL);
[email protected]6e24cf12011-03-18 19:57:02681#if defined(OS_MACOSX)
682 FRIEND_TEST_ALL_PREFIXES(RenderViewTest, MacTestCmdUp);
683#endif
[email protected]068970d2011-10-11 00:05:16684 FRIEND_TEST_ALL_PREFIXES(RenderViewImplTest, SetHistoryLengthAndPrune);
[email protected]6e24cf12011-03-18 19:57:02685
[email protected]6e24cf12011-03-18 19:57:02686 typedef std::map<GURL, double> HostZoomLevels;
687
[email protected]6e24cf12011-03-18 19:57:02688 enum ErrorPageType {
689 DNS_ERROR,
690 HTTP_404,
691 CONNECTION_ERROR,
692 };
693
[email protected]310ebd6302011-10-10 19:06:28694 RenderViewImpl(gfx::NativeViewId parent_hwnd,
695 int32 opener_id,
[email protected]daf82f82011-10-31 22:35:31696 const content::RendererPreferences& renderer_prefs,
[email protected]310ebd6302011-10-10 19:06:28697 const WebPreferences& webkit_prefs,
698 SharedRenderViewCounter* counter,
699 int32 routing_id,
[email protected]9f4f3322012-01-18 22:29:56700 int32 surface_id,
[email protected]310ebd6302011-10-10 19:06:28701 int64 session_storage_namespace_id,
[email protected]74ce1ad2011-12-16 21:51:46702 const string16& frame_name,
703 int32 next_page_id);
[email protected]6e24cf12011-03-18 19:57:02704
705 // Do not delete directly. This class is reference counted.
[email protected]310ebd6302011-10-10 19:06:28706 virtual ~RenderViewImpl();
[email protected]6e24cf12011-03-18 19:57:02707
708 void UpdateURL(WebKit::WebFrame* frame);
[email protected]a49e10b2011-08-01 23:57:46709 void UpdateTitle(WebKit::WebFrame* frame, const string16& title,
710 WebKit::WebTextDirection title_direction);
[email protected]6e24cf12011-03-18 19:57:02711 void UpdateSessionHistory(WebKit::WebFrame* frame);
712
713 // Update current main frame's encoding and send it to browser window.
714 // Since we want to let users see the right encoding info from menu
715 // before finishing loading, we call the UpdateEncoding in
716 // a) function:DidCommitLoadForFrame. When this function is called,
717 // that means we have got first data. In here we try to get encoding
718 // of page if it has been specified in http header.
719 // b) function:DidReceiveTitle. When this function is called,
720 // that means we have got specified title. Because in most of webpages,
721 // title tags will follow meta tags. In here we try to get encoding of
722 // page if it has been specified in meta tag.
723 // c) function:DidFinishDocumentLoadForFrame. When this function is
724 // called, that means we have got whole html page. In here we should
725 // finally get right encoding of page.
726 void UpdateEncoding(WebKit::WebFrame* frame,
727 const std::string& encoding_name);
728
[email protected]ae5184d62011-10-06 19:25:58729 void OpenURL(WebKit::WebFrame* frame,
730 const GURL& url,
[email protected]445e1042011-12-03 21:03:15731 const content::Referrer& referrer,
[email protected]6e24cf12011-03-18 19:57:02732 WebKit::WebNavigationPolicy policy);
733
[email protected]269f86d2011-12-07 02:43:47734 bool RunJavaScriptMessage(ui::JavascriptMessageType type,
[email protected]4f5ce842011-05-27 19:34:41735 const string16& message,
736 const string16& default_value,
[email protected]6e24cf12011-03-18 19:57:02737 const GURL& frame_url,
[email protected]4f5ce842011-05-27 19:34:41738 string16* result);
[email protected]6e24cf12011-03-18 19:57:02739
740 // Sends a message and runs a nested message loop.
741 bool SendAndRunNestedMessageLoop(IPC::SyncMessage* message);
742
[email protected]dd6afca2011-08-13 03:44:31743 // Called when the "pinned to left/right edge" state needs to be updated.
744 void UpdateScrollState(WebKit::WebFrame* frame);
745
[email protected]6e24cf12011-03-18 19:57:02746 // IPC message handlers ------------------------------------------------------
747 //
748 // The documentation for these functions should be in
749 // render_messages_internal.h for the message that the function is handling.
750
[email protected]6e24cf12011-03-18 19:57:02751 void OnAllowBindings(int enabled_bindings_flags);
[email protected]6e24cf12011-03-18 19:57:02752 void OnAllowScriptToClose(bool script_can_close);
753 void OnAsyncFileOpened(base::PlatformFileError error_code,
754 IPC::PlatformFileForTransit file_for_transit,
755 int message_id);
[email protected]eb415bf0e2011-04-14 02:45:42756 void OnPpapiBrokerChannelCreated(int request_id,
[email protected]2b657fd2011-04-18 16:00:47757 base::ProcessHandle broker_process_handle,
[email protected]d54305072011-06-22 20:58:43758 const IPC::ChannelHandle& handle);
[email protected]6e24cf12011-03-18 19:57:02759 void OnCancelDownload(int32 download_id);
760 void OnClearFocusedNode();
[email protected]992db4c2011-05-12 15:37:15761 void OnClosePage();
[email protected]6e24cf12011-03-18 19:57:02762#if defined(ENABLE_FLAPPER_HACKS)
763 void OnConnectTcpACK(int request_id,
764 IPC::PlatformFileForTransit socket_for_transit,
[email protected]5a2b68f2011-11-10 00:00:49765 const PP_NetAddress_Private& local_addr,
766 const PP_NetAddress_Private& remote_addr);
[email protected]6e24cf12011-03-18 19:57:02767#endif
768 void OnContextMenuClosed(
769 const webkit_glue::CustomContextMenuContext& custom_context);
770 void OnCopy();
771 void OnCopyImageAt(int x, int y);
772#if defined(OS_MACOSX)
773 void OnCopyToFindPboard();
774#endif
775 void OnCut();
[email protected]318bf5802011-08-08 17:12:41776 void OnCSSInsertRequest(const string16& frame_xpath,
[email protected]01cf589c2011-07-28 18:04:03777 const std::string& css);
[email protected]6e24cf12011-03-18 19:57:02778 void OnCustomContextMenuAction(
779 const webkit_glue::CustomContextMenuContext& custom_context,
780 unsigned action);
781 void OnDelete();
782 void OnDeterminePageLanguage();
783 void OnDisableScrollbarsForSmallWindows(
784 const gfx::Size& disable_scrollbars_size_limit);
785 void OnDisassociateFromPopupCount();
[email protected]6e24cf12011-03-18 19:57:02786 void OnDragSourceEndedOrMoved(const gfx::Point& client_point,
787 const gfx::Point& screen_point,
788 bool ended,
789 WebKit::WebDragOperation drag_operation);
790 void OnDragSourceSystemDragEnded();
791 void OnDragTargetDrop(const gfx::Point& client_pt,
792 const gfx::Point& screen_pt);
793 void OnDragTargetDragEnter(const WebDropData& drop_data,
794 const gfx::Point& client_pt,
795 const gfx::Point& screen_pt,
796 WebKit::WebDragOperationsMask operations_allowed);
797 void OnDragTargetDragLeave();
798 void OnDragTargetDragOver(const gfx::Point& client_pt,
799 const gfx::Point& screen_pt,
800 WebKit::WebDragOperationsMask operations_allowed);
[email protected]2bf834f2011-11-17 20:02:21801 void OnEnablePreferredSizeChangedMode();
[email protected]244ac1892011-12-02 17:04:47802 void OnEnableAutoResize(const gfx::Size& min_size, const gfx::Size& max_size);
[email protected]600ea402011-04-12 00:01:51803 void OnEnumerateDirectoryResponse(int id, const std::vector<FilePath>& paths);
[email protected]6e24cf12011-03-18 19:57:02804 void OnExecuteEditCommand(const std::string& name, const std::string& value);
[email protected]6e24cf12011-03-18 19:57:02805 void OnFileChooserResponse(const std::vector<FilePath>& paths);
806 void OnFind(int request_id, const string16&, const WebKit::WebFindOptions&);
807 void OnFindReplyAck();
[email protected]18d5be92011-07-25 18:00:19808 void OnGetAllSavableResourceLinksForCurrentPage(const GURL& page_url);
809 void OnGetSerializedHtmlDataForCurrentPageWithLocalLinks(
810 const std::vector<GURL>& links,
811 const std::vector<FilePath>& local_paths,
812 const FilePath& local_directory_name);
[email protected]67bfb83f2011-09-22 03:36:37813 void OnLockMouseACK(bool succeeded);
[email protected]6e24cf12011-03-18 19:57:02814 void OnMediaPlayerActionAt(const gfx::Point& location,
815 const WebKit::WebMediaPlayerAction& action);
[email protected]81375e872012-01-11 21:40:36816 void OnPluginActionAt(const gfx::Point& location,
817 const WebKit::WebPluginAction& action);
[email protected]67bfb83f2011-09-22 03:36:37818 void OnMouseLockLost();
[email protected]6e24cf12011-03-18 19:57:02819 void OnMoveOrResizeStarted();
[email protected]f3112a52011-09-30 23:47:49820 CONTENT_EXPORT void OnNavigate(const ViewMsg_Navigate_Params& params);
[email protected]6e24cf12011-03-18 19:57:02821 void OnPaste();
[email protected]44bf7002011-10-16 02:46:15822 void OnPasteAndMatchStyle();
[email protected]6e24cf12011-03-18 19:57:02823#if defined(OS_MACOSX)
824 void OnPluginImeCompositionCompleted(const string16& text, int plugin_id);
825#endif
826 void OnRedo();
827 void OnReloadFrame();
828 void OnReplace(const string16& text);
[email protected]6e24cf12011-03-18 19:57:02829 void OnResetPageEncodingToDefault();
830 void OnScriptEvalRequest(const string16& frame_xpath,
831 const string16& jscript,
832 int id,
833 bool notify_result);
834 void OnSelectAll();
[email protected]4fb60142011-08-09 02:22:08835 void OnSelectRange(const gfx::Point& start, const gfx::Point& end);
[email protected]6e24cf12011-03-18 19:57:02836 void OnSetActive(bool active);
837 void OnSetAltErrorPageURL(const GURL& gurl);
838 void OnSetBackground(const SkBitmap& background);
[email protected]6e24cf12011-03-18 19:57:02839 void OnSetWebUIProperty(const std::string& name, const std::string& value);
840 void OnSetEditCommandsForNextKeyEvent(const EditCommands& edit_commands);
[email protected]f3112a52011-09-30 23:47:49841 CONTENT_EXPORT void OnSetHistoryLengthAndPrune(int history_length,
842 int32 minimum_page_id);
[email protected]6e24cf12011-03-18 19:57:02843 void OnSetInitialFocus(bool reverse);
[email protected]54ca3ca892011-06-07 21:14:54844#if defined(OS_MACOSX)
845 void OnSetInLiveResize(bool in_live_resize);
846#endif
[email protected]333ec8d02011-09-16 18:59:19847 void OnScrollFocusedEditableNodeIntoRect(const gfx::Rect& rect);
[email protected]6e24cf12011-03-18 19:57:02848 void OnSetPageEncoding(const std::string& encoding_name);
[email protected]daf82f82011-10-31 22:35:31849 void OnSetRendererPrefs(const content::RendererPreferences& renderer_prefs);
[email protected]6e24cf12011-03-18 19:57:02850#if defined(OS_MACOSX)
851 void OnSetWindowVisibility(bool visible);
852#endif
853 void OnSetZoomLevel(double zoom_level);
854 void OnSetZoomLevelForLoadingURL(const GURL& url, double zoom_level);
[email protected]8a5e0ca2011-08-25 06:30:47855 void OnExitFullscreen();
[email protected]6e24cf12011-03-18 19:57:02856 void OnShouldClose();
857 void OnStop();
[email protected]815dd9872011-11-23 18:40:30858 void OnStopFinding(content::StopFindAction action);
[email protected]992db4c2011-05-12 15:37:15859 void OnSwapOut(const ViewMsg_SwapOut_Params& params);
[email protected]6e24cf12011-03-18 19:57:02860 void OnThemeChanged();
[email protected]6e24cf12011-03-18 19:57:02861 void OnUndo();
[email protected]6e24cf12011-03-18 19:57:02862 void OnUpdateTargetURLAck();
863 void OnUpdateWebPreferences(const WebPreferences& prefs);
[email protected]08bb1e722011-07-30 19:13:04864
[email protected]6e24cf12011-03-18 19:57:02865#if defined(OS_MACOSX)
866 void OnWindowFrameChanged(const gfx::Rect& window_frame,
867 const gfx::Rect& view_frame);
868 void OnSelectPopupMenuItem(int selected_index);
869#endif
[email protected]54087fe2011-10-28 22:02:48870 void OnZoom(content::PageZoom zoom);
[email protected]47578fa02011-11-02 19:34:41871 void OnZoomFactor(content::PageZoom zoom, int zoom_center_x,
872 int zoom_center_y);
873
[email protected]5a7b15a2011-08-22 22:48:18874 void OnEnableViewSourceMode();
[email protected]6e24cf12011-03-18 19:57:02875
[email protected]64d0e192011-12-09 14:44:20876 void OnJavaBridgeInit();
[email protected]7f3c7af2011-10-20 22:52:51877
[email protected]6e24cf12011-03-18 19:57:02878 // Adding a new message handler? Please add it in alphabetical order above
879 // and put it in the same position in the .cc file.
880
881 // Misc private functions ----------------------------------------------------
[email protected]47578fa02011-11-02 19:34:41882 void ZoomFactorHelper(content::PageZoom zoom, int zoom_center_x,
883 int zoom_center_y, float scaling_increment);
[email protected]6e24cf12011-03-18 19:57:02884
[email protected]6e24cf12011-03-18 19:57:02885 void AltErrorPageFinished(WebKit::WebFrame* frame,
886 const WebKit::WebURLError& original_error,
887 const std::string& html);
888
[email protected]d812fd12011-05-27 23:05:07889 // Check whether the preferred size has changed.
[email protected]6e24cf12011-03-18 19:57:02890 void CheckPreferredSize();
891
[email protected]273558fb2012-01-12 15:03:51892 void EnsureMediaStreamImpl();
893
[email protected]5e56df82011-04-18 17:00:15894 // This callback is triggered when DownloadFavicon completes, either
895 // succesfully or with a failure. See DownloadFavicon for more
896 // details.
897 void DidDownloadFavicon(webkit_glue::ImageResourceFetcher* fetcher,
898 const SkBitmap& image);
[email protected]6e24cf12011-03-18 19:57:02899
[email protected]310ebd6302011-10-10 19:06:28900 // Requests to download a favicon image. When done, the RenderView is notified
901 // by way of DidDownloadFavicon. Returns true if the request was successfully
902 // started, false otherwise. id is used to uniquely identify the request and
903 // passed back to the DidDownloadFavicon method. If the image has multiple
904 // frames, the frame whose size is image_size is returned. If the image
905 // doesn't have a frame at the specified size, the first is returned.
[email protected]5e56df82011-04-18 17:00:15906 bool DownloadFavicon(int id, const GURL& image_url, int image_size);
[email protected]6e24cf12011-03-18 19:57:02907
[email protected]6e24cf12011-03-18 19:57:02908 GURL GetAlternateErrorPageURL(const GURL& failed_url,
909 ErrorPageType error_type);
910
911 // Locates a sub frame with given xpath
[email protected]318bf5802011-08-08 17:12:41912 WebKit::WebFrame* GetChildFrame(const string16& frame_xpath) const;
[email protected]6e24cf12011-03-18 19:57:02913
[email protected]57b9396c2011-10-07 19:11:59914 // Returns the opener url if present, else an empty url.
915 GURL GetOpenerUrl() const;
916
[email protected]6e24cf12011-03-18 19:57:02917 WebUIBindings* GetWebUIBindings();
918
[email protected]6e24cf12011-03-18 19:57:02919 // Should only be called if this object wraps a PluginDocument.
920 WebKit::WebPlugin* GetWebPluginFromPluginDocument();
921
[email protected]d466b8a2011-07-15 21:48:03922 // Returns true if the |params| navigation is to an entry that has been
923 // cropped due to a recent navigation the browser did not know about.
924 bool IsBackForwardToStaleEntry(const ViewMsg_Navigate_Params& params,
925 bool is_reload);
926
[email protected]6e24cf12011-03-18 19:57:02927 // Returns false unless this is a top-level navigation that crosses origins.
928 bool IsNonLocalTopLevelNavigation(const GURL& url,
929 WebKit::WebFrame* frame,
930 WebKit::WebNavigationType type);
931
[email protected]6e24cf12011-03-18 19:57:02932 bool MaybeLoadAlternateErrorPage(WebKit::WebFrame* frame,
933 const WebKit::WebURLError& error,
934 bool replace);
935
[email protected]007733c2011-11-17 00:34:07936 // If we initiated a navigation, this function will populate |document_state|
937 // with the navigation information saved in OnNavigate().
938 void PopulateStateFromPendingNavigationParams(
939 content::DocumentState* document_state);
940
[email protected]6e24cf12011-03-18 19:57:02941 // Starts nav_state_sync_timer_ if it isn't already running.
942 void StartNavStateSyncTimerIfNecessary();
943
944 // Dispatches the current navigation state to the browser. Called on a
945 // periodic timer so we don't send too many messages.
946 void SyncNavigationState();
947
[email protected]b781ff282011-08-20 06:19:36948 // Dispatches the current state of selection on the webpage to the browser if
949 // it has changed.
950 // TODO(varunjain): delete this method once we figure out how to keep
951 // selection handles in sync with the webpage.
952 void SyncSelectionIfRequired();
953
[email protected]e63c4d72011-05-31 22:38:29954#if defined(OS_POSIX) && !defined(OS_MACOSX)
[email protected]6e24cf12011-03-18 19:57:02955 void UpdateFontRenderingFromRendererPrefs();
956#else
957 void UpdateFontRenderingFromRendererPrefs() {}
958#endif
959
960 // Update the target url and tell the browser that the target URL has changed.
961 // If |url| is empty, show |fallback_url|.
962 void UpdateTargetURL(const GURL& url, const GURL& fallback_url);
963
[email protected]6e24cf12011-03-18 19:57:02964 // ---------------------------------------------------------------------------
965 // ADDING NEW FUNCTIONS? Please keep private functions alphabetized and put
966 // it in the same order in the .cc file as it was in the header.
967 // ---------------------------------------------------------------------------
968
969 // Settings ------------------------------------------------------------------
970
971 WebPreferences webkit_preferences_;
[email protected]daf82f82011-10-31 22:35:31972 content::RendererPreferences renderer_preferences_;
[email protected]6e24cf12011-03-18 19:57:02973
[email protected]6e24cf12011-03-18 19:57:02974 HostZoomLevels host_zoom_levels_;
975
976 // Whether content state (such as form state, scroll position and page
977 // contents) should be sent to the browser immediately. This is normally
978 // false, but set to true by some tests.
979 bool send_content_state_immediately_;
980
[email protected]6e24cf12011-03-18 19:57:02981 // Bitwise-ORed set of extra bindings that have been enabled. See
982 // BindingsPolicy for details.
983 int enabled_bindings_;
984
985 // The alternate error page URL, if one exists.
986 GURL alternate_error_page_url_;
987
988 // If true, we send IPC messages when |preferred_size_| changes.
989 bool send_preferred_size_changes_;
990
991 // If non-empty, and |send_preferred_size_changes_| is true, disable drawing
992 // scroll bars on windows smaller than this size. Used for windows that the
993 // browser resizes to the size of the content, such as browser action popups.
994 // If a render view is set to the minimum size of its content, webkit may add
995 // scroll bars. This makes sense for fixed sized windows, but it does not
996 // make sense when the size of the view was chosen to fit the content.
997 // This setting ensures that no scroll bars are drawn. The size limit exists
998 // because if the view grows beyond a size known to the browser, scroll bars
999 // should be drawn.
1000 gfx::Size disable_scrollbars_size_limit_;
1001
[email protected]6e24cf12011-03-18 19:57:021002 // Loading state -------------------------------------------------------------
1003
1004 // True if the top level frame is currently being loaded.
1005 bool is_loading_;
1006
1007 // The gesture that initiated the current navigation.
1008 NavigationGesture navigation_gesture_;
1009
1010 // Used for popups.
1011 bool opened_by_user_gesture_;
1012 GURL creator_url_;
1013
1014 // Whether this RenderView was created by a frame that was suppressing its
1015 // opener. If so, we may want to load pages in a separate process. See
1016 // decidePolicyForNavigation for details.
1017 bool opener_suppressed_;
1018
1019 // If we are handling a top-level client-side redirect, this tracks the URL
1020 // of the page that initiated it. Specifically, when a load is committed this
1021 // is used to determine if that load originated from a client-side redirect.
1022 // It is empty if there is no top-level client-side redirect.
[email protected]445e1042011-12-03 21:03:151023 content::Referrer completed_client_redirect_src_;
[email protected]6e24cf12011-03-18 19:57:021024
[email protected]6e24cf12011-03-18 19:57:021025 // Holds state pertaining to a navigation that we initiated. This is held by
1026 // the WebDataSource::ExtraData attribute. We use pending_navigation_state_
1027 // as a temporary holder for the state until the WebDataSource corresponding
1028 // to the new navigation is created. See DidCreateDataSource.
[email protected]007733c2011-11-17 00:34:071029 scoped_ptr<ViewMsg_Navigate_Params> pending_navigation_params_;
[email protected]6e24cf12011-03-18 19:57:021030
1031 // Timer used to delay the updating of nav state (see SyncNavigationState).
[email protected]310ebd6302011-10-10 19:06:281032 base::OneShotTimer<RenderViewImpl> nav_state_sync_timer_;
[email protected]6e24cf12011-03-18 19:57:021033
[email protected]6e24cf12011-03-18 19:57:021034 // Page IDs ------------------------------------------------------------------
[email protected]a813c8e2011-10-08 01:34:111035 // See documentation in content::RenderView.
[email protected]6e24cf12011-03-18 19:57:021036 int32 page_id_;
1037
1038 // Indicates the ID of the last page that we sent a FrameNavigate to the
1039 // browser for. This is used to determine if the most recent transition
1040 // generated a history entry (less than page_id_), or not (equal to or
1041 // greater than). Note that this will be greater than page_id_ if the user
1042 // goes back.
1043 int32 last_page_id_sent_to_browser_;
1044
[email protected]74ce1ad2011-12-16 21:51:461045 // The next available page ID to use for this RenderView. These IDs are
1046 // specific to a given RenderView and the frames within it.
1047 int32 next_page_id_;
[email protected]6e24cf12011-03-18 19:57:021048
[email protected]d466b8a2011-07-15 21:48:031049 // The offset of the current item in the history list.
1050 int history_list_offset_;
1051
1052 // The RenderView's current impression of the history length. This includes
1053 // any items that have committed in this process, but because of cross-process
1054 // navigations, the history may have some entries that were committed in other
1055 // processes. We won't know about them until the next navigation in this
1056 // process.
1057 int history_list_length_;
1058
1059 // The list of page IDs for each history item this RenderView knows about.
1060 // Some entries may be -1 if they were rendered by other processes or were
1061 // restored from a previous session. This lets us detect attempts to
1062 // navigate to stale entries that have been cropped from our history.
1063 std::vector<int32> history_page_ids_;
1064
[email protected]6e24cf12011-03-18 19:57:021065 // Page info -----------------------------------------------------------------
1066
1067 // The last gotten main frame's encoding.
1068 std::string last_encoding_name_;
1069
[email protected]6e24cf12011-03-18 19:57:021070 // UI state ------------------------------------------------------------------
1071
1072 // The state of our target_url transmissions. When we receive a request to
1073 // send a URL to the browser, we set this to TARGET_INFLIGHT until an ACK
1074 // comes back - if a new request comes in before the ACK, we store the new
1075 // URL in pending_target_url_ and set the status to TARGET_PENDING. If an
1076 // ACK comes back and we are in TARGET_PENDING, we send the stored URL and
1077 // revert to TARGET_INFLIGHT.
1078 //
1079 // We don't need a queue of URLs to send, as only the latest is useful.
1080 enum {
1081 TARGET_NONE,
1082 TARGET_INFLIGHT, // We have a request in-flight, waiting for an ACK
1083 TARGET_PENDING // INFLIGHT + we have a URL waiting to be sent
1084 } target_url_status_;
1085
1086 // The URL we show the user in the status bar. We use this to determine if we
1087 // want to send a new one (we do not need to send duplicates). It will be
1088 // equal to either |mouse_over_url_| or |focus_url_|, depending on which was
1089 // updated last.
1090 GURL target_url_;
1091
1092 // The URL the user's mouse is hovering over.
1093 GURL mouse_over_url_;
1094
1095 // The URL that has keyboard focus.
1096 GURL focus_url_;
1097
1098 // The next target URL we want to send to the browser.
1099 GURL pending_target_url_;
1100
[email protected]6e24cf12011-03-18 19:57:021101 // The text selection the last time DidChangeSelection got called.
[email protected]e99ef6f2011-10-16 01:13:001102 string16 selection_text_;
1103 size_t selection_text_offset_;
1104 ui::Range selection_range_;
[email protected]6e24cf12011-03-18 19:57:021105
1106 // View ----------------------------------------------------------------------
1107
[email protected]6e24cf12011-03-18 19:57:021108 // Cache the preferred size of the page in order to prevent sending the IPC
1109 // when layout() recomputes but doesn't actually change sizes.
1110 gfx::Size preferred_size_;
1111
[email protected]1e0c8e02011-05-25 07:49:371112 // Used to delay determining the preferred size (to avoid intermediate
1113 // states for the sizes).
[email protected]310ebd6302011-10-10 19:06:281114 base::OneShotTimer<RenderViewImpl> check_preferred_size_timer_;
[email protected]1e0c8e02011-05-25 07:49:371115
[email protected]dd6afca2011-08-13 03:44:311116 // These store the "is main frame is scrolled all the way to the left
1117 // or right" state that was last sent to the browser.
1118 bool cached_is_main_frame_pinned_to_left_;
1119 bool cached_is_main_frame_pinned_to_right_;
1120
1121 // These store the "has scrollbars" state last sent to the browser.
1122 bool cached_has_main_frame_horizontal_scrollbar_;
1123 bool cached_has_main_frame_vertical_scrollbar_;
1124
[email protected]6e24cf12011-03-18 19:57:021125#if defined(OS_MACOSX)
1126 // Track the fake plugin window handles allocated on the browser side for
1127 // the accelerated compositor and (currently) accelerated plugins so that
1128 // we can discard them when the view goes away.
1129 std::set<gfx::PluginWindowHandle> fake_plugin_window_handles_;
1130#endif
1131
[email protected]6e24cf12011-03-18 19:57:021132 // Helper objects ------------------------------------------------------------
1133
[email protected]6e24cf12011-03-18 19:57:021134 RendererWebCookieJarImpl cookie_jar_;
1135
1136 // The next group of objects all implement RenderViewObserver, so are deleted
[email protected]310ebd6302011-10-10 19:06:281137 // along with the RenderView automatically. This is why we just store
1138 // weak references.
[email protected]6e24cf12011-03-18 19:57:021139
[email protected]6e24cf12011-03-18 19:57:021140 // Holds a reference to the service which provides desktop notifications.
1141 NotificationProvider* notification_provider_;
1142
1143 // The geolocation dispatcher attached to this view, lazily initialized.
1144 GeolocationDispatcher* geolocation_dispatcher_;
1145
[email protected]0d9989d2011-12-21 20:26:001146 // The intents host attached to this view. Not lazily initialized.
1147 WebIntentsHost* intents_host_;
[email protected]1ef93132011-09-16 18:33:471148
[email protected]6e24cf12011-03-18 19:57:021149 // The speech dispatcher attached to this view, lazily initialized.
1150 SpeechInputDispatcher* speech_input_dispatcher_;
1151
1152 // Device orientation dispatcher attached to this view; lazily initialized.
1153 DeviceOrientationDispatcher* device_orientation_dispatcher_;
1154
[email protected]273558fb2012-01-12 15:03:511155 // MediaStream dispatcher attached to this view; lazily initialized.
1156 MediaStreamDispatcher* media_stream_dispatcher_;
1157
[email protected]ab2c4732011-07-20 19:57:401158 // MediaStreamImpl attached to this view; lazily initialized.
1159 scoped_refptr<MediaStreamImpl> media_stream_impl_;
1160
[email protected]6e24cf12011-03-18 19:57:021161 // Dispatches all P2P socket used by the renderer.
[email protected]b3f8f9722011-08-25 20:56:071162 content::P2PSocketDispatcher* p2p_socket_dispatcher_;
[email protected]6e24cf12011-03-18 19:57:021163
[email protected]c5c1d6d2011-07-28 18:42:411164 DevToolsAgent* devtools_agent_;
1165
[email protected]063afcb2011-09-29 07:54:321166 RendererAccessibility* renderer_accessibility_;
1167
[email protected]7f3c7af2011-10-20 22:52:511168 // Java Bridge dispatcher attached to this view; lazily initialized.
1169 scoped_ptr<JavaBridgeDispatcher> java_bridge_dispatcher_;
1170
[email protected]6e24cf12011-03-18 19:57:021171 // Misc ----------------------------------------------------------------------
1172
1173 // The current and pending file chooser completion objects. If the queue is
1174 // nonempty, the first item represents the currently running file chooser
1175 // callback, and the remaining elements are the other file chooser completion
1176 // still waiting to be run (in order).
1177 struct PendingFileChooser;
1178 std::deque< linked_ptr<PendingFileChooser> > file_chooser_completions_;
1179
[email protected]600ea402011-04-12 00:01:511180 // The current directory enumeration callback
1181 std::map<int, WebKit::WebFileChooserCompletion*> enumeration_completions_;
1182 int enumeration_completion_id_;
1183
[email protected]6e24cf12011-03-18 19:57:021184 // The SessionStorage namespace that we're assigned to has an ID, and that ID
1185 // is passed to us upon creation. WebKit asks for this ID upon first use and
1186 // uses it whenever asking the browser process to allocate new storage areas.
1187 int64 session_storage_namespace_id_;
1188
1189 // The total number of unrequested popups that exist and can be followed back
[email protected]310ebd6302011-10-10 19:06:281190 // to a common opener. This count is shared among all RenderViews created with
1191 // createView(). All popups are treated as unrequested until specifically
1192 // instructed otherwise by the Browser process.
[email protected]6e24cf12011-03-18 19:57:021193 scoped_refptr<SharedRenderViewCounter> shared_popup_counter_;
1194
1195 // Whether this is a top level window (instead of a popup). Top level windows
1196 // shouldn't count against their own |shared_popup_counter_|.
1197 bool decrement_shared_popup_at_destruction_;
1198
1199 // If the browser hasn't sent us an ACK for the last FindReply we sent
1200 // to it, then we need to queue up the message (keeping only the most
1201 // recent message if new ones come in).
1202 scoped_ptr<IPC::Message> queued_find_reply_message_;
1203
1204 // Stores edit commands associated to the next key event.
1205 // Shall be cleared as soon as the next key event is processed.
1206 EditCommands edit_commands_;
1207
[email protected]6e24cf12011-03-18 19:57:021208 // Allows Web UI pages (new tab page, etc.) to talk to the browser. The JS
1209 // object is only exposed when Web UI bindings are enabled.
1210 scoped_ptr<WebUIBindings> web_ui_bindings_;
1211
[email protected]6e24cf12011-03-18 19:57:021212 // The external popup for the currently showing select popup.
1213 scoped_ptr<ExternalPopupMenu> external_popup_menu_;
1214
1215 // The node that the context menu was pressed over.
1216 WebKit::WebNode context_menu_node_;
1217
1218 // Reports load progress to the browser.
1219 scoped_ptr<LoadProgressTracker> load_progress_tracker_;
1220
1221 // All the registered observers. We expect this list to be small, so vector
1222 // is fine.
[email protected]3a034ebb2011-10-03 19:19:441223 ObserverList<content::RenderViewObserver> observers_;
[email protected]6e24cf12011-03-18 19:57:021224
[email protected]4fb60142011-08-09 02:22:081225 // Used to inform didChangeSelection() when it is called in the context
1226 // of handling a ViewMsg_SelectRange IPC.
1227 bool handling_select_range_;
1228
[email protected]ef5e98e2011-12-06 09:49:181229 // Plugins -------------------------------------------------------------------
1230
1231 // All the currently active plugin delegates for this RenderView; kept so
1232 // that we can enumerate them to send updates about things like window
1233 // location or tab focus and visibily. These are non-owning references.
1234 std::set<WebPluginDelegateProxy*> plugin_delegates_;
1235
1236#if defined(OS_WIN)
1237 // The ID of the focused NPAPI plug-in.
1238 int focused_plugin_id_;
1239#endif
1240
1241 // NOTE: pepper_delegate_ should be last member because its constructor calls
1242 // AddObservers method of RenderViewImpl from c-tor.
1243 PepperPluginDelegateImpl pepper_delegate_;
1244
[email protected]6e24cf12011-03-18 19:57:021245 // ---------------------------------------------------------------------------
1246 // ADDING NEW DATA? Please see if it fits appropriately in one of the above
1247 // sections rather than throwing it randomly at the end. If you're adding a
1248 // bunch of stuff, you should probably create a helper class and put your
[email protected]310ebd6302011-10-10 19:06:281249 // data and methods on that to avoid bloating RenderView more. You can
1250 // use the Observer interface to filter IPC messages and receive frame change
[email protected]6e24cf12011-03-18 19:57:021251 // notifications.
1252 // ---------------------------------------------------------------------------
1253
[email protected]310ebd6302011-10-10 19:06:281254 DISALLOW_COPY_AND_ASSIGN(RenderViewImpl);
[email protected]6e24cf12011-03-18 19:57:021255};
1256
[email protected]310ebd6302011-10-10 19:06:281257#endif // CONTENT_RENDERER_RENDER_VIEW_IMPL_H_