Updating trunk VERSION from 2139.0 to 2140.0
[chromium-blink-merge.git] / content / renderer / render_view_impl.h
blob08a4f74fbfc380cc350f1bda1f83274c941dd0a4
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef CONTENT_RENDERER_RENDER_VIEW_IMPL_H_
6 #define CONTENT_RENDERER_RENDER_VIEW_IMPL_H_
8 #include <deque>
9 #include <map>
10 #include <set>
11 #include <string>
12 #include <vector>
14 #include "base/basictypes.h"
15 #include "base/gtest_prod_util.h"
16 #include "base/id_map.h"
17 #include "base/memory/linked_ptr.h"
18 #include "base/memory/weak_ptr.h"
19 #include "base/observer_list.h"
20 #include "base/process/process.h"
21 #include "base/strings/string16.h"
22 #include "base/timer/timer.h"
23 #include "build/build_config.h"
24 #include "cc/input/top_controls_state.h"
25 #include "cc/resources/shared_bitmap.h"
26 #include "content/common/content_export.h"
27 #include "content/common/drag_event_source_info.h"
28 #include "content/common/edit_command.h"
29 #include "content/common/gpu/client/webgraphicscontext3d_command_buffer_impl.h"
30 #include "content/common/navigation_gesture.h"
31 #include "content/common/view_message_enums.h"
32 #include "content/public/common/page_zoom.h"
33 #include "content/public/common/referrer.h"
34 #include "content/public/common/renderer_preferences.h"
35 #include "content/public/common/stop_find_action.h"
36 #include "content/public/common/top_controls_state.h"
37 #include "content/public/common/web_preferences.h"
38 #include "content/public/renderer/render_view.h"
39 #include "content/renderer/mouse_lock_dispatcher.h"
40 #include "content/renderer/render_frame_impl.h"
41 #include "content/renderer/render_widget.h"
42 #include "content/renderer/stats_collection_observer.h"
43 #include "ipc/ipc_platform_file.h"
44 #include "third_party/WebKit/public/platform/WebGraphicsContext3D.h"
45 #include "third_party/WebKit/public/web/WebAXObject.h"
46 #include "third_party/WebKit/public/web/WebConsoleMessage.h"
47 #include "third_party/WebKit/public/web/WebDataSource.h"
48 #include "third_party/WebKit/public/web/WebElement.h"
49 #include "third_party/WebKit/public/web/WebHistoryItem.h"
50 #include "third_party/WebKit/public/web/WebIconURL.h"
51 #include "third_party/WebKit/public/web/WebInputEvent.h"
52 #include "third_party/WebKit/public/web/WebNavigationType.h"
53 #include "third_party/WebKit/public/web/WebNode.h"
54 #include "third_party/WebKit/public/web/WebPageSerializerClient.h"
55 #include "third_party/WebKit/public/web/WebPageVisibilityState.h"
56 #include "third_party/WebKit/public/web/WebSecurityOrigin.h"
57 #include "third_party/WebKit/public/web/WebViewClient.h"
58 #include "ui/base/window_open_disposition.h"
59 #include "ui/surface/transport_dib.h"
61 #if defined(OS_ANDROID)
62 #include "content/renderer/android/content_detector.h"
63 #include "content/renderer/android/renderer_date_time_picker.h"
64 #include "third_party/WebKit/public/web/WebContentDetectionResult.h"
65 #endif
67 #if defined(COMPILER_MSVC)
68 // RenderViewImpl is a diamond-shaped hierarchy, with WebWidgetClient at the
69 // root. VS warns when we inherit the WebWidgetClient method implementations
70 // from RenderWidget. It's safe to ignore that warning.
71 #pragma warning(disable: 4250)
72 #endif
74 class PepperDeviceTest;
75 class SkBitmap;
76 struct PP_NetAddress_Private;
77 struct FrameMsg_Navigate_Params;
78 struct ViewMsg_PostMessage_Params;
79 struct ViewMsg_StopFinding_Params;
81 namespace base {
82 class CommandLine;
85 namespace blink {
86 class WebApplicationCacheHost;
87 class WebApplicationCacheHostClient;
88 class WebDOMMessageEvent;
89 class WebDataSource;
90 class WebDateTimeChooserCompletion;
91 class WebDragData;
92 class WebGestureEvent;
93 class WebIconURL;
94 class WebImage;
95 class WebPeerConnection00Handler;
96 class WebPeerConnection00HandlerClient;
97 class WebMouseEvent;
98 class WebPeerConnectionHandler;
99 class WebPeerConnectionHandlerClient;
100 class WebSocketStreamHandle;
101 class WebSpeechRecognizer;
102 class WebStorageNamespace;
103 class WebTouchEvent;
104 class WebURLRequest;
105 struct WebActiveWheelFlingParameters;
106 struct WebDateTimeChooserParams;
107 struct WebFileChooserParams;
108 struct WebFindOptions;
109 struct WebMediaPlayerAction;
110 struct WebPluginAction;
111 struct WebPoint;
112 struct WebWindowFeatures;
114 #if defined(OS_ANDROID)
115 class WebHitTestResult;
116 #endif
117 } // namespace blink
119 namespace ui {
120 struct SelectedFileInfo;
123 namespace content {
125 class BrowserPluginManager;
126 class DevToolsAgent;
127 class DocumentState;
128 class FaviconHelper;
129 class HistoryController;
130 class HistoryEntry;
131 class ImageResourceFetcher;
132 class MouseLockDispatcher;
133 class NavigationState;
134 class PepperPluginInstanceImpl;
135 class RenderViewImplTest;
136 class RenderViewObserver;
137 class RenderViewTest;
138 class RendererDateTimePicker;
139 class RendererWebColorChooserImpl;
140 class SpeechRecognitionDispatcher;
141 class WebPluginDelegateProxy;
142 struct DropData;
143 struct FaviconURL;
144 struct FileChooserParams;
145 struct RenderViewImplParams;
147 #if defined(OS_ANDROID)
148 class WebMediaPlayerProxyAndroid;
149 #endif
152 // RenderView is an object that manages a WebView object, and provides a
153 // communication interface with an embedding application process.
155 class CONTENT_EXPORT RenderViewImpl
156 : public RenderWidget,
157 NON_EXPORTED_BASE(public blink::WebViewClient),
158 NON_EXPORTED_BASE(public blink::WebPageSerializerClient),
159 public RenderView,
160 public base::SupportsWeakPtr<RenderViewImpl> {
161 public:
162 // Creates a new RenderView. |opener_id| is the routing ID of the RenderView
163 // responsible for creating this RenderView. Note that if the original opener
164 // has been closed, |window_was_created_with_opener| will be true and
165 // |opener_id| will be MSG_ROUTING_NONE. When |swapped_out| is true, the
166 // |proxy_routing_id| is specified, so a RenderFrameProxy can be created for
167 // this RenderView's main RenderFrame.
168 static RenderViewImpl* Create(int32 opener_id,
169 bool window_was_created_with_opener,
170 const RendererPreferences& renderer_prefs,
171 const WebPreferences& webkit_prefs,
172 int32 routing_id,
173 int32 main_frame_routing_id,
174 int32 surface_id,
175 int64 session_storage_namespace_id,
176 const base::string16& frame_name,
177 bool is_renderer_created,
178 bool swapped_out,
179 int32 proxy_routing_id,
180 bool hidden,
181 bool never_visible,
182 int32 next_page_id,
183 const blink::WebScreenInfo& screen_info);
185 // Used by content_layouttest_support to hook into the creation of
186 // RenderViewImpls.
187 static void InstallCreateHook(
188 RenderViewImpl* (*create_render_view_impl)(RenderViewImplParams*));
190 // Returns the RenderViewImpl containing the given WebView.
191 static RenderViewImpl* FromWebView(blink::WebView* webview);
193 // Returns the RenderViewImpl for the given routing ID.
194 static RenderViewImpl* FromRoutingID(int routing_id);
196 static size_t GetRenderViewCount();
198 // May return NULL when the view is closing.
199 blink::WebView* webview() const;
201 int history_list_offset() const { return history_list_offset_; }
203 const WebPreferences& webkit_preferences() const {
204 return webkit_preferences_;
207 const RendererPreferences& renderer_preferences() const {
208 return renderer_preferences_;
211 void set_send_content_state_immediately(bool value) {
212 send_content_state_immediately_ = value;
215 RenderFrameImpl* main_render_frame() { return main_render_frame_.get(); }
217 MouseLockDispatcher* mouse_lock_dispatcher() {
218 return mouse_lock_dispatcher_;
221 HistoryController* history_controller() {
222 return history_controller_.get();
225 // Lazily initialize this view's BrowserPluginManager and return it.
226 BrowserPluginManager* GetBrowserPluginManager();
228 // Functions to add and remove observers for this object.
229 void AddObserver(RenderViewObserver* observer);
230 void RemoveObserver(RenderViewObserver* observer);
232 // Returns the StatsCollectionObserver associated with this view, or NULL
233 // if one wasn't created;
234 StatsCollectionObserver* GetStatsCollectionObserver() {
235 return stats_collection_observer_.get();
238 // Adds the given file chooser request to the file_chooser_completion_ queue
239 // (see that var for more) and requests the chooser be displayed if there are
240 // no other waiting items in the queue.
242 // Returns true if the chooser was successfully scheduled. False means we
243 // didn't schedule anything.
244 bool ScheduleFileChooser(const FileChooserParams& params,
245 blink::WebFileChooserCompletion* completion);
247 #if defined(OS_ANDROID)
248 void DismissDateTimeDialog();
249 #endif
251 bool is_loading() const { return frames_in_progress_ != 0; }
253 void FrameDidStartLoading(blink::WebFrame* frame);
254 void FrameDidStopLoading(blink::WebFrame* frame);
256 // Plugin-related functions --------------------------------------------------
258 #if defined(ENABLE_PLUGINS)
259 // Get/set the plugin which will be used as to handle document find requests.
260 void set_plugin_find_handler(PepperPluginInstanceImpl* plugin) {
261 plugin_find_handler_ = plugin;
263 PepperPluginInstanceImpl* plugin_find_handler() {
264 return plugin_find_handler_;
267 PepperPluginInstanceImpl* focused_pepper_plugin() {
268 return focused_pepper_plugin_;
270 PepperPluginInstanceImpl* pepper_last_mouse_event_target() {
271 return pepper_last_mouse_event_target_;
273 void set_pepper_last_mouse_event_target(PepperPluginInstanceImpl* plugin) {
274 pepper_last_mouse_event_target_ = plugin;
277 #if defined(OS_MACOSX) || defined(OS_WIN)
278 // Informs the render view that the given plugin has gained or lost focus.
279 void PluginFocusChanged(bool focused, int plugin_id);
280 #endif
282 #if defined(OS_MACOSX)
283 // Starts plugin IME.
284 void StartPluginIme();
285 #endif
287 // Indicates that the given instance has been created.
288 void PepperInstanceCreated(PepperPluginInstanceImpl* instance);
290 // Indicates that the given instance is being destroyed. This is called from
291 // the destructor, so it's important that the instance is not dereferenced
292 // from this call.
293 void PepperInstanceDeleted(PepperPluginInstanceImpl* instance);
295 // Notification that the given plugin is focused or unfocused.
296 void PepperFocusChanged(PepperPluginInstanceImpl* instance, bool focused);
298 void RegisterPluginDelegate(WebPluginDelegateProxy* delegate);
299 void UnregisterPluginDelegate(WebPluginDelegateProxy* delegate);
300 #endif // ENABLE_PLUGINS
302 void TransferActiveWheelFlingAnimation(
303 const blink::WebActiveWheelFlingParameters& params);
305 // Returns true if the focused element is editable text from the perspective
306 // of IME support (also used for on-screen keyboard). Works correctly inside
307 // supported PPAPI plug-ins.
308 bool HasIMETextFocus();
310 // Callback for use with GetWindowSnapshot.
311 typedef base::Callback<void(
312 const gfx::Size&, const std::vector<unsigned char>&)>
313 WindowSnapshotCallback;
315 void GetWindowSnapshot(const WindowSnapshotCallback& callback);
317 // Dispatches the current navigation state to the browser. Called on a
318 // periodic timer so we don't send too many messages.
319 void SyncNavigationState();
321 // Returns the length of the session history of this RenderView. Note that
322 // this only coincides with the actual length of the session history if this
323 // RenderView is the currently active RenderView of a WebContents.
324 unsigned GetLocalSessionHistoryLengthForTesting() const;
326 // Invokes OnSetFocus and marks the widget as active depending on the value
327 // of |enable|. This is used for layout tests that need to control the focus
328 // synchronously from the renderer.
329 void SetFocusAndActivateForTesting(bool enable);
331 // Change the device scale factor and force the compositor to resize.
332 void SetDeviceScaleFactorForTesting(float factor);
334 // Change the device ICC color profile while running a layout test.
335 void SetDeviceColorProfileForTesting(const std::vector<char>& color_profile);
337 // Used to force the size of a window when running layout tests.
338 void ForceResizeForTesting(const gfx::Size& new_size);
340 void UseSynchronousResizeModeForTesting(bool enable);
342 // Control autoresize mode.
343 void EnableAutoResizeForTesting(const gfx::Size& min_size,
344 const gfx::Size& max_size);
345 void DisableAutoResizeForTesting(const gfx::Size& new_size);
347 // IPC::Listener implementation ----------------------------------------------
349 virtual bool OnMessageReceived(const IPC::Message& msg) OVERRIDE;
351 // blink::WebWidgetClient implementation ------------------------------------
353 // Most methods are handled by RenderWidget.
354 virtual void didFocus();
355 virtual void didBlur();
356 virtual void show(blink::WebNavigationPolicy policy);
357 virtual void runModal();
358 virtual bool enterFullScreen();
359 virtual void exitFullScreen();
360 virtual bool requestPointerLock();
361 virtual void requestPointerUnlock();
362 virtual bool isPointerLocked();
363 virtual void didHandleGestureEvent(const blink::WebGestureEvent& event,
364 bool event_cancelled) OVERRIDE;
365 virtual void initializeLayerTreeView() OVERRIDE;
367 // blink::WebViewClient implementation --------------------------------------
369 virtual blink::WebView* createView(blink::WebLocalFrame* creator,
370 const blink::WebURLRequest& request,
371 const blink::WebWindowFeatures& features,
372 const blink::WebString& frame_name,
373 blink::WebNavigationPolicy policy,
374 bool suppress_opener);
375 virtual blink::WebWidget* createPopupMenu(blink::WebPopupType popup_type);
376 virtual blink::WebStorageNamespace* createSessionStorageNamespace();
377 virtual void printPage(blink::WebLocalFrame* frame);
378 virtual bool enumerateChosenDirectory(
379 const blink::WebString& path,
380 blink::WebFileChooserCompletion* chooser_completion);
381 virtual void didCancelCompositionOnSelectionChange();
382 virtual bool handleCurrentKeyboardEvent();
383 virtual bool runFileChooser(
384 const blink::WebFileChooserParams& params,
385 blink::WebFileChooserCompletion* chooser_completion);
386 virtual void showValidationMessage(const blink::WebRect& anchor_in_root_view,
387 const blink::WebString& main_text,
388 const blink::WebString& sub_text,
389 blink::WebTextDirection hint) OVERRIDE;
390 virtual void hideValidationMessage() OVERRIDE;
391 virtual void moveValidationMessage(
392 const blink::WebRect& anchor_in_root_view) OVERRIDE;
393 virtual void setStatusText(const blink::WebString& text);
394 virtual void setMouseOverURL(const blink::WebURL& url);
395 virtual void setKeyboardFocusURL(const blink::WebURL& url);
396 virtual void startDragging(blink::WebLocalFrame* frame,
397 const blink::WebDragData& data,
398 blink::WebDragOperationsMask mask,
399 const blink::WebImage& image,
400 const blink::WebPoint& imageOffset);
401 virtual bool acceptsLoadDrops();
402 virtual void focusNext();
403 virtual void focusPrevious();
404 virtual void focusedNodeChanged(const blink::WebNode& node);
405 virtual void didUpdateLayout();
406 #if defined(OS_ANDROID)
407 virtual bool didTapMultipleTargets(
408 const blink::WebGestureEvent& event,
409 const blink::WebVector<blink::WebRect>& target_rects);
410 #endif
411 virtual blink::WebString acceptLanguages();
412 virtual void navigateBackForwardSoon(int offset);
413 virtual int historyBackListCount();
414 virtual int historyForwardListCount();
415 virtual void postAccessibilityEvent(
416 const blink::WebAXObject& obj, blink::WebAXEvent event);
417 virtual blink::WebSpeechRecognizer* speechRecognizer();
418 virtual void zoomLimitsChanged(double minimum_level, double maximum_level);
419 virtual void zoomLevelChanged();
420 virtual double zoomLevelToZoomFactor(double zoom_level) const;
421 virtual double zoomFactorToZoomLevel(double factor) const;
423 // TODO(sanjoy.pal): Remove once blink patch lands. http://crbug.com/406236.
424 virtual void registerProtocolHandler(const blink::WebString& scheme,
425 const blink::WebURL& base_url,
426 const blink::WebURL& url,
427 const blink::WebString& title);
428 virtual void unregisterProtocolHandler(const blink::WebString& scheme,
429 const blink::WebURL& base_url,
430 const blink::WebURL& url);
431 virtual void registerProtocolHandler(const blink::WebString& scheme,
432 const blink::WebURL& url,
433 const blink::WebString& title);
434 virtual void unregisterProtocolHandler(const blink::WebString& scheme,
435 const blink::WebURL& url);
436 virtual blink::WebPageVisibilityState visibilityState() const;
437 virtual blink::WebPushClient* webPushClient();
438 virtual void draggableRegionsChanged();
440 #if defined(OS_ANDROID)
441 virtual void scheduleContentIntent(const blink::WebURL& intent);
442 virtual void cancelScheduledContentIntents();
443 virtual blink::WebContentDetectionResult detectContentAround(
444 const blink::WebHitTestResult& touch_hit);
446 // Only used on Android since all other platforms implement
447 // date and time input fields using MULTIPLE_FIELDS_UI
448 virtual bool openDateTimeChooser(const blink::WebDateTimeChooserParams&,
449 blink::WebDateTimeChooserCompletion*);
450 virtual void didScrollWithKeyboard(const blink::WebSize& delta);
451 #endif
453 // blink::WebPageSerializerClient implementation ----------------------------
455 virtual void didSerializeDataForFrame(
456 const blink::WebURL& frame_url,
457 const blink::WebCString& data,
458 PageSerializationStatus status) OVERRIDE;
460 // RenderView implementation -------------------------------------------------
462 virtual bool Send(IPC::Message* message) OVERRIDE;
463 virtual RenderFrame* GetMainRenderFrame() OVERRIDE;
464 virtual int GetRoutingID() const OVERRIDE;
465 virtual gfx::Size GetSize() const OVERRIDE;
466 virtual WebPreferences& GetWebkitPreferences() OVERRIDE;
467 virtual void SetWebkitPreferences(const WebPreferences& preferences) OVERRIDE;
468 virtual blink::WebView* GetWebView() OVERRIDE;
469 virtual blink::WebElement GetFocusedElement() const OVERRIDE;
470 virtual bool IsEditableNode(const blink::WebNode& node) const OVERRIDE;
471 virtual bool NodeContainsPoint(const blink::WebNode& node,
472 const gfx::Point& point) const OVERRIDE;
473 virtual bool ShouldDisplayScrollbars(int width, int height) const OVERRIDE;
474 virtual int GetEnabledBindings() const OVERRIDE;
475 virtual bool GetContentStateImmediately() const OVERRIDE;
476 virtual blink::WebPageVisibilityState GetVisibilityState() const OVERRIDE;
477 virtual void DidStartLoading() OVERRIDE;
478 virtual void DidStopLoading() OVERRIDE;
479 virtual void Repaint(const gfx::Size& size) OVERRIDE;
480 virtual void SetEditCommandForNextKeyEvent(const std::string& name,
481 const std::string& value) OVERRIDE;
482 virtual void ClearEditCommands() OVERRIDE;
483 virtual SSLStatus GetSSLStatusOfFrame(blink::WebFrame* frame) const OVERRIDE;
484 virtual const std::string& GetAcceptLanguages() const OVERRIDE;
485 #if defined(OS_ANDROID)
486 virtual void UpdateTopControlsState(TopControlsState constraints,
487 TopControlsState current,
488 bool animate) OVERRIDE;
489 #endif
490 bool uses_temporary_zoom_level() const { return uses_temporary_zoom_level_; }
492 // Please do not add your stuff randomly to the end here. If there is an
493 // appropriate section, add it there. If not, there are some random functions
494 // nearer to the top you can add it to.
496 // Cannot use std::set unfortunately since linked_ptr<> does not support
497 // operator<.
498 typedef std::vector<linked_ptr<ImageResourceFetcher> >
499 ImageResourceFetcherList;
501 protected:
502 // RenderWidget overrides:
503 virtual void OnClose() OVERRIDE;
504 virtual void Close() OVERRIDE;
505 virtual void OnResize(const ViewMsg_Resize_Params& params) OVERRIDE;
506 virtual void DidInitiatePaint() OVERRIDE;
507 virtual void DidFlushPaint() OVERRIDE;
508 virtual gfx::Vector2d GetScrollOffset() OVERRIDE;
509 virtual void DidHandleKeyEvent() OVERRIDE;
510 virtual bool WillHandleMouseEvent(
511 const blink::WebMouseEvent& event) OVERRIDE;
512 virtual bool WillHandleGestureEvent(
513 const blink::WebGestureEvent& event) OVERRIDE;
514 virtual void DidHandleMouseEvent(const blink::WebMouseEvent& event) OVERRIDE;
515 virtual void DidHandleTouchEvent(const blink::WebTouchEvent& event) OVERRIDE;
516 virtual bool HasTouchEventHandlersAt(const gfx::Point& point) const OVERRIDE;
517 virtual void OnSetFocus(bool enable) OVERRIDE;
518 virtual void OnWasHidden() OVERRIDE;
519 virtual void OnWasShown(bool needs_repainting,
520 const ui::LatencyInfo& latency_info) OVERRIDE;
521 virtual GURL GetURLForGraphicsContext3D() OVERRIDE;
522 virtual void OnImeSetComposition(
523 const base::string16& text,
524 const std::vector<blink::WebCompositionUnderline>& underlines,
525 int selection_start,
526 int selection_end) OVERRIDE;
527 virtual void OnImeConfirmComposition(const base::string16& text,
528 const gfx::Range& replacement_range,
529 bool keep_selection) OVERRIDE;
530 virtual void SetDeviceScaleFactor(float device_scale_factor) OVERRIDE;
531 virtual bool SetDeviceColorProfile(
532 const std::vector<char>& color_profile) OVERRIDE;
533 virtual void OnOrientationChange() OVERRIDE;
534 virtual ui::TextInputType GetTextInputType() OVERRIDE;
535 virtual void GetSelectionBounds(gfx::Rect* start, gfx::Rect* end) OVERRIDE;
536 #if defined(OS_MACOSX) || defined(USE_AURA)
537 virtual void GetCompositionCharacterBounds(
538 std::vector<gfx::Rect>* character_bounds) OVERRIDE;
539 virtual void GetCompositionRange(gfx::Range* range) OVERRIDE;
540 #endif
541 virtual bool CanComposeInline() OVERRIDE;
542 virtual void DidCommitCompositorFrame() OVERRIDE;
543 virtual void InstrumentWillBeginFrame(int frame_id) OVERRIDE;
544 virtual void InstrumentDidBeginFrame() OVERRIDE;
545 virtual void InstrumentDidCancelFrame() OVERRIDE;
546 virtual void InstrumentWillComposite() OVERRIDE;
548 protected:
549 explicit RenderViewImpl(RenderViewImplParams* params);
551 void Initialize(RenderViewImplParams* params);
552 virtual void SetScreenMetricsEmulationParameters(
553 float device_scale_factor,
554 const gfx::Point& root_layer_offset,
555 float root_layer_scale) OVERRIDE;
557 // Do not delete directly. This class is reference counted.
558 virtual ~RenderViewImpl();
560 private:
561 // For unit tests.
562 friend class PepperDeviceTest;
563 friend class RenderViewImplTest;
564 friend class RenderViewTest;
565 friend class RendererAccessibilityTest;
567 // TODO(nasko): Temporarily friend RenderFrameImpl, so we don't duplicate
568 // utility functions needed in both classes, while we move frame specific
569 // code away from this class.
570 friend class RenderFrameImpl;
572 FRIEND_TEST_ALL_PREFIXES(RenderViewImplTest, DecideNavigationPolicyForWebUI);
573 FRIEND_TEST_ALL_PREFIXES(RenderViewImplTest,
574 DidFailProvisionalLoadWithErrorForError);
575 FRIEND_TEST_ALL_PREFIXES(RenderViewImplTest,
576 DidFailProvisionalLoadWithErrorForCancellation);
577 FRIEND_TEST_ALL_PREFIXES(RenderViewImplTest,
578 DontIgnoreBackAfterNavEntryLimit);
579 FRIEND_TEST_ALL_PREFIXES(RenderViewImplTest, ImeComposition);
580 FRIEND_TEST_ALL_PREFIXES(RenderViewImplTest, InsertCharacters);
581 FRIEND_TEST_ALL_PREFIXES(RenderViewImplTest, JSBlockSentAfterPageLoad);
582 FRIEND_TEST_ALL_PREFIXES(RenderViewImplTest, LastCommittedUpdateState);
583 FRIEND_TEST_ALL_PREFIXES(RenderViewImplTest, OnHandleKeyboardEvent);
584 FRIEND_TEST_ALL_PREFIXES(RenderViewImplTest, OnImeTypeChanged);
585 FRIEND_TEST_ALL_PREFIXES(RenderViewImplTest, OnNavStateChanged);
586 FRIEND_TEST_ALL_PREFIXES(RenderViewImplTest, OnSetTextDirection);
587 FRIEND_TEST_ALL_PREFIXES(RenderViewImplTest, OnUpdateWebPreferences);
588 FRIEND_TEST_ALL_PREFIXES(RenderViewImplTest,
589 SetEditableSelectionAndComposition);
590 FRIEND_TEST_ALL_PREFIXES(RenderViewImplTest, StaleNavigationsIgnored);
591 FRIEND_TEST_ALL_PREFIXES(RenderViewImplTest, UpdateTargetURLWithInvalidURL);
592 FRIEND_TEST_ALL_PREFIXES(RenderViewImplTest,
593 GetCompositionCharacterBoundsTest);
594 FRIEND_TEST_ALL_PREFIXES(RenderViewImplTest, OnNavigationHttpPost);
595 FRIEND_TEST_ALL_PREFIXES(RenderViewImplTest,
596 DecideNavigationPolicyHandlesAllTopLevel);
597 #if defined(OS_MACOSX)
598 FRIEND_TEST_ALL_PREFIXES(RenderViewTest, MacTestCmdUp);
599 #endif
600 FRIEND_TEST_ALL_PREFIXES(RenderViewImplTest, SetHistoryLengthAndPrune);
601 FRIEND_TEST_ALL_PREFIXES(RenderViewImplTest, ZoomLimit);
602 FRIEND_TEST_ALL_PREFIXES(RenderViewImplTest, NavigateFrame);
603 FRIEND_TEST_ALL_PREFIXES(RenderViewImplTest, BasicRenderFrame);
604 FRIEND_TEST_ALL_PREFIXES(RenderViewImplTest, TextInputTypeWithPepper);
605 FRIEND_TEST_ALL_PREFIXES(RenderViewImplTest,
606 MessageOrderInDidChangeSelection);
607 FRIEND_TEST_ALL_PREFIXES(RenderViewImplTest, SendCandidateWindowEvents);
608 FRIEND_TEST_ALL_PREFIXES(SuppressErrorPageTest, Suppresses);
609 FRIEND_TEST_ALL_PREFIXES(SuppressErrorPageTest, DoesNotSuppress);
611 typedef std::map<GURL, double> HostZoomLevels;
613 enum ErrorPageType {
614 DNS_ERROR,
615 HTTP_404,
616 CONNECTION_ERROR,
619 // Old WebFrameClient implementations ----------------------------------------
621 // RenderViewImpl used to be a WebFrameClient, but now RenderFrameImpl is the
622 // WebFrameClient. However, many implementations of WebFrameClient methods
623 // still live here and are called from RenderFrameImpl. These implementations
624 // are to be moved to RenderFrameImpl <http://crbug.com/361761>.
626 void didCreateDataSource(blink::WebLocalFrame* frame,
627 blink::WebDataSource* datasource);
628 void didClearWindowObject(blink::WebLocalFrame* frame);
629 void didChangeIcon(blink::WebLocalFrame*, blink::WebIconURL::Type);
630 void didUpdateCurrentHistoryItem(blink::WebLocalFrame* frame);
631 void didChangeScrollOffset(blink::WebLocalFrame* frame);
633 static bool IsReload(const FrameMsg_Navigate_Params& params);
635 static Referrer GetReferrerFromRequest(
636 blink::WebFrame* frame,
637 const blink::WebURLRequest& request);
639 static WindowOpenDisposition NavigationPolicyToDisposition(
640 blink::WebNavigationPolicy policy);
642 void UpdateSessionHistory(blink::WebFrame* frame);
643 void SendUpdateState(HistoryEntry* entry);
645 // Sends a message and runs a nested message loop.
646 bool SendAndRunNestedMessageLoop(IPC::SyncMessage* message);
648 // IPC message handlers ------------------------------------------------------
650 // The documentation for these functions should be in
651 // content/common/*_messages.h for the message that the function is handling.
652 void OnExecuteEditCommand(const std::string& name, const std::string& value);
653 void OnMoveCaret(const gfx::Point& point);
654 void OnScrollFocusedEditableNodeIntoRect(const gfx::Rect& rect);
655 void OnSetEditCommandsForNextKeyEvent(const EditCommands& edit_commands);
656 void OnAllowBindings(int enabled_bindings_flags);
657 void OnAllowScriptToClose(bool script_can_close);
658 void OnCancelDownload(int32 download_id);
659 void OnClearFocusedElement();
660 void OnClosePage();
661 void OnShowContextMenu(ui::MenuSourceType source_type,
662 const gfx::Point& location);
663 void OnCopyImageAt(int x, int y);
664 void OnSaveImageAt(int x, int y);
665 void OnDeterminePageLanguage();
666 void OnDisableScrollbarsForSmallWindows(
667 const gfx::Size& disable_scrollbars_size_limit);
668 void OnDragSourceEnded(const gfx::Point& client_point,
669 const gfx::Point& screen_point,
670 blink::WebDragOperation drag_operation);
671 void OnDragSourceSystemDragEnded();
672 void OnDragTargetDrop(const gfx::Point& client_pt,
673 const gfx::Point& screen_pt,
674 int key_modifiers);
675 void OnDragTargetDragEnter(const DropData& drop_data,
676 const gfx::Point& client_pt,
677 const gfx::Point& screen_pt,
678 blink::WebDragOperationsMask operations_allowed,
679 int key_modifiers);
680 void OnDragTargetDragLeave();
681 void OnDragTargetDragOver(const gfx::Point& client_pt,
682 const gfx::Point& screen_pt,
683 blink::WebDragOperationsMask operations_allowed,
684 int key_modifiers);
685 void OnEnablePreferredSizeChangedMode();
686 void OnEnableAutoResize(const gfx::Size& min_size, const gfx::Size& max_size);
687 void OnDisableAutoResize(const gfx::Size& new_size);
688 void OnEnumerateDirectoryResponse(int id,
689 const std::vector<base::FilePath>& paths);
690 void OnFileChooserResponse(
691 const std::vector<ui::SelectedFileInfo>& files);
692 void OnFind(int request_id,
693 const base::string16&,
694 const blink::WebFindOptions&);
695 void OnGetAllSavableResourceLinksForCurrentPage(const GURL& page_url);
696 void OnGetSerializedHtmlDataForCurrentPageWithLocalLinks(
697 const std::vector<GURL>& links,
698 const std::vector<base::FilePath>& local_paths,
699 const base::FilePath& local_directory_name);
700 void OnMediaPlayerActionAt(const gfx::Point& location,
701 const blink::WebMediaPlayerAction& action);
702 void OnPluginActionAt(const gfx::Point& location,
703 const blink::WebPluginAction& action);
704 void OnMoveOrResizeStarted();
705 void OnPostMessageEvent(const ViewMsg_PostMessage_Params& params);
706 void OnReleaseDisambiguationPopupBitmap(const cc::SharedBitmapId& id);
707 void OnResetPageEncodingToDefault();
708 void OnSetActive(bool active);
709 void OnSetBackgroundOpaque(bool opaque);
710 void OnExitFullscreen();
711 void OnSetHistoryLengthAndPrune(int history_length, int32 minimum_page_id);
712 void OnSetInitialFocus(bool reverse);
713 void OnSetPageEncoding(const std::string& encoding_name);
714 void OnSetRendererPrefs(const RendererPreferences& renderer_prefs);
715 void OnSetWebUIProperty(const std::string& name, const std::string& value);
716 void OnSetZoomLevelForLoadingURL(const GURL& url, double zoom_level);
717 void OnSetZoomLevelForView(bool uses_temporary_zoom_level, double level);
718 void OnStop();
719 void OnStopFinding(StopFindAction action);
720 void OnSuppressDialogsUntilSwapOut();
721 void OnThemeChanged();
722 void OnUpdateTargetURLAck();
723 void OnUpdateWebPreferences(const WebPreferences& prefs);
724 void OnZoom(PageZoom zoom);
725 void OnEnableViewSourceMode();
726 void OnWindowSnapshotCompleted(const int snapshot_id,
727 const gfx::Size& size, const std::vector<unsigned char>& png);
728 void OnForceRedraw(int request_id);
729 void OnSelectWordAroundCaret();
730 #if defined(OS_ANDROID)
731 void OnActivateNearestFindResult(int request_id, float x, float y);
732 void OnFindMatchRects(int current_version);
733 void OnUndoScrollFocusedEditableNodeIntoRect();
734 void OnUpdateTopControlsState(bool enable_hiding,
735 bool enable_showing,
736 bool animate);
737 void OnExtractSmartClipData(const gfx::Rect& rect);
738 #elif defined(OS_MACOSX)
739 void OnGetRenderedText();
740 void OnPluginImeCompositionCompleted(const base::string16& text,
741 int plugin_id);
742 void OnSetInLiveResize(bool in_live_resize);
743 void OnSetWindowVisibility(bool visible);
744 void OnWindowFrameChanged(const gfx::Rect& window_frame,
745 const gfx::Rect& view_frame);
746 #endif
748 // Adding a new message handler? Please add it in alphabetical order above
749 // and put it in the same position in the .cc file.
751 // Misc private functions ----------------------------------------------------
752 // Check whether the preferred size has changed.
753 void CheckPreferredSize();
755 // This callback is triggered when DownloadFavicon completes, either
756 // succesfully or with a failure. See DownloadFavicon for more
757 // details.
758 void DidDownloadFavicon(ImageResourceFetcher* fetcher,
759 const SkBitmap& image);
761 // Requests to download a favicon image. When done, the RenderView is notified
762 // by way of DidDownloadFavicon. Returns true if the request was successfully
763 // started, false otherwise. id is used to uniquely identify the request and
764 // passed back to the DidDownloadFavicon method. If the image has multiple
765 // frames, the frame whose size is image_size is returned. If the image
766 // doesn't have a frame at the specified size, the first is returned.
767 bool DownloadFavicon(int id, const GURL& image_url, int image_size);
769 // Called to get the WebPlugin to handle find requests in the document.
770 // Returns NULL if there is no such WebPlugin.
771 blink::WebPlugin* GetWebPluginForFind();
773 // Returns true if the |params| navigation is to an entry that has been
774 // cropped due to a recent navigation the browser did not know about.
775 bool IsBackForwardToStaleEntry(const FrameMsg_Navigate_Params& params,
776 bool is_reload);
778 // Make the given |frame| show an empty, unscriptable page.
779 // TODO(creis): Move this to RenderFrame.
780 void NavigateToSwappedOutURL(blink::WebFrame* frame);
782 // If we initiated a navigation, this function will populate |document_state|
783 // with the navigation information saved in OnNavigate().
784 void PopulateDocumentStateFromPending(DocumentState* document_state);
786 // Returns a new NavigationState populated with the navigation information
787 // saved in OnNavigate().
788 NavigationState* CreateNavigationStateFromPending();
790 // Processes the command-line flags --enable-viewport,
791 // --enable-fixed-layout[=w,h] and --enable-pinch.
792 void ProcessViewLayoutFlags(const base::CommandLine& command_line);
794 #if defined(OS_ANDROID)
795 // Launch an Android content intent with the given URL.
796 void LaunchAndroidContentIntent(const GURL& intent_url, size_t request_id);
797 #endif
799 // Sends a reply to the current find operation handling if it was a
800 // synchronous find request.
801 void SendFindReply(int request_id,
802 int match_count,
803 int ordinal,
804 const blink::WebRect& selection_rect,
805 bool final_status_update);
807 // Starts nav_state_sync_timer_ if it isn't already running.
808 void StartNavStateSyncTimerIfNecessary();
810 #if defined(OS_POSIX) && !defined(OS_MACOSX)
811 void UpdateFontRenderingFromRendererPrefs();
812 #else
813 void UpdateFontRenderingFromRendererPrefs() {}
814 #endif
816 // Update the target url and tell the browser that the target URL has changed.
817 // If |url| is empty, show |fallback_url|.
818 void UpdateTargetURL(const GURL& url, const GURL& fallback_url);
820 // Tells the browser what the new list of favicons for the webpage is.
821 void SendUpdateFaviconURL(const std::vector<FaviconURL>& urls);
823 // Invoked from DidStopLoading(). Sends the current list of loaded favicons to
824 // the browser.
825 void DidStopLoadingIcons();
827 // Coordinate conversion -----------------------------------------------------
829 gfx::RectF ClientRectToPhysicalWindowRect(const gfx::RectF& rect) const;
831 // RenderFrameImpl accessible state ------------------------------------------
832 // The following section is the set of methods that RenderFrameImpl needs
833 // to access RenderViewImpl state. The set of state variables are page-level
834 // specific, so they don't belong in RenderFrameImpl and should remain in
835 // this object.
836 ObserverList<RenderViewObserver>& observers() {
837 return observers_;
840 // TODO(nasko): Remove this method when we move to frame proxy objects, since
841 // the concept of swapped out will be eliminated.
842 void set_is_swapped_out(bool swapped_out) {
843 is_swapped_out_ = swapped_out;
846 NavigationGesture navigation_gesture() {
847 return navigation_gesture_;
849 void set_navigation_gesture(NavigationGesture gesture) {
850 navigation_gesture_ = gesture;
853 // ---------------------------------------------------------------------------
854 // ADDING NEW FUNCTIONS? Please keep private functions alphabetized and put
855 // it in the same order in the .cc file as it was in the header.
856 // ---------------------------------------------------------------------------
858 // Settings ------------------------------------------------------------------
860 WebPreferences webkit_preferences_;
861 RendererPreferences renderer_preferences_;
863 HostZoomLevels host_zoom_levels_;
865 // Whether content state (such as form state, scroll position and page
866 // contents) should be sent to the browser immediately. This is normally
867 // false, but set to true by some tests.
868 bool send_content_state_immediately_;
870 // Bitwise-ORed set of extra bindings that have been enabled. See
871 // BindingsPolicy for details.
872 int enabled_bindings_;
874 // If true, we send IPC messages when |preferred_size_| changes.
875 bool send_preferred_size_changes_;
877 // If non-empty, and |send_preferred_size_changes_| is true, disable drawing
878 // scroll bars on windows smaller than this size. Used for windows that the
879 // browser resizes to the size of the content, such as browser action popups.
880 // If a render view is set to the minimum size of its content, webkit may add
881 // scroll bars. This makes sense for fixed sized windows, but it does not
882 // make sense when the size of the view was chosen to fit the content.
883 // This setting ensures that no scroll bars are drawn. The size limit exists
884 // because if the view grows beyond a size known to the browser, scroll bars
885 // should be drawn.
886 gfx::Size disable_scrollbars_size_limit_;
888 // Loading state -------------------------------------------------------------
890 // The gesture that initiated the current navigation.
891 // TODO(nasko): Move to RenderFrame, as this is per-frame state.
892 NavigationGesture navigation_gesture_;
894 // Used for popups.
895 bool opened_by_user_gesture_;
897 // Whether this RenderView was created by a frame that was suppressing its
898 // opener. If so, we may want to load pages in a separate process. See
899 // decidePolicyForNavigation for details.
900 bool opener_suppressed_;
902 // Whether we must stop creating nested message loops for modal dialogs until
903 // OnSwapOut is called. This is necessary because modal dialogs have a
904 // PageGroupLoadDeferrer on the stack that interferes with swapping out.
905 bool suppress_dialogs_until_swap_out_;
907 // Holds state pertaining to a navigation that we initiated. This is held by
908 // the WebDataSource::ExtraData attribute. We use pending_navigation_state_
909 // as a temporary holder for the state until the WebDataSource corresponding
910 // to the new navigation is created. See DidCreateDataSource.
911 // TODO(nasko): Move to RenderFrame, as this is per-frame state.
912 scoped_ptr<FrameMsg_Navigate_Params> pending_navigation_params_;
914 // Timer used to delay the updating of nav state (see SyncNavigationState).
915 base::OneShotTimer<RenderViewImpl> nav_state_sync_timer_;
917 // Page IDs ------------------------------------------------------------------
918 // See documentation in RenderView.
919 int32 page_id_;
921 // Indicates the ID of the last page that we sent a FrameNavigate to the
922 // browser for. This is used to determine if the most recent transition
923 // generated a history entry (less than page_id_), or not (equal to or
924 // greater than). Note that this will be greater than page_id_ if the user
925 // goes back.
926 int32 last_page_id_sent_to_browser_;
928 // The next available page ID to use for this RenderView. These IDs are
929 // specific to a given RenderView and the frames within it.
930 int32 next_page_id_;
932 // The offset of the current item in the history list.
933 int history_list_offset_;
935 // The RenderView's current impression of the history length. This includes
936 // any items that have committed in this process, but because of cross-process
937 // navigations, the history may have some entries that were committed in other
938 // processes. We won't know about them until the next navigation in this
939 // process.
940 int history_list_length_;
942 // Counter to track how many frames have sent start notifications but not stop
943 // notifications. TODO(avi): Remove this once DidStartLoading/DidStopLoading
944 // are gone.
945 int frames_in_progress_;
947 // The list of page IDs for each history item this RenderView knows about.
948 // Some entries may be -1 if they were rendered by other processes or were
949 // restored from a previous session. This lets us detect attempts to
950 // navigate to stale entries that have been cropped from our history.
951 std::vector<int32> history_page_ids_;
953 // UI state ------------------------------------------------------------------
955 // The state of our target_url transmissions. When we receive a request to
956 // send a URL to the browser, we set this to TARGET_INFLIGHT until an ACK
957 // comes back - if a new request comes in before the ACK, we store the new
958 // URL in pending_target_url_ and set the status to TARGET_PENDING. If an
959 // ACK comes back and we are in TARGET_PENDING, we send the stored URL and
960 // revert to TARGET_INFLIGHT.
962 // We don't need a queue of URLs to send, as only the latest is useful.
963 enum {
964 TARGET_NONE,
965 TARGET_INFLIGHT, // We have a request in-flight, waiting for an ACK
966 TARGET_PENDING // INFLIGHT + we have a URL waiting to be sent
967 } target_url_status_;
969 // The URL we show the user in the status bar. We use this to determine if we
970 // want to send a new one (we do not need to send duplicates). It will be
971 // equal to either |mouse_over_url_| or |focus_url_|, depending on which was
972 // updated last.
973 GURL target_url_;
975 // The URL the user's mouse is hovering over.
976 GURL mouse_over_url_;
978 // The URL that has keyboard focus.
979 GURL focus_url_;
981 // The next target URL we want to send to the browser.
982 GURL pending_target_url_;
984 // Indicates whether this view overrides url-based zoom settings.
985 bool uses_temporary_zoom_level_;
987 #if defined(OS_ANDROID)
988 // Cache the old top controls state constraints. Used when updating
989 // current value only without altering the constraints.
990 cc::TopControlsState top_controls_constraints_;
991 #endif
993 // View ----------------------------------------------------------------------
995 // Cache the preferred size of the page in order to prevent sending the IPC
996 // when layout() recomputes but doesn't actually change sizes.
997 gfx::Size preferred_size_;
999 // Used to delay determining the preferred size (to avoid intermediate
1000 // states for the sizes).
1001 base::OneShotTimer<RenderViewImpl> check_preferred_size_timer_;
1003 // Bookkeeping to suppress redundant scroll and focus requests for an already
1004 // scrolled and focused editable node.
1005 bool has_scrolled_focused_editable_node_into_rect_;
1006 gfx::Rect rect_for_scrolled_focused_editable_node_;
1008 // Helper objects ------------------------------------------------------------
1010 scoped_ptr<RenderFrameImpl> main_render_frame_;
1012 // The next group of objects all implement RenderViewObserver, so are deleted
1013 // along with the RenderView automatically. This is why we just store
1014 // weak references.
1016 // The speech recognition dispatcher attached to this view, lazily
1017 // initialized.
1018 SpeechRecognitionDispatcher* speech_recognition_dispatcher_;
1020 // BrowserPluginManager attached to this view; lazily initialized.
1021 scoped_refptr<BrowserPluginManager> browser_plugin_manager_;
1023 DevToolsAgent* devtools_agent_;
1025 // Mouse Lock dispatcher attached to this view.
1026 MouseLockDispatcher* mouse_lock_dispatcher_;
1028 scoped_ptr<HistoryController> history_controller_;
1030 #if defined(OS_ANDROID)
1031 // Android Specific ---------------------------------------------------------
1033 // Expected id of the next content intent launched. Used to prevent scheduled
1034 // intents to be launched if aborted.
1035 size_t expected_content_intent_id_;
1037 // List of click-based content detectors.
1038 typedef std::vector< linked_ptr<ContentDetector> > ContentDetectorList;
1039 ContentDetectorList content_detectors_;
1041 // A date/time picker object for date and time related input elements.
1042 scoped_ptr<RendererDateTimePicker> date_time_picker_client_;
1043 #endif
1045 // Plugins -------------------------------------------------------------------
1047 // All the currently active plugin delegates for this RenderView; kept so
1048 // that we can enumerate them to send updates about things like window
1049 // location or tab focus and visibily. These are non-owning references.
1050 std::set<WebPluginDelegateProxy*> plugin_delegates_;
1052 #if defined(OS_WIN)
1053 // The ID of the focused NPAPI plug-in.
1054 int focused_plugin_id_;
1055 #endif
1057 #if defined(ENABLE_PLUGINS)
1058 PepperPluginInstanceImpl* plugin_find_handler_;
1060 typedef std::set<PepperPluginInstanceImpl*> PepperPluginSet;
1061 PepperPluginSet active_pepper_instances_;
1063 // TODO(jam): these belong on RenderFrame, once the browser knows which frame
1064 // is focused and sends the IPCs which use these to the correct frame. Until
1065 // then, we must store these on RenderView as that's the one place that knows
1066 // about all the RenderFrames for a page.
1068 // Whether or not the focus is on a PPAPI plugin
1069 PepperPluginInstanceImpl* focused_pepper_plugin_;
1071 // The plugin instance that received the last mouse event. It is set to NULL
1072 // if the last mouse event went to elements other than Pepper plugins.
1073 // |pepper_last_mouse_event_target_| is not owned by this class. We depend on
1074 // the RenderFrameImpl to NULL it out when it destructs.
1075 PepperPluginInstanceImpl* pepper_last_mouse_event_target_;
1076 #endif
1078 // Misc ----------------------------------------------------------------------
1080 // The current and pending file chooser completion objects. If the queue is
1081 // nonempty, the first item represents the currently running file chooser
1082 // callback, and the remaining elements are the other file chooser completion
1083 // still waiting to be run (in order).
1084 struct PendingFileChooser;
1085 std::deque< linked_ptr<PendingFileChooser> > file_chooser_completions_;
1087 // The current directory enumeration callback
1088 std::map<int, blink::WebFileChooserCompletion*> enumeration_completions_;
1089 int enumeration_completion_id_;
1091 // The SessionStorage namespace that we're assigned to has an ID, and that ID
1092 // is passed to us upon creation. WebKit asks for this ID upon first use and
1093 // uses it whenever asking the browser process to allocate new storage areas.
1094 int64 session_storage_namespace_id_;
1096 // Stores edit commands associated to the next key event.
1097 // Shall be cleared as soon as the next key event is processed.
1098 EditCommands edit_commands_;
1100 // All the registered observers. We expect this list to be small, so vector
1101 // is fine.
1102 ObserverList<RenderViewObserver> observers_;
1104 // Wraps the |webwidget_| as a MouseLockDispatcher::LockTarget interface.
1105 scoped_ptr<MouseLockDispatcher::LockTarget> webwidget_mouse_lock_target_;
1107 // State associated with the GetWindowSnapshot function.
1108 int next_snapshot_id_;
1109 typedef std::map<int, WindowSnapshotCallback> PendingSnapshotMap;
1110 PendingSnapshotMap pending_snapshots_;
1112 // This field stores drag/drop related info for the event that is currently
1113 // being handled. If the current event results in starting a drag/drop
1114 // session, this info is sent to the browser along with other drag/drop info.
1115 DragEventSourceInfo possible_drag_event_info_;
1117 // NOTE: stats_collection_observer_ should be the last members because their
1118 // constructors call the AddObservers method of RenderViewImpl.
1119 scoped_ptr<StatsCollectionObserver> stats_collection_observer_;
1121 typedef std::map<cc::SharedBitmapId, cc::SharedBitmap*> BitmapMap;
1122 BitmapMap disambiguation_bitmaps_;
1124 // ---------------------------------------------------------------------------
1125 // ADDING NEW DATA? Please see if it fits appropriately in one of the above
1126 // sections rather than throwing it randomly at the end. If you're adding a
1127 // bunch of stuff, you should probably create a helper class and put your
1128 // data and methods on that to avoid bloating RenderView more. You can
1129 // use the Observer interface to filter IPC messages and receive frame change
1130 // notifications.
1131 // ---------------------------------------------------------------------------
1133 DISALLOW_COPY_AND_ASSIGN(RenderViewImpl);
1136 } // namespace content
1138 #endif // CONTENT_RENDERER_RENDER_VIEW_IMPL_H_