Update linux-release/sizes/chrome-data expectations.
[chromium-blink-merge.git] / content / renderer / render_view_impl.h
blobcd6ba6d20974bdb7d985891afed5a6a1e03bffe9
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 OnStopFinding(StopFindAction action);
719 void OnSuppressDialogsUntilSwapOut();
720 void OnThemeChanged();
721 void OnUpdateTargetURLAck();
722 void OnUpdateWebPreferences(const WebPreferences& prefs);
723 void OnZoom(PageZoom zoom);
724 void OnEnableViewSourceMode();
725 void OnWindowSnapshotCompleted(const int snapshot_id,
726 const gfx::Size& size, const std::vector<unsigned char>& png);
727 void OnForceRedraw(int request_id);
728 void OnSelectWordAroundCaret();
729 #if defined(OS_ANDROID)
730 void OnActivateNearestFindResult(int request_id, float x, float y);
731 void OnFindMatchRects(int current_version);
732 void OnUndoScrollFocusedEditableNodeIntoRect();
733 void OnUpdateTopControlsState(bool enable_hiding,
734 bool enable_showing,
735 bool animate);
736 void OnExtractSmartClipData(const gfx::Rect& rect);
737 #elif defined(OS_MACOSX)
738 void OnGetRenderedText();
739 void OnPluginImeCompositionCompleted(const base::string16& text,
740 int plugin_id);
741 void OnSetInLiveResize(bool in_live_resize);
742 void OnSetWindowVisibility(bool visible);
743 void OnWindowFrameChanged(const gfx::Rect& window_frame,
744 const gfx::Rect& view_frame);
745 #endif
747 // Adding a new message handler? Please add it in alphabetical order above
748 // and put it in the same position in the .cc file.
750 // Misc private functions ----------------------------------------------------
751 // Check whether the preferred size has changed.
752 void CheckPreferredSize();
754 // This callback is triggered when DownloadFavicon completes, either
755 // succesfully or with a failure. See DownloadFavicon for more
756 // details.
757 void DidDownloadFavicon(ImageResourceFetcher* fetcher,
758 const SkBitmap& image);
760 // Requests to download a favicon image. When done, the RenderView is notified
761 // by way of DidDownloadFavicon. Returns true if the request was successfully
762 // started, false otherwise. id is used to uniquely identify the request and
763 // passed back to the DidDownloadFavicon method. If the image has multiple
764 // frames, the frame whose size is image_size is returned. If the image
765 // doesn't have a frame at the specified size, the first is returned.
766 bool DownloadFavicon(int id, const GURL& image_url, int image_size);
768 // Called to get the WebPlugin to handle find requests in the document.
769 // Returns NULL if there is no such WebPlugin.
770 blink::WebPlugin* GetWebPluginForFind();
772 // Returns true if the |params| navigation is to an entry that has been
773 // cropped due to a recent navigation the browser did not know about.
774 bool IsBackForwardToStaleEntry(const FrameMsg_Navigate_Params& params,
775 bool is_reload);
777 // Make the given |frame| show an empty, unscriptable page.
778 // TODO(creis): Move this to RenderFrame.
779 void NavigateToSwappedOutURL(blink::WebFrame* frame);
781 // If we initiated a navigation, this function will populate |document_state|
782 // with the navigation information saved in OnNavigate().
783 void PopulateDocumentStateFromPending(DocumentState* document_state);
785 // Returns a new NavigationState populated with the navigation information
786 // saved in OnNavigate().
787 NavigationState* CreateNavigationStateFromPending();
789 // Processes the command-line flags --enable-viewport,
790 // --enable-fixed-layout[=w,h] and --enable-pinch.
791 void ProcessViewLayoutFlags(const base::CommandLine& command_line);
793 #if defined(OS_ANDROID)
794 // Launch an Android content intent with the given URL.
795 void LaunchAndroidContentIntent(const GURL& intent_url, size_t request_id);
796 #endif
798 // Sends a reply to the current find operation handling if it was a
799 // synchronous find request.
800 void SendFindReply(int request_id,
801 int match_count,
802 int ordinal,
803 const blink::WebRect& selection_rect,
804 bool final_status_update);
806 // Starts nav_state_sync_timer_ if it isn't already running.
807 void StartNavStateSyncTimerIfNecessary();
809 #if defined(OS_POSIX) && !defined(OS_MACOSX)
810 void UpdateFontRenderingFromRendererPrefs();
811 #else
812 void UpdateFontRenderingFromRendererPrefs() {}
813 #endif
815 // Update the target url and tell the browser that the target URL has changed.
816 // If |url| is empty, show |fallback_url|.
817 void UpdateTargetURL(const GURL& url, const GURL& fallback_url);
819 // Tells the browser what the new list of favicons for the webpage is.
820 void SendUpdateFaviconURL(const std::vector<FaviconURL>& urls);
822 // Invoked from DidStopLoading(). Sends the current list of loaded favicons to
823 // the browser.
824 void DidStopLoadingIcons();
826 // Coordinate conversion -----------------------------------------------------
828 gfx::RectF ClientRectToPhysicalWindowRect(const gfx::RectF& rect) const;
830 // RenderFrameImpl accessible state ------------------------------------------
831 // The following section is the set of methods that RenderFrameImpl needs
832 // to access RenderViewImpl state. The set of state variables are page-level
833 // specific, so they don't belong in RenderFrameImpl and should remain in
834 // this object.
835 ObserverList<RenderViewObserver>& observers() {
836 return observers_;
839 // TODO(nasko): Remove this method when we move to frame proxy objects, since
840 // the concept of swapped out will be eliminated.
841 void set_is_swapped_out(bool swapped_out) {
842 is_swapped_out_ = swapped_out;
845 NavigationGesture navigation_gesture() {
846 return navigation_gesture_;
848 void set_navigation_gesture(NavigationGesture gesture) {
849 navigation_gesture_ = gesture;
852 // ---------------------------------------------------------------------------
853 // ADDING NEW FUNCTIONS? Please keep private functions alphabetized and put
854 // it in the same order in the .cc file as it was in the header.
855 // ---------------------------------------------------------------------------
857 // Settings ------------------------------------------------------------------
859 WebPreferences webkit_preferences_;
860 RendererPreferences renderer_preferences_;
862 HostZoomLevels host_zoom_levels_;
864 // Whether content state (such as form state, scroll position and page
865 // contents) should be sent to the browser immediately. This is normally
866 // false, but set to true by some tests.
867 bool send_content_state_immediately_;
869 // Bitwise-ORed set of extra bindings that have been enabled. See
870 // BindingsPolicy for details.
871 int enabled_bindings_;
873 // If true, we send IPC messages when |preferred_size_| changes.
874 bool send_preferred_size_changes_;
876 // If non-empty, and |send_preferred_size_changes_| is true, disable drawing
877 // scroll bars on windows smaller than this size. Used for windows that the
878 // browser resizes to the size of the content, such as browser action popups.
879 // If a render view is set to the minimum size of its content, webkit may add
880 // scroll bars. This makes sense for fixed sized windows, but it does not
881 // make sense when the size of the view was chosen to fit the content.
882 // This setting ensures that no scroll bars are drawn. The size limit exists
883 // because if the view grows beyond a size known to the browser, scroll bars
884 // should be drawn.
885 gfx::Size disable_scrollbars_size_limit_;
887 // Loading state -------------------------------------------------------------
889 // The gesture that initiated the current navigation.
890 // TODO(nasko): Move to RenderFrame, as this is per-frame state.
891 NavigationGesture navigation_gesture_;
893 // Used for popups.
894 bool opened_by_user_gesture_;
896 // Whether this RenderView was created by a frame that was suppressing its
897 // opener. If so, we may want to load pages in a separate process. See
898 // decidePolicyForNavigation for details.
899 bool opener_suppressed_;
901 // Whether we must stop creating nested message loops for modal dialogs until
902 // OnSwapOut is called. This is necessary because modal dialogs have a
903 // PageGroupLoadDeferrer on the stack that interferes with swapping out.
904 bool suppress_dialogs_until_swap_out_;
906 // Holds state pertaining to a navigation that we initiated. This is held by
907 // the WebDataSource::ExtraData attribute. We use pending_navigation_state_
908 // as a temporary holder for the state until the WebDataSource corresponding
909 // to the new navigation is created. See DidCreateDataSource.
910 // TODO(nasko): Move to RenderFrame, as this is per-frame state.
911 scoped_ptr<FrameMsg_Navigate_Params> pending_navigation_params_;
913 // Timer used to delay the updating of nav state (see SyncNavigationState).
914 base::OneShotTimer<RenderViewImpl> nav_state_sync_timer_;
916 // Page IDs ------------------------------------------------------------------
917 // See documentation in RenderView.
918 int32 page_id_;
920 // Indicates the ID of the last page that we sent a FrameNavigate to the
921 // browser for. This is used to determine if the most recent transition
922 // generated a history entry (less than page_id_), or not (equal to or
923 // greater than). Note that this will be greater than page_id_ if the user
924 // goes back.
925 int32 last_page_id_sent_to_browser_;
927 // The next available page ID to use for this RenderView. These IDs are
928 // specific to a given RenderView and the frames within it.
929 int32 next_page_id_;
931 // The offset of the current item in the history list.
932 int history_list_offset_;
934 // The RenderView's current impression of the history length. This includes
935 // any items that have committed in this process, but because of cross-process
936 // navigations, the history may have some entries that were committed in other
937 // processes. We won't know about them until the next navigation in this
938 // process.
939 int history_list_length_;
941 // Counter to track how many frames have sent start notifications but not stop
942 // notifications. TODO(avi): Remove this once DidStartLoading/DidStopLoading
943 // are gone.
944 int frames_in_progress_;
946 // The list of page IDs for each history item this RenderView knows about.
947 // Some entries may be -1 if they were rendered by other processes or were
948 // restored from a previous session. This lets us detect attempts to
949 // navigate to stale entries that have been cropped from our history.
950 std::vector<int32> history_page_ids_;
952 // UI state ------------------------------------------------------------------
954 // The state of our target_url transmissions. When we receive a request to
955 // send a URL to the browser, we set this to TARGET_INFLIGHT until an ACK
956 // comes back - if a new request comes in before the ACK, we store the new
957 // URL in pending_target_url_ and set the status to TARGET_PENDING. If an
958 // ACK comes back and we are in TARGET_PENDING, we send the stored URL and
959 // revert to TARGET_INFLIGHT.
961 // We don't need a queue of URLs to send, as only the latest is useful.
962 enum {
963 TARGET_NONE,
964 TARGET_INFLIGHT, // We have a request in-flight, waiting for an ACK
965 TARGET_PENDING // INFLIGHT + we have a URL waiting to be sent
966 } target_url_status_;
968 // The URL we show the user in the status bar. We use this to determine if we
969 // want to send a new one (we do not need to send duplicates). It will be
970 // equal to either |mouse_over_url_| or |focus_url_|, depending on which was
971 // updated last.
972 GURL target_url_;
974 // The URL the user's mouse is hovering over.
975 GURL mouse_over_url_;
977 // The URL that has keyboard focus.
978 GURL focus_url_;
980 // The next target URL we want to send to the browser.
981 GURL pending_target_url_;
983 // Indicates whether this view overrides url-based zoom settings.
984 bool uses_temporary_zoom_level_;
986 #if defined(OS_ANDROID)
987 // Cache the old top controls state constraints. Used when updating
988 // current value only without altering the constraints.
989 cc::TopControlsState top_controls_constraints_;
990 #endif
992 // View ----------------------------------------------------------------------
994 // Cache the preferred size of the page in order to prevent sending the IPC
995 // when layout() recomputes but doesn't actually change sizes.
996 gfx::Size preferred_size_;
998 // Used to delay determining the preferred size (to avoid intermediate
999 // states for the sizes).
1000 base::OneShotTimer<RenderViewImpl> check_preferred_size_timer_;
1002 // Bookkeeping to suppress redundant scroll and focus requests for an already
1003 // scrolled and focused editable node.
1004 bool has_scrolled_focused_editable_node_into_rect_;
1005 gfx::Rect rect_for_scrolled_focused_editable_node_;
1007 // Helper objects ------------------------------------------------------------
1009 scoped_ptr<RenderFrameImpl> main_render_frame_;
1011 // The next group of objects all implement RenderViewObserver, so are deleted
1012 // along with the RenderView automatically. This is why we just store
1013 // weak references.
1015 // The speech recognition dispatcher attached to this view, lazily
1016 // initialized.
1017 SpeechRecognitionDispatcher* speech_recognition_dispatcher_;
1019 // BrowserPluginManager attached to this view; lazily initialized.
1020 scoped_refptr<BrowserPluginManager> browser_plugin_manager_;
1022 DevToolsAgent* devtools_agent_;
1024 // Mouse Lock dispatcher attached to this view.
1025 MouseLockDispatcher* mouse_lock_dispatcher_;
1027 scoped_ptr<HistoryController> history_controller_;
1029 #if defined(OS_ANDROID)
1030 // Android Specific ---------------------------------------------------------
1032 // Expected id of the next content intent launched. Used to prevent scheduled
1033 // intents to be launched if aborted.
1034 size_t expected_content_intent_id_;
1036 // List of click-based content detectors.
1037 typedef std::vector< linked_ptr<ContentDetector> > ContentDetectorList;
1038 ContentDetectorList content_detectors_;
1040 // A date/time picker object for date and time related input elements.
1041 scoped_ptr<RendererDateTimePicker> date_time_picker_client_;
1042 #endif
1044 // Plugins -------------------------------------------------------------------
1046 // All the currently active plugin delegates for this RenderView; kept so
1047 // that we can enumerate them to send updates about things like window
1048 // location or tab focus and visibily. These are non-owning references.
1049 std::set<WebPluginDelegateProxy*> plugin_delegates_;
1051 #if defined(OS_WIN)
1052 // The ID of the focused NPAPI plug-in.
1053 int focused_plugin_id_;
1054 #endif
1056 #if defined(ENABLE_PLUGINS)
1057 PepperPluginInstanceImpl* plugin_find_handler_;
1059 typedef std::set<PepperPluginInstanceImpl*> PepperPluginSet;
1060 PepperPluginSet active_pepper_instances_;
1062 // TODO(jam): these belong on RenderFrame, once the browser knows which frame
1063 // is focused and sends the IPCs which use these to the correct frame. Until
1064 // then, we must store these on RenderView as that's the one place that knows
1065 // about all the RenderFrames for a page.
1067 // Whether or not the focus is on a PPAPI plugin
1068 PepperPluginInstanceImpl* focused_pepper_plugin_;
1070 // The plugin instance that received the last mouse event. It is set to NULL
1071 // if the last mouse event went to elements other than Pepper plugins.
1072 // |pepper_last_mouse_event_target_| is not owned by this class. We depend on
1073 // the RenderFrameImpl to NULL it out when it destructs.
1074 PepperPluginInstanceImpl* pepper_last_mouse_event_target_;
1075 #endif
1077 // Misc ----------------------------------------------------------------------
1079 // The current and pending file chooser completion objects. If the queue is
1080 // nonempty, the first item represents the currently running file chooser
1081 // callback, and the remaining elements are the other file chooser completion
1082 // still waiting to be run (in order).
1083 struct PendingFileChooser;
1084 std::deque< linked_ptr<PendingFileChooser> > file_chooser_completions_;
1086 // The current directory enumeration callback
1087 std::map<int, blink::WebFileChooserCompletion*> enumeration_completions_;
1088 int enumeration_completion_id_;
1090 // The SessionStorage namespace that we're assigned to has an ID, and that ID
1091 // is passed to us upon creation. WebKit asks for this ID upon first use and
1092 // uses it whenever asking the browser process to allocate new storage areas.
1093 int64 session_storage_namespace_id_;
1095 // Stores edit commands associated to the next key event.
1096 // Shall be cleared as soon as the next key event is processed.
1097 EditCommands edit_commands_;
1099 // All the registered observers. We expect this list to be small, so vector
1100 // is fine.
1101 ObserverList<RenderViewObserver> observers_;
1103 // Wraps the |webwidget_| as a MouseLockDispatcher::LockTarget interface.
1104 scoped_ptr<MouseLockDispatcher::LockTarget> webwidget_mouse_lock_target_;
1106 // State associated with the GetWindowSnapshot function.
1107 int next_snapshot_id_;
1108 typedef std::map<int, WindowSnapshotCallback> PendingSnapshotMap;
1109 PendingSnapshotMap pending_snapshots_;
1111 // This field stores drag/drop related info for the event that is currently
1112 // being handled. If the current event results in starting a drag/drop
1113 // session, this info is sent to the browser along with other drag/drop info.
1114 DragEventSourceInfo possible_drag_event_info_;
1116 // NOTE: stats_collection_observer_ should be the last members because their
1117 // constructors call the AddObservers method of RenderViewImpl.
1118 scoped_ptr<StatsCollectionObserver> stats_collection_observer_;
1120 typedef std::map<cc::SharedBitmapId, cc::SharedBitmap*> BitmapMap;
1121 BitmapMap disambiguation_bitmaps_;
1123 // ---------------------------------------------------------------------------
1124 // ADDING NEW DATA? Please see if it fits appropriately in one of the above
1125 // sections rather than throwing it randomly at the end. If you're adding a
1126 // bunch of stuff, you should probably create a helper class and put your
1127 // data and methods on that to avoid bloating RenderView more. You can
1128 // use the Observer interface to filter IPC messages and receive frame change
1129 // notifications.
1130 // ---------------------------------------------------------------------------
1132 DISALLOW_COPY_AND_ASSIGN(RenderViewImpl);
1135 } // namespace content
1137 #endif // CONTENT_RENDERER_RENDER_VIEW_IMPL_H_