OLD | NEW |
---|---|
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_FRAME_IMPL_H_ | 5 #ifndef CONTENT_RENDERER_RENDER_FRAME_IMPL_H_ |
6 #define CONTENT_RENDERER_RENDER_FRAME_IMPL_H_ | 6 #define CONTENT_RENDERER_RENDER_FRAME_IMPL_H_ |
7 | 7 |
8 #include <stddef.h> | 8 #include <stddef.h> |
9 #include <stdint.h> | 9 #include <stdint.h> |
10 | 10 |
11 #include <string> | 11 #include <string> |
12 #include <vector> | 12 #include <vector> |
13 | 13 |
14 #include "base/files/file_path.h" | 14 #include "base/files/file_path.h" |
15 #include "base/gtest_prod_util.h" | 15 #include "base/gtest_prod_util.h" |
16 #include "base/id_map.h" | 16 #include "base/id_map.h" |
17 #include "base/macros.h" | 17 #include "base/macros.h" |
18 #include "base/memory/linked_ptr.h" | 18 #include "base/memory/linked_ptr.h" |
19 #include "base/memory/scoped_ptr.h" | 19 #include "base/memory/scoped_ptr.h" |
20 #include "base/memory/weak_ptr.h" | 20 #include "base/memory/weak_ptr.h" |
21 #include "base/observer_list.h" | 21 #include "base/observer_list.h" |
22 #include "base/process/process_handle.h" | 22 #include "base/process/process_handle.h" |
23 #include "build/build_config.h" | 23 #include "build/build_config.h" |
24 #include "content/common/accessibility_mode_enums.h" | 24 #include "content/common/accessibility_mode_enums.h" |
25 #include "content/common/frame_message_enums.h" | 25 #include "content/common/frame_message_enums.h" |
26 #include "content/common/mojo/service_registry_impl.h" | 26 #include "content/common/mojo/service_registry_impl.h" |
27 #include "content/public/common/console_message_level.h" | 27 #include "content/public/common/console_message_level.h" |
28 #include "content/public/common/javascript_message_type.h" | 28 #include "content/public/common/javascript_message_type.h" |
29 #include "content/public/common/referrer.h" | 29 #include "content/public/common/referrer.h" |
30 #include "content/public/common/stop_find_action.h" | |
30 #include "content/public/renderer/render_frame.h" | 31 #include "content/public/renderer/render_frame.h" |
31 #include "content/renderer/render_frame_proxy.h" | 32 #include "content/renderer/render_frame_proxy.h" |
32 #include "content/renderer/renderer_webcookiejar_impl.h" | 33 #include "content/renderer/renderer_webcookiejar_impl.h" |
33 #include "ipc/ipc_message.h" | 34 #include "ipc/ipc_message.h" |
34 #include "ipc/ipc_platform_file.h" | 35 #include "ipc/ipc_platform_file.h" |
35 #include "media/blink/webmediaplayer_delegate.h" | 36 #include "media/blink/webmediaplayer_delegate.h" |
36 #include "media/blink/webmediaplayer_params.h" | 37 #include "media/blink/webmediaplayer_params.h" |
37 #include "mojo/shell/public/interfaces/service_provider.mojom.h" | 38 #include "mojo/shell/public/interfaces/service_provider.mojom.h" |
38 #include "mojo/shell/public/interfaces/shell.mojom.h" | 39 #include "mojo/shell/public/interfaces/shell.mojom.h" |
39 #include "third_party/WebKit/public/platform/WebFocusType.h" | 40 #include "third_party/WebKit/public/platform/WebFocusType.h" |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
73 class WebMouseEvent; | 74 class WebMouseEvent; |
74 class WebContentDecryptionModule; | 75 class WebContentDecryptionModule; |
75 class WebMediaPlayer; | 76 class WebMediaPlayer; |
76 class WebPresentationClient; | 77 class WebPresentationClient; |
77 class WebPushClient; | 78 class WebPushClient; |
78 class WebSecurityOrigin; | 79 class WebSecurityOrigin; |
79 class WebWakeLockClient; | 80 class WebWakeLockClient; |
80 struct WebCompositionUnderline; | 81 struct WebCompositionUnderline; |
81 struct WebContextMenuData; | 82 struct WebContextMenuData; |
82 struct WebCursorInfo; | 83 struct WebCursorInfo; |
84 struct WebFindOptions; | |
83 struct WebScreenInfo; | 85 struct WebScreenInfo; |
84 } | 86 } |
85 | 87 |
86 namespace gfx { | 88 namespace gfx { |
87 class Point; | 89 class Point; |
88 class Range; | 90 class Range; |
89 class Rect; | 91 class Rect; |
90 } | 92 } |
91 | 93 |
92 namespace media { | 94 namespace media { |
(...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
281 // The focused node changed to |node|. If focus was lost from this frame, | 283 // The focused node changed to |node|. If focus was lost from this frame, |
282 // |node| will be null. | 284 // |node| will be null. |
283 void FocusedNodeChanged(const blink::WebNode& node); | 285 void FocusedNodeChanged(const blink::WebNode& node); |
284 | 286 |
285 // TODO(dmazzoni): the only reason this is here is to plumb it through to | 287 // TODO(dmazzoni): the only reason this is here is to plumb it through to |
286 // RendererAccessibility. It should use the RenderFrameObserver method, once | 288 // RendererAccessibility. It should use the RenderFrameObserver method, once |
287 // blink has a separate accessibility tree per frame. | 289 // blink has a separate accessibility tree per frame. |
288 void FocusedNodeChangedForAccessibility(const blink::WebNode& node); | 290 void FocusedNodeChangedForAccessibility(const blink::WebNode& node); |
289 | 291 |
290 #if defined(ENABLE_PLUGINS) | 292 #if defined(ENABLE_PLUGINS) |
293 // Get/set the plugin which will be used as to handle document find requests. | |
Charlie Reis
2016/01/21 00:02:28
nit: Drop "as"?
paulmeyer
2016/01/21 14:25:46
Done. In my defense, I didn't write all these bad
| |
294 void set_plugin_find_handler(PepperPluginInstanceImpl* plugin) { | |
295 plugin_find_handler_ = plugin; | |
296 } | |
297 PepperPluginInstanceImpl* plugin_find_handler() { | |
298 return plugin_find_handler_; | |
299 } | |
300 | |
291 // Notification that a PPAPI plugin has been created. | 301 // Notification that a PPAPI plugin has been created. |
292 void PepperPluginCreated(RendererPpapiHost* host); | 302 void PepperPluginCreated(RendererPpapiHost* host); |
293 | 303 |
294 // Notifies that |instance| has changed the cursor. | 304 // Notifies that |instance| has changed the cursor. |
295 // This will update the cursor appearance if it is currently over the plugin | 305 // This will update the cursor appearance if it is currently over the plugin |
296 // instance. | 306 // instance. |
297 void PepperDidChangeCursor(PepperPluginInstanceImpl* instance, | 307 void PepperDidChangeCursor(PepperPluginInstanceImpl* instance, |
298 const blink::WebCursorInfo& cursor); | 308 const blink::WebCursorInfo& cursor); |
299 | 309 |
300 // Notifies that |instance| has received a mouse event. | 310 // Notifies that |instance| has received a mouse event. |
(...skipping 465 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
766 void OnSnapshotAccessibilityTree(int callback_id); | 776 void OnSnapshotAccessibilityTree(int callback_id); |
767 void OnUpdateOpener(int opener_routing_id); | 777 void OnUpdateOpener(int opener_routing_id); |
768 void OnDidUpdateSandboxFlags(blink::WebSandboxFlags flags); | 778 void OnDidUpdateSandboxFlags(blink::WebSandboxFlags flags); |
769 void OnSetFrameOwnerProperties( | 779 void OnSetFrameOwnerProperties( |
770 const blink::WebFrameOwnerProperties& frame_owner_properties); | 780 const blink::WebFrameOwnerProperties& frame_owner_properties); |
771 void OnAdvanceFocus(blink::WebFocusType type, int32_t source_routing_id); | 781 void OnAdvanceFocus(blink::WebFocusType type, int32_t source_routing_id); |
772 void OnSetFocusedFrame(); | 782 void OnSetFocusedFrame(); |
773 void OnTextTrackSettingsChanged( | 783 void OnTextTrackSettingsChanged( |
774 const FrameMsg_TextTrackSettings_Params& params); | 784 const FrameMsg_TextTrackSettings_Params& params); |
775 void OnPostMessageEvent(const FrameMsg_PostMessage_Params& params); | 785 void OnPostMessageEvent(const FrameMsg_PostMessage_Params& params); |
776 #if defined(OS_ANDROID) | |
777 void OnSelectPopupMenuItems(bool canceled, | |
778 const std::vector<int>& selected_indices); | |
779 #elif defined(OS_MACOSX) | |
780 void OnSelectPopupMenuItem(int selected_index); | |
781 void OnCopyToFindPboard(); | |
782 #endif | |
783 | |
784 void OnCommitNavigation(const ResourceResponseHead& response, | 786 void OnCommitNavigation(const ResourceResponseHead& response, |
785 const GURL& stream_url, | 787 const GURL& stream_url, |
786 const CommonNavigationParams& common_params, | 788 const CommonNavigationParams& common_params, |
787 const RequestNavigationParams& request_params); | 789 const RequestNavigationParams& request_params); |
788 void OnFailedNavigation(const CommonNavigationParams& common_params, | 790 void OnFailedNavigation(const CommonNavigationParams& common_params, |
789 const RequestNavigationParams& request_params, | 791 const RequestNavigationParams& request_params, |
790 bool has_stale_copy_in_cache, | 792 bool has_stale_copy_in_cache, |
791 int error_code); | 793 int error_code); |
792 void OnGetSavableResourceLinks(); | 794 void OnGetSavableResourceLinks(); |
793 void OnGetSerializedHtmlWithLocalLinks( | 795 void OnGetSerializedHtmlWithLocalLinks( |
794 const std::map<GURL, base::FilePath>& url_to_local_path); | 796 const std::map<GURL, base::FilePath>& url_to_local_path); |
795 void OnSerializeAsMHTML(const FrameMsg_SerializeAsMHTML_Params& params); | 797 void OnSerializeAsMHTML(const FrameMsg_SerializeAsMHTML_Params& params); |
798 void OnFind(int request_id, | |
799 const base::string16& search_text, | |
800 const blink::WebFindOptions& options); | |
801 void OnStopFinding(StopFindAction action); | |
802 #if defined(OS_ANDROID) | |
803 void OnActivateNearestFindResult(int request_id, float x, float y); | |
804 void OnFindMatchRects(int current_version); | |
805 void OnSelectPopupMenuItems(bool canceled, | |
806 const std::vector<int>& selected_indices); | |
807 #elif defined(OS_MACOSX) | |
808 void OnSelectPopupMenuItem(int selected_index); | |
809 void OnCopyToFindPboard(); | |
810 #endif | |
796 | 811 |
797 // Requests that the browser process navigates to |url|. If | 812 // Requests that the browser process navigates to |url|. If |
798 // |is_history_navigation_in_new_child| is true, the browser process should | 813 // |is_history_navigation_in_new_child| is true, the browser process should |
799 // look for a matching FrameNavigationEntry in the last committed entry to use | 814 // look for a matching FrameNavigationEntry in the last committed entry to use |
800 // instead of |url|. | 815 // instead of |url|. |
801 void OpenURL(const GURL& url, | 816 void OpenURL(const GURL& url, |
802 const Referrer& referrer, | 817 const Referrer& referrer, |
803 blink::WebNavigationPolicy policy, | 818 blink::WebNavigationPolicy policy, |
804 bool should_replace_current_entry, | 819 bool should_replace_current_entry, |
805 bool is_history_navigation_in_new_child); | 820 bool is_history_navigation_in_new_child); |
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
937 void RegisterMojoServices(); | 952 void RegisterMojoServices(); |
938 | 953 |
939 // Connects to a Mojo application and returns a proxy to its exposed | 954 // Connects to a Mojo application and returns a proxy to its exposed |
940 // ServiceProvider. | 955 // ServiceProvider. |
941 mojo::ServiceProviderPtr ConnectToApplication(const GURL& url); | 956 mojo::ServiceProviderPtr ConnectToApplication(const GURL& url); |
942 | 957 |
943 // Returns the media delegate for WebMediaPlayer usage. If | 958 // Returns the media delegate for WebMediaPlayer usage. If |
944 // |media_player_delegate_| is NULL, one is created. | 959 // |media_player_delegate_| is NULL, one is created. |
945 media::RendererWebMediaPlayerDelegate* GetWebMediaPlayerDelegate(); | 960 media::RendererWebMediaPlayerDelegate* GetWebMediaPlayerDelegate(); |
946 | 961 |
962 // Called to get the WebPlugin to handle find requests in the document. | |
963 // Returns nullptr if there is no such WebPlugin. | |
964 blink::WebPlugin* GetWebPluginForFind(); | |
965 | |
966 // Sends a reply to the current find operation handling if it was a | |
967 // synchronous find request. | |
968 void SendFindReply(int request_id, | |
969 int match_count, | |
970 int ordinal, | |
971 const blink::WebRect& selection_rect, | |
972 bool final_status_update); | |
973 | |
947 // Stores the WebLocalFrame we are associated with. This is null from the | 974 // Stores the WebLocalFrame we are associated with. This is null from the |
948 // constructor until BindToWebFrame is called, and it is null after | 975 // constructor until BindToWebFrame is called, and it is null after |
949 // frameDetached is called until destruction (which is asynchronous in the | 976 // frameDetached is called until destruction (which is asynchronous in the |
950 // case of the main frame, but not subframes). | 977 // case of the main frame, but not subframes). |
951 blink::WebLocalFrame* frame_; | 978 blink::WebLocalFrame* frame_; |
952 | 979 |
953 // Boolean value indicating whether this RenderFrameImpl object is for the | 980 // Boolean value indicating whether this RenderFrameImpl object is for the |
954 // main frame or not. It remains accurate during destruction, even when | 981 // main frame or not. It remains accurate during destruction, even when |
955 // |frame_| has been invalidated. | 982 // |frame_| has been invalidated. |
956 bool is_main_frame_; | 983 bool is_main_frame_; |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1002 // Stores the current history item for this frame, so that updates to it can | 1029 // Stores the current history item for this frame, so that updates to it can |
1003 // be reported to the browser process via SendUpdateState. | 1030 // be reported to the browser process via SendUpdateState. |
1004 blink::WebHistoryItem current_history_item_; | 1031 blink::WebHistoryItem current_history_item_; |
1005 | 1032 |
1006 #if defined(ENABLE_PLUGINS) | 1033 #if defined(ENABLE_PLUGINS) |
1007 // Current text input composition text. Empty if no composition is in | 1034 // Current text input composition text. Empty if no composition is in |
1008 // progress. | 1035 // progress. |
1009 base::string16 pepper_composition_text_; | 1036 base::string16 pepper_composition_text_; |
1010 | 1037 |
1011 PluginPowerSaverHelper* plugin_power_saver_helper_; | 1038 PluginPowerSaverHelper* plugin_power_saver_helper_; |
1039 | |
1040 PepperPluginInstanceImpl* plugin_find_handler_; | |
1012 #endif | 1041 #endif |
1013 | 1042 |
1014 RendererWebCookieJarImpl cookie_jar_; | 1043 RendererWebCookieJarImpl cookie_jar_; |
1015 | 1044 |
1016 // All the registered observers. | 1045 // All the registered observers. |
1017 base::ObserverList<RenderFrameObserver> observers_; | 1046 base::ObserverList<RenderFrameObserver> observers_; |
1018 | 1047 |
1019 scoped_refptr<ChildFrameCompositingHelper> compositing_helper_; | 1048 scoped_refptr<ChildFrameCompositingHelper> compositing_helper_; |
1020 | 1049 |
1021 // The node that the context menu was pressed over. | 1050 // The node that the context menu was pressed over. |
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1166 #endif | 1195 #endif |
1167 | 1196 |
1168 base::WeakPtrFactory<RenderFrameImpl> weak_factory_; | 1197 base::WeakPtrFactory<RenderFrameImpl> weak_factory_; |
1169 | 1198 |
1170 DISALLOW_COPY_AND_ASSIGN(RenderFrameImpl); | 1199 DISALLOW_COPY_AND_ASSIGN(RenderFrameImpl); |
1171 }; | 1200 }; |
1172 | 1201 |
1173 } // namespace content | 1202 } // namespace content |
1174 | 1203 |
1175 #endif // CONTENT_RENDERER_RENDER_FRAME_IMPL_H_ | 1204 #endif // CONTENT_RENDERER_RENDER_FRAME_IMPL_H_ |
OLD | NEW |