| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef CONTENT_RENDERER_RENDER_VIEW_IMPL_H_ | 5 #ifndef CONTENT_RENDERER_RENDER_VIEW_IMPL_H_ |
| 6 #define CONTENT_RENDERER_RENDER_VIEW_IMPL_H_ | 6 #define CONTENT_RENDERER_RENDER_VIEW_IMPL_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <deque> | 9 #include <deque> |
| 10 #include <map> | 10 #include <map> |
| (...skipping 23 matching lines...) Expand all Loading... |
| 34 #include "content/renderer/pepper_plugin_delegate_impl.h" | 34 #include "content/renderer/pepper_plugin_delegate_impl.h" |
| 35 #include "content/renderer/render_widget.h" | 35 #include "content/renderer/render_widget.h" |
| 36 #include "ipc/ipc_platform_file.h" | 36 #include "ipc/ipc_platform_file.h" |
| 37 #include "third_party/WebKit/Source/WebKit/chromium/public/WebConsoleMessage.h" | 37 #include "third_party/WebKit/Source/WebKit/chromium/public/WebConsoleMessage.h" |
| 38 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebFileSyste
m.h" | 38 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebFileSyste
m.h" |
| 39 #include "third_party/WebKit/Source/WebKit/chromium/public/WebFrameClient.h" | 39 #include "third_party/WebKit/Source/WebKit/chromium/public/WebFrameClient.h" |
| 40 #include "third_party/WebKit/Source/WebKit/chromium/public/WebIconURL.h" | 40 #include "third_party/WebKit/Source/WebKit/chromium/public/WebIconURL.h" |
| 41 #include "third_party/WebKit/Source/WebKit/chromium/public/WebNode.h" | 41 #include "third_party/WebKit/Source/WebKit/chromium/public/WebNode.h" |
| 42 #include "third_party/WebKit/Source/WebKit/chromium/public/WebPageSerializerClie
nt.h" | 42 #include "third_party/WebKit/Source/WebKit/chromium/public/WebPageSerializerClie
nt.h" |
| 43 #include "third_party/WebKit/Source/WebKit/chromium/public/WebPageVisibilityStat
e.h" | 43 #include "third_party/WebKit/Source/WebKit/chromium/public/WebPageVisibilityStat
e.h" |
| 44 #include "third_party/WebKit/Source/WebKit/chromium/public/WebSecurityOrigin.h" |
| 44 #include "third_party/WebKit/Source/WebKit/chromium/public/WebTextDirection.h" | 45 #include "third_party/WebKit/Source/WebKit/chromium/public/WebTextDirection.h" |
| 45 #include "third_party/WebKit/Source/WebKit/chromium/public/WebViewClient.h" | 46 #include "third_party/WebKit/Source/WebKit/chromium/public/WebViewClient.h" |
| 46 #include "third_party/WebKit/Source/WebKit/chromium/public/WebNavigationType.h" | 47 #include "third_party/WebKit/Source/WebKit/chromium/public/WebNavigationType.h" |
| 47 #include "ui/base/javascript_message_type.h" | 48 #include "ui/base/javascript_message_type.h" |
| 48 #include "ui/gfx/surface/transport_dib.h" | 49 #include "ui/gfx/surface/transport_dib.h" |
| 49 #include "webkit/glue/webpreferences.h" | 50 #include "webkit/glue/webpreferences.h" |
| 50 #include "webkit/media/webmediaplayer_delegate.h" | 51 #include "webkit/media/webmediaplayer_delegate.h" |
| 51 #include "webkit/plugins/npapi/webplugin_page_delegate.h" | 52 #include "webkit/plugins/npapi/webplugin_page_delegate.h" |
| 52 | 53 |
| 53 #if defined(OS_WIN) | 54 #if defined(OS_WIN) |
| (...skipping 13 matching lines...) Expand all Loading... |
| 67 class LoadProgressTracker; | 68 class LoadProgressTracker; |
| 68 class MediaStreamImpl; | 69 class MediaStreamImpl; |
| 69 class NotificationProvider; | 70 class NotificationProvider; |
| 70 class PepperDeviceTest; | 71 class PepperDeviceTest; |
| 71 struct PP_NetAddress_Private; | 72 struct PP_NetAddress_Private; |
| 72 class RenderWidgetFullscreenPepper; | 73 class RenderWidgetFullscreenPepper; |
| 73 class RendererAccessibility; | 74 class RendererAccessibility; |
| 74 class SkBitmap; | 75 class SkBitmap; |
| 75 class SpeechInputDispatcher; | 76 class SpeechInputDispatcher; |
| 76 struct ViewMsg_Navigate_Params; | 77 struct ViewMsg_Navigate_Params; |
| 78 struct ViewMsg_PostMessage_Params; |
| 77 struct ViewMsg_StopFinding_Params; | 79 struct ViewMsg_StopFinding_Params; |
| 78 struct ViewMsg_SwapOut_Params; | 80 struct ViewMsg_SwapOut_Params; |
| 79 struct WebDropData; | 81 struct WebDropData; |
| 80 class WebPluginDelegateProxy; | 82 class WebPluginDelegateProxy; |
| 81 class WebUIBindings; | 83 class WebUIBindings; |
| 82 | 84 |
| 83 namespace content { | 85 namespace content { |
| 84 class DocumentState; | 86 class DocumentState; |
| 85 class P2PSocketDispatcher; | 87 class P2PSocketDispatcher; |
| 86 class RenderViewObserver; | 88 class RenderViewObserver; |
| (...skipping 16 matching lines...) Expand all Loading... |
| 103 | 105 |
| 104 namespace webkit_glue { | 106 namespace webkit_glue { |
| 105 struct CustomContextMenuContext; | 107 struct CustomContextMenuContext; |
| 106 class ImageResourceFetcher; | 108 class ImageResourceFetcher; |
| 107 class ResourceFetcher; | 109 class ResourceFetcher; |
| 108 } | 110 } |
| 109 | 111 |
| 110 namespace WebKit { | 112 namespace WebKit { |
| 111 class WebApplicationCacheHost; | 113 class WebApplicationCacheHost; |
| 112 class WebApplicationCacheHostClient; | 114 class WebApplicationCacheHostClient; |
| 115 class WebDOMMessageEvent; |
| 113 class WebDataSource; | 116 class WebDataSource; |
| 114 class WebDragData; | 117 class WebDragData; |
| 115 class WebGeolocationClient; | 118 class WebGeolocationClient; |
| 116 class WebIconURL; | 119 class WebIconURL; |
| 117 class WebImage; | 120 class WebImage; |
| 118 class WebMediaPlayer; | 121 class WebMediaPlayer; |
| 119 class WebMediaPlayerClient; | 122 class WebMediaPlayerClient; |
| 120 class WebMouseEvent; | 123 class WebMouseEvent; |
| 121 class WebSpeechInputController; | 124 class WebSpeechInputController; |
| 122 class WebSpeechInputListener; | 125 class WebSpeechInputListener; |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 166 // we treat this RenderView as a top level window). | 169 // we treat this RenderView as a top level window). |
| 167 CONTENT_EXPORT static RenderViewImpl* Create( | 170 CONTENT_EXPORT static RenderViewImpl* Create( |
| 168 gfx::NativeViewId parent_hwnd, | 171 gfx::NativeViewId parent_hwnd, |
| 169 int32 opener_id, | 172 int32 opener_id, |
| 170 const content::RendererPreferences& renderer_prefs, | 173 const content::RendererPreferences& renderer_prefs, |
| 171 const WebPreferences& webkit_prefs, | 174 const WebPreferences& webkit_prefs, |
| 172 SharedRenderViewCounter* counter, | 175 SharedRenderViewCounter* counter, |
| 173 int32 routing_id, | 176 int32 routing_id, |
| 174 int64 session_storage_namespace_id, | 177 int64 session_storage_namespace_id, |
| 175 const string16& frame_name, | 178 const string16& frame_name, |
| 179 bool is_renderer_created, |
| 176 int32 next_page_id); | 180 int32 next_page_id); |
| 177 | 181 |
| 178 // Returns the RenderViewImpl containing the given WebView. | 182 // Returns the RenderViewImpl containing the given WebView. |
| 179 CONTENT_EXPORT static RenderViewImpl* FromWebView(WebKit::WebView* webview); | 183 CONTENT_EXPORT static RenderViewImpl* FromWebView(WebKit::WebView* webview); |
| 180 | 184 |
| 181 // May return NULL when the view is closing. | 185 // May return NULL when the view is closing. |
| 182 CONTENT_EXPORT WebKit::WebView* webview() const; | 186 CONTENT_EXPORT WebKit::WebView* webview() const; |
| 183 | 187 |
| 184 // Called by a GraphicsContext associated with this view when swapbuffers | 188 // Called by a GraphicsContext associated with this view when swapbuffers |
| 185 // is posted, completes or is aborted. | 189 // is posted, completes or is aborted. |
| (...skipping 337 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 523 WebKit::WebStorageQuotaType type, | 527 WebKit::WebStorageQuotaType type, |
| 524 unsigned long long requested_size, | 528 unsigned long long requested_size, |
| 525 WebKit::WebStorageQuotaCallbacks* callbacks); | 529 WebKit::WebStorageQuotaCallbacks* callbacks); |
| 526 | 530 |
| 527 virtual void registerIntentService( | 531 virtual void registerIntentService( |
| 528 WebKit::WebFrame* frame, | 532 WebKit::WebFrame* frame, |
| 529 const WebKit::WebIntentServiceInfo& service); | 533 const WebKit::WebIntentServiceInfo& service); |
| 530 virtual void dispatchIntent(WebKit::WebFrame* frame, | 534 virtual void dispatchIntent(WebKit::WebFrame* frame, |
| 531 const WebKit::WebIntent& intent); | 535 const WebKit::WebIntent& intent); |
| 532 | 536 |
| 537 virtual bool willCheckAndDispatchMessageEvent( |
| 538 WebKit::WebFrame* source, |
| 539 WebKit::WebSecurityOrigin targetOrigin, |
| 540 WebKit::WebDOMMessageEvent event) OVERRIDE; |
| 541 |
| 533 // WebKit::WebPageSerializerClient implementation ---------------------------- | 542 // WebKit::WebPageSerializerClient implementation ---------------------------- |
| 534 | 543 |
| 535 virtual void didSerializeDataForFrame( | 544 virtual void didSerializeDataForFrame( |
| 536 const WebKit::WebURL& frame_url, | 545 const WebKit::WebURL& frame_url, |
| 537 const WebKit::WebCString& data, | 546 const WebKit::WebCString& data, |
| 538 PageSerializationStatus status) OVERRIDE; | 547 PageSerializationStatus status) OVERRIDE; |
| 539 | 548 |
| 540 // content::RenderView implementation ---------------------------------------- | 549 // content::RenderView implementation ---------------------------------------- |
| 541 | 550 |
| 542 virtual bool Send(IPC::Message* message) OVERRIDE; | 551 virtual bool Send(IPC::Message* message) OVERRIDE; |
| (...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 671 }; | 680 }; |
| 672 | 681 |
| 673 RenderViewImpl(gfx::NativeViewId parent_hwnd, | 682 RenderViewImpl(gfx::NativeViewId parent_hwnd, |
| 674 int32 opener_id, | 683 int32 opener_id, |
| 675 const content::RendererPreferences& renderer_prefs, | 684 const content::RendererPreferences& renderer_prefs, |
| 676 const WebPreferences& webkit_prefs, | 685 const WebPreferences& webkit_prefs, |
| 677 SharedRenderViewCounter* counter, | 686 SharedRenderViewCounter* counter, |
| 678 int32 routing_id, | 687 int32 routing_id, |
| 679 int64 session_storage_namespace_id, | 688 int64 session_storage_namespace_id, |
| 680 const string16& frame_name, | 689 const string16& frame_name, |
| 690 bool is_renderer_created, |
| 681 int32 next_page_id); | 691 int32 next_page_id); |
| 682 | 692 |
| 683 // Do not delete directly. This class is reference counted. | 693 // Do not delete directly. This class is reference counted. |
| 684 virtual ~RenderViewImpl(); | 694 virtual ~RenderViewImpl(); |
| 685 | 695 |
| 686 void UpdateURL(WebKit::WebFrame* frame); | 696 void UpdateURL(WebKit::WebFrame* frame); |
| 687 void UpdateTitle(WebKit::WebFrame* frame, const string16& title, | 697 void UpdateTitle(WebKit::WebFrame* frame, const string16& title, |
| 688 WebKit::WebTextDirection title_direction); | 698 WebKit::WebTextDirection title_direction); |
| 689 void UpdateSessionHistory(WebKit::WebFrame* frame); | 699 void UpdateSessionHistory(WebKit::WebFrame* frame); |
| 690 | 700 |
| (...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 792 void OnMediaPlayerActionAt(const gfx::Point& location, | 802 void OnMediaPlayerActionAt(const gfx::Point& location, |
| 793 const WebKit::WebMediaPlayerAction& action); | 803 const WebKit::WebMediaPlayerAction& action); |
| 794 void OnMouseLockLost(); | 804 void OnMouseLockLost(); |
| 795 void OnMoveOrResizeStarted(); | 805 void OnMoveOrResizeStarted(); |
| 796 CONTENT_EXPORT void OnNavigate(const ViewMsg_Navigate_Params& params); | 806 CONTENT_EXPORT void OnNavigate(const ViewMsg_Navigate_Params& params); |
| 797 void OnPaste(); | 807 void OnPaste(); |
| 798 void OnPasteAndMatchStyle(); | 808 void OnPasteAndMatchStyle(); |
| 799 #if defined(OS_MACOSX) | 809 #if defined(OS_MACOSX) |
| 800 void OnPluginImeCompositionCompleted(const string16& text, int plugin_id); | 810 void OnPluginImeCompositionCompleted(const string16& text, int plugin_id); |
| 801 #endif | 811 #endif |
| 812 void OnPostMessage(int64 frame_id, const ViewMsg_PostMessage_Params& params); |
| 802 void OnRedo(); | 813 void OnRedo(); |
| 803 void OnReloadFrame(); | 814 void OnReloadFrame(); |
| 804 void OnReplace(const string16& text); | 815 void OnReplace(const string16& text); |
| 805 void OnResetPageEncodingToDefault(); | 816 void OnResetPageEncodingToDefault(); |
| 806 void OnScriptEvalRequest(const string16& frame_xpath, | 817 void OnScriptEvalRequest(const string16& frame_xpath, |
| 807 const string16& jscript, | 818 const string16& jscript, |
| 808 int id, | 819 int id, |
| 809 bool notify_result); | 820 bool notify_result); |
| 810 void OnSelectAll(); | 821 void OnSelectAll(); |
| 811 void OnSelectRange(const gfx::Point& start, const gfx::Point& end); | 822 void OnSelectRange(const gfx::Point& start, const gfx::Point& end); |
| (...skipping 378 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1190 scoped_ptr<LoadProgressTracker> load_progress_tracker_; | 1201 scoped_ptr<LoadProgressTracker> load_progress_tracker_; |
| 1191 | 1202 |
| 1192 // All the registered observers. We expect this list to be small, so vector | 1203 // All the registered observers. We expect this list to be small, so vector |
| 1193 // is fine. | 1204 // is fine. |
| 1194 ObserverList<content::RenderViewObserver> observers_; | 1205 ObserverList<content::RenderViewObserver> observers_; |
| 1195 | 1206 |
| 1196 // Used to inform didChangeSelection() when it is called in the context | 1207 // Used to inform didChangeSelection() when it is called in the context |
| 1197 // of handling a ViewMsg_SelectRange IPC. | 1208 // of handling a ViewMsg_SelectRange IPC. |
| 1198 bool handling_select_range_; | 1209 bool handling_select_range_; |
| 1199 | 1210 |
| 1211 // The content frame id of the frame we're a proxy for, or -1 if none. |
| 1212 // This should be valid when the RV is swapped out, and -1 when swapped in. |
| 1213 int64 active_content_frame_id_; |
| 1214 |
| 1200 // Plugins ------------------------------------------------------------------- | 1215 // Plugins ------------------------------------------------------------------- |
| 1201 | 1216 |
| 1202 // All the currently active plugin delegates for this RenderView; kept so | 1217 // All the currently active plugin delegates for this RenderView; kept so |
| 1203 // that we can enumerate them to send updates about things like window | 1218 // that we can enumerate them to send updates about things like window |
| 1204 // location or tab focus and visibily. These are non-owning references. | 1219 // location or tab focus and visibily. These are non-owning references. |
| 1205 std::set<WebPluginDelegateProxy*> plugin_delegates_; | 1220 std::set<WebPluginDelegateProxy*> plugin_delegates_; |
| 1206 | 1221 |
| 1207 #if defined(OS_WIN) | 1222 #if defined(OS_WIN) |
| 1208 // The ID of the focused NPAPI plug-in. | 1223 // The ID of the focused NPAPI plug-in. |
| 1209 int focused_plugin_id_; | 1224 int focused_plugin_id_; |
| 1210 #endif | 1225 #endif |
| 1211 | 1226 |
| 1212 // NOTE: pepper_delegate_ should be last member because its constructor calls | 1227 // NOTE: pepper_delegate_ should be last member because its constructor calls |
| 1213 // AddObservers method of RenderViewImpl from c-tor. | 1228 // AddObservers method of RenderViewImpl from c-tor. |
| 1214 PepperPluginDelegateImpl pepper_delegate_; | 1229 PepperPluginDelegateImpl pepper_delegate_; |
| 1215 | 1230 |
| 1216 // --------------------------------------------------------------------------- | 1231 // --------------------------------------------------------------------------- |
| 1217 // ADDING NEW DATA? Please see if it fits appropriately in one of the above | 1232 // ADDING NEW DATA? Please see if it fits appropriately in one of the above |
| 1218 // sections rather than throwing it randomly at the end. If you're adding a | 1233 // sections rather than throwing it randomly at the end. If you're adding a |
| 1219 // bunch of stuff, you should probably create a helper class and put your | 1234 // bunch of stuff, you should probably create a helper class and put your |
| 1220 // data and methods on that to avoid bloating RenderView more. You can | 1235 // data and methods on that to avoid bloating RenderView more. You can |
| 1221 // use the Observer interface to filter IPC messages and receive frame change | 1236 // use the Observer interface to filter IPC messages and receive frame change |
| 1222 // notifications. | 1237 // notifications. |
| 1223 // --------------------------------------------------------------------------- | 1238 // --------------------------------------------------------------------------- |
| 1224 | 1239 |
| 1225 DISALLOW_COPY_AND_ASSIGN(RenderViewImpl); | 1240 DISALLOW_COPY_AND_ASSIGN(RenderViewImpl); |
| 1226 }; | 1241 }; |
| 1227 | 1242 |
| 1228 #endif // CONTENT_RENDERER_RENDER_VIEW_IMPL_H_ | 1243 #endif // CONTENT_RENDERER_RENDER_VIEW_IMPL_H_ |
| OLD | NEW |