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_
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/renderer/render_view.h"
38 #include "content/renderer/mouse_lock_dispatcher.h"
39 #include "content/renderer/render_frame_impl.h"
40 #include "content/renderer/render_widget.h"
41 #include "content/renderer/renderer_date_time_picker.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"
60 #include "webkit/common/webpreferences.h"
62 #if defined(OS_ANDROID)
63 #include "content/renderer/android/content_detector.h"
64 #include "third_party/WebKit/public/web/WebContentDetectionResult.h"
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)
74 class PepperDeviceTest;
76 struct PP_NetAddress_Private;
77 struct FrameMsg_Navigate_Params;
78 struct ViewMsg_PostMessage_Params;
79 struct ViewMsg_StopFinding_Params;
86 struct SelectedFileInfo;
90 class WebApplicationCacheHost;
91 class WebApplicationCacheHostClient;
92 class WebDOMMessageEvent;
94 class WebDateTimeChooserCompletion;
96 class WebGestureEvent;
99 class WebPeerConnection00Handler;
100 class WebPeerConnection00HandlerClient;
102 class WebPeerConnectionHandler;
103 class WebPeerConnectionHandlerClient;
104 class WebSocketStreamHandle;
105 class WebSpeechRecognizer;
106 class WebStorageNamespace;
109 struct WebActiveWheelFlingParameters;
110 struct WebDateTimeChooserParams;
111 struct WebFileChooserParams;
112 struct WebFindOptions;
113 struct WebMediaPlayerAction;
114 struct WebPluginAction;
116 struct WebWindowFeatures;
118 #if defined(OS_ANDROID)
119 class WebHitTestResult;
123 namespace webkit_glue {
124 class WebURLResponseExtraDataImpl;
128 class BrowserPluginManager;
131 class ExternalPopupMenu;
133 class HistoryController;
135 class ImageResourceFetcher;
136 class MediaStreamDispatcher;
137 class MouseLockDispatcher;
138 class NavigationState;
139 class PepperPluginInstanceImpl;
140 class PushMessagingDispatcher;
141 class RenderViewObserver;
142 class RenderViewTest;
143 class RendererAccessibility;
144 class RendererDateTimePicker;
145 class RendererWebColorChooserImpl;
146 class SpeechRecognitionDispatcher;
147 class WebPluginDelegateProxy;
150 struct FileChooserParams;
151 struct RenderViewImplParams;
153 #if defined(OS_ANDROID)
154 class WebMediaPlayerProxyAndroid;
158 // RenderView is an object that manages a WebView object, and provides a
159 // communication interface with an embedding application process
161 class CONTENT_EXPORT RenderViewImpl
162 : public RenderWidget,
163 NON_EXPORTED_BASE(public blink::WebViewClient),
164 NON_EXPORTED_BASE(public blink::WebPageSerializerClient),
166 public base::SupportsWeakPtr<RenderViewImpl> {
168 // Creates a new RenderView. |opener_id| is the routing ID of the RenderView
169 // responsible for creating this RenderView. Note that if the original opener
170 // has been closed, |window_was_created_with_opener| will be true and
171 // |opener_id| will be MSG_ROUTING_NONE. When |swapped_out| is true, the
172 // |proxy_routing_id| is specified, so a RenderFrameProxy can be created for
173 // this RenderView's main RenderFrame.
174 static RenderViewImpl* Create(int32 opener_id,
175 bool window_was_created_with_opener,
176 const RendererPreferences& renderer_prefs,
177 const WebPreferences& webkit_prefs,
179 int32 main_frame_routing_id,
181 int64 session_storage_namespace_id,
182 const base::string16& frame_name,
183 bool is_renderer_created,
185 int32 proxy_routing_id,
189 const blink::WebScreenInfo& screen_info,
190 AccessibilityMode accessibility_mode);
192 // Used by content_layouttest_support to hook into the creation of
194 static void InstallCreateHook(
195 RenderViewImpl* (*create_render_view_impl)(RenderViewImplParams*));
197 // Returns the RenderViewImpl containing the given WebView.
198 static RenderViewImpl* FromWebView(blink::WebView* webview);
200 // Returns the RenderViewImpl for the given routing ID.
201 static RenderViewImpl* FromRoutingID(int routing_id);
203 static size_t GetRenderViewCount();
205 // May return NULL when the view is closing.
206 blink::WebView* webview() const;
208 int history_list_offset() const { return history_list_offset_; }
210 const WebPreferences& webkit_preferences() const {
211 return webkit_preferences_;
214 const RendererPreferences& renderer_preferences() const {
215 return renderer_preferences_;
218 void set_send_content_state_immediately(bool value) {
219 send_content_state_immediately_ = value;
222 RenderFrameImpl* main_render_frame() { return main_render_frame_.get(); }
224 // TODO(jam): move to RenderFrameImpl
225 MediaStreamDispatcher* media_stream_dispatcher() {
226 return media_stream_dispatcher_;
229 AccessibilityMode accessibility_mode() {
230 return accessibility_mode_;
233 RendererAccessibility* renderer_accessibility() {
234 return renderer_accessibility_;
237 MouseLockDispatcher* mouse_lock_dispatcher() {
238 return mouse_lock_dispatcher_;
241 HistoryController* history_controller() {
242 return history_controller_.get();
245 // Lazily initialize this view's BrowserPluginManager and return it.
246 BrowserPluginManager* GetBrowserPluginManager();
248 // Functions to add and remove observers for this object.
249 void AddObserver(RenderViewObserver* observer);
250 void RemoveObserver(RenderViewObserver* observer);
252 // Returns the StatsCollectionObserver associated with this view, or NULL
253 // if one wasn't created;
254 StatsCollectionObserver* GetStatsCollectionObserver() {
255 return stats_collection_observer_.get();
258 // Adds the given file chooser request to the file_chooser_completion_ queue
259 // (see that var for more) and requests the chooser be displayed if there are
260 // no other waiting items in the queue.
262 // Returns true if the chooser was successfully scheduled. False means we
263 // didn't schedule anything.
264 bool ScheduleFileChooser(const FileChooserParams& params,
265 blink::WebFileChooserCompletion* completion);
267 #if defined(OS_ANDROID)
268 void DismissDateTimeDialog();
270 #if defined(OS_MACOSX) || defined(OS_ANDROID)
271 void DidHideExternalPopupMenu();
274 bool is_loading() const { return frames_in_progress_ != 0; }
276 void FrameDidStartLoading(blink::WebFrame* frame);
277 void FrameDidStopLoading(blink::WebFrame* frame);
279 // Plugin-related functions --------------------------------------------------
281 #if defined(ENABLE_PLUGINS)
282 // Get/set the plugin which will be used as to handle document find requests.
283 void set_plugin_find_handler(PepperPluginInstanceImpl* plugin) {
284 plugin_find_handler_ = plugin;
286 PepperPluginInstanceImpl* plugin_find_handler() {
287 return plugin_find_handler_;
290 PepperPluginInstanceImpl* focused_pepper_plugin() {
291 return focused_pepper_plugin_;
293 PepperPluginInstanceImpl* pepper_last_mouse_event_target() {
294 return pepper_last_mouse_event_target_;
296 void set_pepper_last_mouse_event_target(PepperPluginInstanceImpl* plugin) {
297 pepper_last_mouse_event_target_ = plugin;
300 #if defined(OS_MACOSX) || defined(OS_WIN)
301 // Informs the render view that the given plugin has gained or lost focus.
302 void PluginFocusChanged(bool focused, int plugin_id);
305 #if defined(OS_MACOSX)
306 // Starts plugin IME.
307 void StartPluginIme();
310 // Indicates that the given instance has been created.
311 void PepperInstanceCreated(PepperPluginInstanceImpl* instance);
313 // Indicates that the given instance is being destroyed. This is called from
314 // the destructor, so it's important that the instance is not dereferenced
316 void PepperInstanceDeleted(PepperPluginInstanceImpl* instance);
318 // Notification that the given plugin is focused or unfocused.
319 void PepperFocusChanged(PepperPluginInstanceImpl* instance, bool focused);
321 void RegisterPluginDelegate(WebPluginDelegateProxy* delegate);
322 void UnregisterPluginDelegate(WebPluginDelegateProxy* delegate);
323 #endif // ENABLE_PLUGINS
325 void TransferActiveWheelFlingAnimation(
326 const blink::WebActiveWheelFlingParameters& params);
328 // Returns true if the focused element is editable text from the perspective
329 // of IME support (also used for on-screen keyboard). Works correctly inside
330 // supported PPAPI plug-ins.
331 bool HasIMETextFocus();
333 // Callback for use with GetWindowSnapshot.
334 typedef base::Callback<void(
335 const gfx::Size&, const std::vector<unsigned char>&)>
336 WindowSnapshotCallback;
338 void GetWindowSnapshot(const WindowSnapshotCallback& callback);
340 // Dispatches the current navigation state to the browser. Called on a
341 // periodic timer so we don't send too many messages.
342 void SyncNavigationState();
344 // Returns the length of the session history of this RenderView. Note that
345 // this only coincides with the actual length of the session history if this
346 // RenderView is the currently active RenderView of a WebContents.
347 unsigned GetLocalSessionHistoryLengthForTesting() const;
349 // Invokes OnSetFocus and marks the widget as active depending on the value
350 // of |enable|. This is used for layout tests that need to control the focus
351 // synchronously from the renderer.
352 void SetFocusAndActivateForTesting(bool enable);
354 // Change the device scale factor and force the compositor to resize.
355 void SetDeviceScaleFactorForTesting(float factor);
357 // Change screen orientation and force the compositor to resize.
358 void SetScreenOrientationForTesting(
359 const blink::WebScreenOrientationType& orientation);
361 // Change the device ICC color profile while running a layout test.
362 void SetDeviceColorProfileForTesting(const std::vector<char>& color_profile);
364 // Used to force the size of a window when running layout tests.
365 void ForceResizeForTesting(const gfx::Size& new_size);
367 void UseSynchronousResizeModeForTesting(bool enable);
369 // Control autoresize mode.
370 void EnableAutoResizeForTesting(const gfx::Size& min_size,
371 const gfx::Size& max_size);
372 void DisableAutoResizeForTesting(const gfx::Size& new_size);
374 // IPC::Listener implementation ----------------------------------------------
376 virtual bool OnMessageReceived(const IPC::Message& msg) OVERRIDE;
378 // blink::WebWidgetClient implementation ------------------------------------
380 // Most methods are handled by RenderWidget.
381 virtual void didFocus();
382 virtual void didBlur();
383 virtual void show(blink::WebNavigationPolicy policy);
384 virtual void runModal();
385 virtual bool enterFullScreen();
386 virtual void exitFullScreen();
387 virtual bool requestPointerLock();
388 virtual void requestPointerUnlock();
389 virtual bool isPointerLocked();
390 virtual void didHandleGestureEvent(const blink::WebGestureEvent& event,
391 bool event_cancelled) OVERRIDE;
392 virtual void initializeLayerTreeView() OVERRIDE;
394 // blink::WebViewClient implementation --------------------------------------
396 virtual blink::WebView* createView(blink::WebLocalFrame* creator,
397 const blink::WebURLRequest& request,
398 const blink::WebWindowFeatures& features,
399 const blink::WebString& frame_name,
400 blink::WebNavigationPolicy policy,
401 bool suppress_opener);
402 virtual blink::WebWidget* createPopupMenu(blink::WebPopupType popup_type);
403 virtual blink::WebExternalPopupMenu* createExternalPopupMenu(
404 const blink::WebPopupMenuInfo& popup_menu_info,
405 blink::WebExternalPopupMenuClient* popup_menu_client);
406 virtual blink::WebStorageNamespace* createSessionStorageNamespace();
407 virtual void printPage(blink::WebLocalFrame* frame);
408 virtual bool enumerateChosenDirectory(
409 const blink::WebString& path,
410 blink::WebFileChooserCompletion* chooser_completion);
411 virtual void didCancelCompositionOnSelectionChange();
412 virtual bool handleCurrentKeyboardEvent();
413 virtual bool runFileChooser(
414 const blink::WebFileChooserParams& params,
415 blink::WebFileChooserCompletion* chooser_completion);
416 virtual void showValidationMessage(const blink::WebRect& anchor_in_root_view,
417 const blink::WebString& main_text,
418 const blink::WebString& sub_text,
419 blink::WebTextDirection hint) OVERRIDE;
420 virtual void hideValidationMessage() OVERRIDE;
421 virtual void moveValidationMessage(
422 const blink::WebRect& anchor_in_root_view) OVERRIDE;
423 virtual void setStatusText(const blink::WebString& text);
424 virtual void setMouseOverURL(const blink::WebURL& url);
425 virtual void setKeyboardFocusURL(const blink::WebURL& url);
426 virtual void startDragging(blink::WebLocalFrame* frame,
427 const blink::WebDragData& data,
428 blink::WebDragOperationsMask mask,
429 const blink::WebImage& image,
430 const blink::WebPoint& imageOffset);
431 virtual bool acceptsLoadDrops();
432 virtual void focusNext();
433 virtual void focusPrevious();
434 virtual void focusedNodeChanged(const blink::WebNode& node);
435 virtual void didUpdateLayout();
436 #if defined(OS_ANDROID)
437 virtual bool didTapMultipleTargets(
438 const blink::WebGestureEvent& event,
439 const blink::WebVector<blink::WebRect>& target_rects);
441 virtual blink::WebString acceptLanguages();
442 virtual void navigateBackForwardSoon(int offset);
443 virtual int historyBackListCount();
444 virtual int historyForwardListCount();
445 virtual void postAccessibilityEvent(
446 const blink::WebAXObject& obj, blink::WebAXEvent event);
447 virtual void didUpdateInspectorSetting(const blink::WebString& key,
448 const blink::WebString& value);
449 virtual blink::WebSpeechRecognizer* speechRecognizer();
450 virtual void zoomLimitsChanged(double minimum_level, double maximum_level);
451 virtual void zoomLevelChanged();
452 virtual double zoomLevelToZoomFactor(double zoom_level) const;
453 virtual double zoomFactorToZoomLevel(double factor) const;
454 virtual void registerProtocolHandler(const blink::WebString& scheme,
455 const blink::WebURL& base_url,
456 const blink::WebURL& url,
457 const blink::WebString& title);
458 virtual blink::WebPageVisibilityState visibilityState() const;
459 virtual blink::WebPushClient* webPushClient();
460 virtual void draggableRegionsChanged();
462 #if defined(OS_ANDROID)
463 virtual void scheduleContentIntent(const blink::WebURL& intent);
464 virtual void cancelScheduledContentIntents();
465 virtual blink::WebContentDetectionResult detectContentAround(
466 const blink::WebHitTestResult& touch_hit);
468 // Only used on Android since all other platforms implement
469 // date and time input fields using MULTIPLE_FIELDS_UI
470 virtual bool openDateTimeChooser(const blink::WebDateTimeChooserParams&,
471 blink::WebDateTimeChooserCompletion*);
472 virtual void didScrollWithKeyboard(const blink::WebSize& delta);
475 // blink::WebPageSerializerClient implementation ----------------------------
477 virtual void didSerializeDataForFrame(
478 const blink::WebURL& frame_url,
479 const blink::WebCString& data,
480 PageSerializationStatus status) OVERRIDE;
482 // RenderView implementation -------------------------------------------------
484 virtual bool Send(IPC::Message* message) OVERRIDE;
485 virtual RenderFrame* GetMainRenderFrame() OVERRIDE;
486 virtual int GetRoutingID() const OVERRIDE;
487 virtual int GetPageId() const OVERRIDE;
488 virtual gfx::Size GetSize() const OVERRIDE;
489 virtual WebPreferences& GetWebkitPreferences() OVERRIDE;
490 virtual void SetWebkitPreferences(const WebPreferences& preferences) OVERRIDE;
491 virtual blink::WebView* GetWebView() OVERRIDE;
492 virtual blink::WebElement GetFocusedElement() const OVERRIDE;
493 virtual bool IsEditableNode(const blink::WebNode& node) const OVERRIDE;
494 virtual bool ShouldDisplayScrollbars(int width, int height) const OVERRIDE;
495 virtual int GetEnabledBindings() const OVERRIDE;
496 virtual bool GetContentStateImmediately() const OVERRIDE;
497 virtual blink::WebPageVisibilityState GetVisibilityState() const OVERRIDE;
498 virtual void DidStartLoading() OVERRIDE;
499 virtual void DidStopLoading() OVERRIDE;
500 virtual void Repaint(const gfx::Size& size) OVERRIDE;
501 virtual void SetEditCommandForNextKeyEvent(const std::string& name,
502 const std::string& value) OVERRIDE;
503 virtual void ClearEditCommands() OVERRIDE;
504 virtual SSLStatus GetSSLStatusOfFrame(blink::WebFrame* frame) const OVERRIDE;
505 virtual const std::string& GetAcceptLanguages() const OVERRIDE;
506 #if defined(OS_ANDROID)
507 virtual void UpdateTopControlsState(TopControlsState constraints,
508 TopControlsState current,
509 bool animate) OVERRIDE;
511 bool uses_temporary_zoom_level() const { return uses_temporary_zoom_level_; }
513 // Please do not add your stuff randomly to the end here. If there is an
514 // appropriate section, add it there. If not, there are some random functions
515 // nearer to the top you can add it to.
517 // Cannot use std::set unfortunately since linked_ptr<> does not support
519 typedef std::vector<linked_ptr<ImageResourceFetcher> >
520 ImageResourceFetcherList;
523 // RenderWidget overrides:
524 virtual void OnClose() OVERRIDE;
525 virtual void Close() OVERRIDE;
526 virtual void OnResize(const ViewMsg_Resize_Params& params) OVERRIDE;
527 virtual void DidInitiatePaint() OVERRIDE;
528 virtual void DidFlushPaint() OVERRIDE;
529 virtual gfx::Vector2d GetScrollOffset() OVERRIDE;
530 virtual void DidHandleKeyEvent() OVERRIDE;
531 virtual bool WillHandleMouseEvent(
532 const blink::WebMouseEvent& event) OVERRIDE;
533 virtual bool WillHandleGestureEvent(
534 const blink::WebGestureEvent& event) OVERRIDE;
535 virtual void DidHandleMouseEvent(const blink::WebMouseEvent& event) OVERRIDE;
536 virtual void DidHandleTouchEvent(const blink::WebTouchEvent& event) OVERRIDE;
537 virtual bool HasTouchEventHandlersAt(const gfx::Point& point) const OVERRIDE;
538 virtual void OnSetFocus(bool enable) OVERRIDE;
539 virtual void OnWasHidden() OVERRIDE;
540 virtual void OnWasShown(bool needs_repainting) OVERRIDE;
541 virtual GURL GetURLForGraphicsContext3D() OVERRIDE;
542 virtual void OnImeSetComposition(
543 const base::string16& text,
544 const std::vector<blink::WebCompositionUnderline>& underlines,
546 int selection_end) OVERRIDE;
547 virtual void OnImeConfirmComposition(const base::string16& text,
548 const gfx::Range& replacement_range,
549 bool keep_selection) OVERRIDE;
550 virtual void SetDeviceScaleFactor(float device_scale_factor) OVERRIDE;
551 virtual bool SetDeviceColorProfile(
552 const std::vector<char>& color_profile) OVERRIDE;
553 virtual void OnOrientationChange() OVERRIDE;
554 virtual ui::TextInputType GetTextInputType() OVERRIDE;
555 virtual void GetSelectionBounds(gfx::Rect* start, gfx::Rect* end) OVERRIDE;
556 #if defined(OS_MACOSX) || defined(USE_AURA)
557 virtual void GetCompositionCharacterBounds(
558 std::vector<gfx::Rect>* character_bounds) OVERRIDE;
559 virtual void GetCompositionRange(gfx::Range* range) OVERRIDE;
561 virtual bool CanComposeInline() OVERRIDE;
562 virtual void DidCommitCompositorFrame() OVERRIDE;
563 virtual void InstrumentWillBeginFrame(int frame_id) OVERRIDE;
564 virtual void InstrumentDidBeginFrame() OVERRIDE;
565 virtual void InstrumentDidCancelFrame() OVERRIDE;
566 virtual void InstrumentWillComposite() OVERRIDE;
569 explicit RenderViewImpl(RenderViewImplParams* params);
571 void Initialize(RenderViewImplParams* params);
572 virtual void SetScreenMetricsEmulationParameters(
573 float device_scale_factor,
574 const gfx::Point& root_layer_offset,
575 float root_layer_scale) OVERRIDE;
577 // Do not delete directly. This class is reference counted.
578 virtual ~RenderViewImpl();
582 friend class ExternalPopupMenuTest;
583 friend class PepperDeviceTest;
584 friend class RendererAccessibilityTest;
585 friend class RenderViewTest;
587 // TODO(nasko): Temporarily friend RenderFrameImpl, so we don't duplicate
588 // utility functions needed in both classes, while we move frame specific
589 // code away from this class.
590 friend class RenderFrameImpl;
592 FRIEND_TEST_ALL_PREFIXES(ExternalPopupMenuRemoveTest, RemoveOnChange);
593 FRIEND_TEST_ALL_PREFIXES(ExternalPopupMenuTest, NormalCase);
594 FRIEND_TEST_ALL_PREFIXES(ExternalPopupMenuTest, ShowPopupThenNavigate);
595 FRIEND_TEST_ALL_PREFIXES(RenderViewImplTest, DecideNavigationPolicyForWebUI);
596 FRIEND_TEST_ALL_PREFIXES(RenderViewImplTest,
597 DidFailProvisionalLoadWithErrorForError);
598 FRIEND_TEST_ALL_PREFIXES(RenderViewImplTest,
599 DidFailProvisionalLoadWithErrorForCancellation);
600 FRIEND_TEST_ALL_PREFIXES(RenderViewImplTest,
601 DontIgnoreBackAfterNavEntryLimit);
602 FRIEND_TEST_ALL_PREFIXES(RenderViewImplTest, ImeComposition);
603 FRIEND_TEST_ALL_PREFIXES(RenderViewImplTest, InsertCharacters);
604 FRIEND_TEST_ALL_PREFIXES(RenderViewImplTest, JSBlockSentAfterPageLoad);
605 FRIEND_TEST_ALL_PREFIXES(RenderViewImplTest, LastCommittedUpdateState);
606 FRIEND_TEST_ALL_PREFIXES(RenderViewImplTest, OnHandleKeyboardEvent);
607 FRIEND_TEST_ALL_PREFIXES(RenderViewImplTest, OnImeTypeChanged);
608 FRIEND_TEST_ALL_PREFIXES(RenderViewImplTest, OnNavStateChanged);
609 FRIEND_TEST_ALL_PREFIXES(RenderViewImplTest, OnSetAccessibilityMode);
610 FRIEND_TEST_ALL_PREFIXES(RenderViewImplTest, OnSetTextDirection);
611 FRIEND_TEST_ALL_PREFIXES(RenderViewImplTest, OnUpdateWebPreferences);
612 FRIEND_TEST_ALL_PREFIXES(RenderViewImplTest,
613 SetEditableSelectionAndComposition);
614 FRIEND_TEST_ALL_PREFIXES(RenderViewImplTest, StaleNavigationsIgnored);
615 FRIEND_TEST_ALL_PREFIXES(RenderViewImplTest, UpdateTargetURLWithInvalidURL);
616 FRIEND_TEST_ALL_PREFIXES(RenderViewImplTest,
617 GetCompositionCharacterBoundsTest);
618 FRIEND_TEST_ALL_PREFIXES(RenderViewImplTest, OnNavigationHttpPost);
619 FRIEND_TEST_ALL_PREFIXES(RenderViewImplTest,
620 DecideNavigationPolicyHandlesAllTopLevel);
621 #if defined(OS_MACOSX)
622 FRIEND_TEST_ALL_PREFIXES(RenderViewTest, MacTestCmdUp);
624 FRIEND_TEST_ALL_PREFIXES(RenderViewImplTest, SetHistoryLengthAndPrune);
625 FRIEND_TEST_ALL_PREFIXES(RenderViewImplTest, ZoomLimit);
626 FRIEND_TEST_ALL_PREFIXES(RenderViewImplTest, NavigateFrame);
627 FRIEND_TEST_ALL_PREFIXES(RenderViewImplTest, BasicRenderFrame);
628 FRIEND_TEST_ALL_PREFIXES(RenderViewImplTest, TextInputTypeWithPepper);
629 FRIEND_TEST_ALL_PREFIXES(RenderViewImplTest,
630 MessageOrderInDidChangeSelection);
631 FRIEND_TEST_ALL_PREFIXES(RenderViewImplTest, SendCandidateWindowEvents);
632 FRIEND_TEST_ALL_PREFIXES(SuppressErrorPageTest, Suppresses);
633 FRIEND_TEST_ALL_PREFIXES(SuppressErrorPageTest, DoesNotSuppress);
635 typedef std::map<GURL, double> HostZoomLevels;
643 // Old WebFrameClient implementations ----------------------------------------
645 // RenderViewImpl used to be a WebFrameClient, but now RenderFrameImpl is the
646 // WebFrameClient. However, many implementations of WebFrameClient methods
647 // still live here and are called from RenderFrameImpl. These implementations
648 // are to be moved to RenderFrameImpl <http://crbug.com/361761>.
650 void didCreateDataSource(blink::WebLocalFrame* frame,
651 blink::WebDataSource* datasource);
652 void didClearWindowObject(blink::WebLocalFrame* frame);
653 void didChangeIcon(blink::WebLocalFrame*, blink::WebIconURL::Type);
654 void didUpdateCurrentHistoryItem(blink::WebLocalFrame* frame);
655 void didChangeScrollOffset(blink::WebLocalFrame* frame);
657 static bool IsReload(const FrameMsg_Navigate_Params& params);
659 static Referrer GetReferrerFromRequest(
660 blink::WebFrame* frame,
661 const blink::WebURLRequest& request);
663 static WindowOpenDisposition NavigationPolicyToDisposition(
664 blink::WebNavigationPolicy policy);
666 void UpdateSessionHistory(blink::WebFrame* frame);
667 void SendUpdateState(HistoryEntry* entry);
669 // Sends a message and runs a nested message loop.
670 bool SendAndRunNestedMessageLoop(IPC::SyncMessage* message);
672 // Called when the "pinned to left/right edge" state needs to be updated.
673 void UpdateScrollState(blink::WebFrame* frame);
675 // IPC message handlers ------------------------------------------------------
677 // The documentation for these functions should be in
678 // content/common/*_messages.h for the message that the function is handling.
679 void OnExecuteEditCommand(const std::string& name, const std::string& value);
680 void OnMoveCaret(const gfx::Point& point);
681 void OnScrollFocusedEditableNodeIntoRect(const gfx::Rect& rect);
682 void OnSetEditCommandsForNextKeyEvent(const EditCommands& edit_commands);
683 void OnAllowBindings(int enabled_bindings_flags);
684 void OnAllowScriptToClose(bool script_can_close);
685 void OnCancelDownload(int32 download_id);
686 void OnClearFocusedElement();
688 void OnShowContextMenu(ui::MenuSourceType source_type,
689 const gfx::Point& location);
690 void OnCopyImageAt(int x, int y);
691 void OnSaveImageAt(int x, int y);
692 void OnDeterminePageLanguage();
693 void OnDisableScrollbarsForSmallWindows(
694 const gfx::Size& disable_scrollbars_size_limit);
695 void OnDragSourceEnded(const gfx::Point& client_point,
696 const gfx::Point& screen_point,
697 blink::WebDragOperation drag_operation);
698 void OnDragSourceSystemDragEnded();
699 void OnDragTargetDrop(const gfx::Point& client_pt,
700 const gfx::Point& screen_pt,
702 void OnDragTargetDragEnter(const DropData& drop_data,
703 const gfx::Point& client_pt,
704 const gfx::Point& screen_pt,
705 blink::WebDragOperationsMask operations_allowed,
707 void OnDragTargetDragLeave();
708 void OnDragTargetDragOver(const gfx::Point& client_pt,
709 const gfx::Point& screen_pt,
710 blink::WebDragOperationsMask operations_allowed,
712 void OnEnablePreferredSizeChangedMode();
713 void OnEnableAutoResize(const gfx::Size& min_size, const gfx::Size& max_size);
714 void OnDisableAutoResize(const gfx::Size& new_size);
715 void OnEnumerateDirectoryResponse(int id,
716 const std::vector<base::FilePath>& paths);
717 void OnFileChooserResponse(
718 const std::vector<ui::SelectedFileInfo>& files);
719 void OnFind(int request_id,
720 const base::string16&,
721 const blink::WebFindOptions&);
722 void OnGetAllSavableResourceLinksForCurrentPage(const GURL& page_url);
723 void OnGetSerializedHtmlDataForCurrentPageWithLocalLinks(
724 const std::vector<GURL>& links,
725 const std::vector<base::FilePath>& local_paths,
726 const base::FilePath& local_directory_name);
727 void OnMediaPlayerActionAt(const gfx::Point& location,
728 const blink::WebMediaPlayerAction& action);
729 void OnPluginActionAt(const gfx::Point& location,
730 const blink::WebPluginAction& action);
731 void OnMoveOrResizeStarted();
732 void OnPostMessageEvent(const ViewMsg_PostMessage_Params& params);
733 void OnReleaseDisambiguationPopupBitmap(const cc::SharedBitmapId& id);
734 void OnResetPageEncodingToDefault();
735 void OnSetAccessibilityMode(AccessibilityMode new_mode);
736 void OnSetActive(bool active);
737 void OnSetBackgroundOpaque(bool opaque);
738 void OnExitFullscreen();
739 void OnSetHistoryLengthAndPrune(int history_length, int32 minimum_page_id);
740 void OnSetInitialFocus(bool reverse);
741 void OnSetPageEncoding(const std::string& encoding_name);
742 void OnSetRendererPrefs(const RendererPreferences& renderer_prefs);
743 void OnSetWebUIProperty(const std::string& name, const std::string& value);
744 void OnSetZoomLevelForLoadingURL(const GURL& url, double zoom_level);
745 void OnSetZoomLevelForView(bool uses_temporary_zoom_level, double level);
747 void OnStopFinding(StopFindAction action);
748 void OnSuppressDialogsUntilSwapOut();
749 void OnThemeChanged();
750 void OnUpdateTargetURLAck();
751 void OnUpdateWebPreferences(const WebPreferences& prefs);
752 void OnZoom(PageZoom zoom);
753 void OnEnableViewSourceMode();
754 void OnDisownOpener();
755 void OnWindowSnapshotCompleted(const int snapshot_id,
756 const gfx::Size& size, const std::vector<unsigned char>& png);
757 void OnSelectWordAroundCaret();
758 #if defined(OS_ANDROID)
759 void OnActivateNearestFindResult(int request_id, float x, float y);
760 void OnFindMatchRects(int current_version);
761 void OnSelectPopupMenuItems(bool canceled,
762 const std::vector<int>& selected_indices);
763 void OnUndoScrollFocusedEditableNodeIntoRect();
764 void OnUpdateTopControlsState(bool enable_hiding,
767 void OnExtractSmartClipData(const gfx::Rect& rect);
768 #elif defined(OS_MACOSX)
769 void OnPluginImeCompositionCompleted(const base::string16& text,
771 void OnSelectPopupMenuItem(int selected_index);
772 void OnSetInLiveResize(bool in_live_resize);
773 void OnSetWindowVisibility(bool visible);
774 void OnWindowFrameChanged(const gfx::Rect& window_frame,
775 const gfx::Rect& view_frame);
778 // Adding a new message handler? Please add it in alphabetical order above
779 // and put it in the same position in the .cc file.
781 // Misc private functions ----------------------------------------------------
782 // Check whether the preferred size has changed.
783 void CheckPreferredSize();
785 // This callback is triggered when DownloadFavicon completes, either
786 // succesfully or with a failure. See DownloadFavicon for more
788 void DidDownloadFavicon(ImageResourceFetcher* fetcher,
789 const SkBitmap& image);
791 // Requests to download a favicon image. When done, the RenderView is notified
792 // by way of DidDownloadFavicon. Returns true if the request was successfully
793 // started, false otherwise. id is used to uniquely identify the request and
794 // passed back to the DidDownloadFavicon method. If the image has multiple
795 // frames, the frame whose size is image_size is returned. If the image
796 // doesn't have a frame at the specified size, the first is returned.
797 bool DownloadFavicon(int id, const GURL& image_url, int image_size);
799 // Called to get the WebPlugin to handle find requests in the document.
800 // Returns NULL if there is no such WebPlugin.
801 blink::WebPlugin* GetWebPluginForFind();
803 // Returns true if the |params| navigation is to an entry that has been
804 // cropped due to a recent navigation the browser did not know about.
805 bool IsBackForwardToStaleEntry(const FrameMsg_Navigate_Params& params,
808 // Make the given |frame| show an empty, unscriptable page.
809 // TODO(creis): Move this to RenderFrame.
810 void NavigateToSwappedOutURL(blink::WebFrame* frame);
812 // If we initiated a navigation, this function will populate |document_state|
813 // with the navigation information saved in OnNavigate().
814 void PopulateDocumentStateFromPending(DocumentState* document_state);
816 // Returns a new NavigationState populated with the navigation information
817 // saved in OnNavigate().
818 NavigationState* CreateNavigationStateFromPending();
820 // Processes the command-line flags --enable-viewport,
821 // --enable-fixed-layout[=w,h] and --enable-pinch.
822 void ProcessViewLayoutFlags(const base::CommandLine& command_line);
824 #if defined(OS_ANDROID)
825 // Launch an Android content intent with the given URL.
826 void LaunchAndroidContentIntent(const GURL& intent_url, size_t request_id);
829 // Sends a reply to the current find operation handling if it was a
830 // synchronous find request.
831 void SendFindReply(int request_id,
834 const blink::WebRect& selection_rect,
835 bool final_status_update);
837 // Starts nav_state_sync_timer_ if it isn't already running.
838 void StartNavStateSyncTimerIfNecessary();
840 #if defined(OS_POSIX) && !defined(OS_MACOSX)
841 void UpdateFontRenderingFromRendererPrefs();
843 void UpdateFontRenderingFromRendererPrefs() {}
846 // Update the target url and tell the browser that the target URL has changed.
847 // If |url| is empty, show |fallback_url|.
848 void UpdateTargetURL(const GURL& url, const GURL& fallback_url);
850 // Tells the browser what the new list of favicons for the webpage is.
851 void SendUpdateFaviconURL(const std::vector<FaviconURL>& urls);
853 // Invoked from DidStopLoading(). Sends the current list of loaded favicons to
855 void DidStopLoadingIcons();
857 // Coordinate conversion -----------------------------------------------------
859 gfx::RectF ClientRectToPhysicalWindowRect(const gfx::RectF& rect) const;
861 // RenderFrameImpl accessible state ------------------------------------------
862 // The following section is the set of methods that RenderFrameImpl needs
863 // to access RenderViewImpl state. The set of state variables are page-level
864 // specific, so they don't belong in RenderFrameImpl and should remain in
866 ObserverList<RenderViewObserver>& observers() {
870 // TODO(nasko): Remove this method when we move to frame proxy objects, since
871 // the concept of swapped out will be eliminated.
872 void set_is_swapped_out(bool swapped_out) {
873 is_swapped_out_ = swapped_out;
876 NavigationGesture navigation_gesture() {
877 return navigation_gesture_;
879 void set_navigation_gesture(NavigationGesture gesture) {
880 navigation_gesture_ = gesture;
883 // ---------------------------------------------------------------------------
884 // ADDING NEW FUNCTIONS? Please keep private functions alphabetized and put
885 // it in the same order in the .cc file as it was in the header.
886 // ---------------------------------------------------------------------------
888 // Settings ------------------------------------------------------------------
890 WebPreferences webkit_preferences_;
891 RendererPreferences renderer_preferences_;
893 HostZoomLevels host_zoom_levels_;
895 // Whether content state (such as form state, scroll position and page
896 // contents) should be sent to the browser immediately. This is normally
897 // false, but set to true by some tests.
898 bool send_content_state_immediately_;
900 // Bitwise-ORed set of extra bindings that have been enabled. See
901 // BindingsPolicy for details.
902 int enabled_bindings_;
904 // If true, we send IPC messages when |preferred_size_| changes.
905 bool send_preferred_size_changes_;
907 // If non-empty, and |send_preferred_size_changes_| is true, disable drawing
908 // scroll bars on windows smaller than this size. Used for windows that the
909 // browser resizes to the size of the content, such as browser action popups.
910 // If a render view is set to the minimum size of its content, webkit may add
911 // scroll bars. This makes sense for fixed sized windows, but it does not
912 // make sense when the size of the view was chosen to fit the content.
913 // This setting ensures that no scroll bars are drawn. The size limit exists
914 // because if the view grows beyond a size known to the browser, scroll bars
916 gfx::Size disable_scrollbars_size_limit_;
918 // Loading state -------------------------------------------------------------
920 // The gesture that initiated the current navigation.
921 // TODO(nasko): Move to RenderFrame, as this is per-frame state.
922 NavigationGesture navigation_gesture_;
925 bool opened_by_user_gesture_;
927 // Whether this RenderView was created by a frame that was suppressing its
928 // opener. If so, we may want to load pages in a separate process. See
929 // decidePolicyForNavigation for details.
930 bool opener_suppressed_;
932 // Whether we must stop creating nested message loops for modal dialogs until
933 // OnSwapOut is called. This is necessary because modal dialogs have a
934 // PageGroupLoadDeferrer on the stack that interferes with swapping out.
935 bool suppress_dialogs_until_swap_out_;
937 // Holds state pertaining to a navigation that we initiated. This is held by
938 // the WebDataSource::ExtraData attribute. We use pending_navigation_state_
939 // as a temporary holder for the state until the WebDataSource corresponding
940 // to the new navigation is created. See DidCreateDataSource.
941 // TODO(nasko): Move to RenderFrame, as this is per-frame state.
942 scoped_ptr<FrameMsg_Navigate_Params> pending_navigation_params_;
944 // Timer used to delay the updating of nav state (see SyncNavigationState).
945 base::OneShotTimer<RenderViewImpl> nav_state_sync_timer_;
947 // Page IDs ------------------------------------------------------------------
948 // See documentation in RenderView.
951 // Indicates the ID of the last page that we sent a FrameNavigate to the
952 // browser for. This is used to determine if the most recent transition
953 // generated a history entry (less than page_id_), or not (equal to or
954 // greater than). Note that this will be greater than page_id_ if the user
956 int32 last_page_id_sent_to_browser_;
958 // The next available page ID to use for this RenderView. These IDs are
959 // specific to a given RenderView and the frames within it.
962 // The offset of the current item in the history list.
963 int history_list_offset_;
965 // The RenderView's current impression of the history length. This includes
966 // any items that have committed in this process, but because of cross-process
967 // navigations, the history may have some entries that were committed in other
968 // processes. We won't know about them until the next navigation in this
970 int history_list_length_;
972 // Counter to track how many frames have sent start notifications but not stop
973 // notifications. TODO(avi): Remove this once DidStartLoading/DidStopLoading
975 int frames_in_progress_;
977 // The list of page IDs for each history item this RenderView knows about.
978 // Some entries may be -1 if they were rendered by other processes or were
979 // restored from a previous session. This lets us detect attempts to
980 // navigate to stale entries that have been cropped from our history.
981 std::vector<int32> history_page_ids_;
983 // UI state ------------------------------------------------------------------
985 // The state of our target_url transmissions. When we receive a request to
986 // send a URL to the browser, we set this to TARGET_INFLIGHT until an ACK
987 // comes back - if a new request comes in before the ACK, we store the new
988 // URL in pending_target_url_ and set the status to TARGET_PENDING. If an
989 // ACK comes back and we are in TARGET_PENDING, we send the stored URL and
990 // revert to TARGET_INFLIGHT.
992 // We don't need a queue of URLs to send, as only the latest is useful.
995 TARGET_INFLIGHT, // We have a request in-flight, waiting for an ACK
996 TARGET_PENDING // INFLIGHT + we have a URL waiting to be sent
997 } target_url_status_;
999 // The URL we show the user in the status bar. We use this to determine if we
1000 // want to send a new one (we do not need to send duplicates). It will be
1001 // equal to either |mouse_over_url_| or |focus_url_|, depending on which was
1005 // The URL the user's mouse is hovering over.
1006 GURL mouse_over_url_;
1008 // The URL that has keyboard focus.
1011 // The next target URL we want to send to the browser.
1012 GURL pending_target_url_;
1014 // Indicates whether this view overrides url-based zoom settings.
1015 bool uses_temporary_zoom_level_;
1017 #if defined(OS_ANDROID)
1018 // Cache the old top controls state constraints. Used when updating
1019 // current value only without altering the constraints.
1020 cc::TopControlsState top_controls_constraints_;
1023 // View ----------------------------------------------------------------------
1025 // Cache the preferred size of the page in order to prevent sending the IPC
1026 // when layout() recomputes but doesn't actually change sizes.
1027 gfx::Size preferred_size_;
1029 // Used to delay determining the preferred size (to avoid intermediate
1030 // states for the sizes).
1031 base::OneShotTimer<RenderViewImpl> check_preferred_size_timer_;
1033 // Bookkeeping to suppress redundant scroll and focus requests for an already
1034 // scrolled and focused editable node.
1035 bool has_scrolled_focused_editable_node_into_rect_;
1036 gfx::Rect rect_for_scrolled_focused_editable_node_;
1038 // Helper objects ------------------------------------------------------------
1040 scoped_ptr<RenderFrameImpl> main_render_frame_;
1042 // The next group of objects all implement RenderViewObserver, so are deleted
1043 // along with the RenderView automatically. This is why we just store
1046 // The push messaging dispatcher attached to this view, lazily initialized.
1047 PushMessagingDispatcher* push_messaging_dispatcher_;
1049 // The speech recognition dispatcher attached to this view, lazily
1051 SpeechRecognitionDispatcher* speech_recognition_dispatcher_;
1053 // MediaStream dispatcher attached to this view; lazily initialized.
1054 MediaStreamDispatcher* media_stream_dispatcher_;
1056 // BrowserPluginManager attached to this view; lazily initialized.
1057 scoped_refptr<BrowserPluginManager> browser_plugin_manager_;
1059 DevToolsAgent* devtools_agent_;
1061 // The current accessibility mode.
1062 AccessibilityMode accessibility_mode_;
1064 // Only valid if |accessibility_mode_| is anything other than
1065 // AccessibilityModeOff.
1066 RendererAccessibility* renderer_accessibility_;
1068 // Mouse Lock dispatcher attached to this view.
1069 MouseLockDispatcher* mouse_lock_dispatcher_;
1071 scoped_ptr<HistoryController> history_controller_;
1073 #if defined(OS_ANDROID)
1074 // Android Specific ---------------------------------------------------------
1076 // Expected id of the next content intent launched. Used to prevent scheduled
1077 // intents to be launched if aborted.
1078 size_t expected_content_intent_id_;
1080 // List of click-based content detectors.
1081 typedef std::vector< linked_ptr<ContentDetector> > ContentDetectorList;
1082 ContentDetectorList content_detectors_;
1084 // A date/time picker object for date and time related input elements.
1085 scoped_ptr<RendererDateTimePicker> date_time_picker_client_;
1088 // Plugins -------------------------------------------------------------------
1090 // All the currently active plugin delegates for this RenderView; kept so
1091 // that we can enumerate them to send updates about things like window
1092 // location or tab focus and visibily. These are non-owning references.
1093 std::set<WebPluginDelegateProxy*> plugin_delegates_;
1096 // The ID of the focused NPAPI plug-in.
1097 int focused_plugin_id_;
1100 #if defined(ENABLE_PLUGINS)
1101 PepperPluginInstanceImpl* plugin_find_handler_;
1103 typedef std::set<PepperPluginInstanceImpl*> PepperPluginSet;
1104 PepperPluginSet active_pepper_instances_;
1106 // TODO(jam): these belong on RenderFrame, once the browser knows which frame
1107 // is focused and sends the IPCs which use these to the correct frame. Until
1108 // then, we must store these on RenderView as that's the one place that knows
1109 // about all the RenderFrames for a page.
1111 // Whether or not the focus is on a PPAPI plugin
1112 PepperPluginInstanceImpl* focused_pepper_plugin_;
1114 // The plugin instance that received the last mouse event. It is set to NULL
1115 // if the last mouse event went to elements other than Pepper plugins.
1116 // |pepper_last_mouse_event_target_| is not owned by this class. We depend on
1117 // the RenderFrameImpl to NULL it out when it destructs.
1118 PepperPluginInstanceImpl* pepper_last_mouse_event_target_;
1121 // Misc ----------------------------------------------------------------------
1123 // The current and pending file chooser completion objects. If the queue is
1124 // nonempty, the first item represents the currently running file chooser
1125 // callback, and the remaining elements are the other file chooser completion
1126 // still waiting to be run (in order).
1127 struct PendingFileChooser;
1128 std::deque< linked_ptr<PendingFileChooser> > file_chooser_completions_;
1130 // The current directory enumeration callback
1131 std::map<int, blink::WebFileChooserCompletion*> enumeration_completions_;
1132 int enumeration_completion_id_;
1134 // The SessionStorage namespace that we're assigned to has an ID, and that ID
1135 // is passed to us upon creation. WebKit asks for this ID upon first use and
1136 // uses it whenever asking the browser process to allocate new storage areas.
1137 int64 session_storage_namespace_id_;
1139 // Stores edit commands associated to the next key event.
1140 // Shall be cleared as soon as the next key event is processed.
1141 EditCommands edit_commands_;
1143 #if defined(OS_MACOSX) || defined(OS_ANDROID)
1144 // The external popup for the currently showing select popup.
1145 scoped_ptr<ExternalPopupMenu> external_popup_menu_;
1148 // All the registered observers. We expect this list to be small, so vector
1150 ObserverList<RenderViewObserver> observers_;
1152 // Wraps the |webwidget_| as a MouseLockDispatcher::LockTarget interface.
1153 scoped_ptr<MouseLockDispatcher::LockTarget> webwidget_mouse_lock_target_;
1155 // State associated with the GetWindowSnapshot function.
1156 int next_snapshot_id_;
1157 typedef std::map<int, WindowSnapshotCallback> PendingSnapshotMap;
1158 PendingSnapshotMap pending_snapshots_;
1160 // This field stores drag/drop related info for the event that is currently
1161 // being handled. If the current event results in starting a drag/drop
1162 // session, this info is sent to the browser along with other drag/drop info.
1163 DragEventSourceInfo possible_drag_event_info_;
1165 // NOTE: stats_collection_observer_ should be the last members because their
1166 // constructors call the AddObservers method of RenderViewImpl.
1167 scoped_ptr<StatsCollectionObserver> stats_collection_observer_;
1169 typedef std::map<cc::SharedBitmapId, cc::SharedBitmap*> BitmapMap;
1170 BitmapMap disambiguation_bitmaps_;
1172 // ---------------------------------------------------------------------------
1173 // ADDING NEW DATA? Please see if it fits appropriately in one of the above
1174 // sections rather than throwing it randomly at the end. If you're adding a
1175 // bunch of stuff, you should probably create a helper class and put your
1176 // data and methods on that to avoid bloating RenderView more. You can
1177 // use the Observer interface to filter IPC messages and receive frame change
1179 // ---------------------------------------------------------------------------
1181 DISALLOW_COPY_AND_ASSIGN(RenderViewImpl);
1184 } // namespace content
1186 #endif // CONTENT_RENDERER_RENDER_VIEW_IMPL_H_