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. | |
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 466 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
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) | 786 #if defined(OS_ANDROID) |
787 void OnActivateNearestFindResult(int request_id, float x, float y); | |
788 void OnFindMatchRects(int current_version); | |
nasko
2016/01/20 21:43:32
Would you do me a favor and move the #ifdef sectio
paulmeyer
2016/01/20 22:54:15
Done.
nasko
2016/01/20 23:38:26
Thanks!
| |
777 void OnSelectPopupMenuItems(bool canceled, | 789 void OnSelectPopupMenuItems(bool canceled, |
778 const std::vector<int>& selected_indices); | 790 const std::vector<int>& selected_indices); |
779 #elif defined(OS_MACOSX) | 791 #elif defined(OS_MACOSX) |
780 void OnSelectPopupMenuItem(int selected_index); | 792 void OnSelectPopupMenuItem(int selected_index); |
781 void OnCopyToFindPboard(); | 793 void OnCopyToFindPboard(); |
782 #endif | 794 #endif |
783 | 795 |
784 void OnCommitNavigation(const ResourceResponseHead& response, | 796 void OnCommitNavigation(const ResourceResponseHead& response, |
785 const GURL& stream_url, | 797 const GURL& stream_url, |
786 const CommonNavigationParams& common_params, | 798 const CommonNavigationParams& common_params, |
787 const RequestNavigationParams& request_params); | 799 const RequestNavigationParams& request_params); |
788 void OnFailedNavigation(const CommonNavigationParams& common_params, | 800 void OnFailedNavigation(const CommonNavigationParams& common_params, |
789 const RequestNavigationParams& request_params, | 801 const RequestNavigationParams& request_params, |
790 bool has_stale_copy_in_cache, | 802 bool has_stale_copy_in_cache, |
791 int error_code); | 803 int error_code); |
792 void OnGetSavableResourceLinks(); | 804 void OnGetSavableResourceLinks(); |
793 void OnGetSerializedHtmlWithLocalLinks( | 805 void OnGetSerializedHtmlWithLocalLinks( |
794 const std::map<GURL, base::FilePath>& url_to_local_path); | 806 const std::map<GURL, base::FilePath>& url_to_local_path); |
795 void OnSerializeAsMHTML(const FrameMsg_SerializeAsMHTML_Params& params); | 807 void OnSerializeAsMHTML(const FrameMsg_SerializeAsMHTML_Params& params); |
808 void OnFind(int request_id, | |
809 const base::string16& search_text, | |
810 const blink::WebFindOptions& options); | |
811 void OnStopFinding(StopFindAction action); | |
796 | 812 |
797 // Requests that the browser process navigates to |url|. If | 813 // Requests that the browser process navigates to |url|. If |
798 // |is_history_navigation_in_new_child| is true, the browser process should | 814 // |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 | 815 // look for a matching FrameNavigationEntry in the last committed entry to use |
800 // instead of |url|. | 816 // instead of |url|. |
801 void OpenURL(const GURL& url, | 817 void OpenURL(const GURL& url, |
802 const Referrer& referrer, | 818 const Referrer& referrer, |
803 blink::WebNavigationPolicy policy, | 819 blink::WebNavigationPolicy policy, |
804 bool should_replace_current_entry, | 820 bool should_replace_current_entry, |
805 bool is_history_navigation_in_new_child); | 821 bool is_history_navigation_in_new_child); |
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
937 void RegisterMojoServices(); | 953 void RegisterMojoServices(); |
938 | 954 |
939 // Connects to a Mojo application and returns a proxy to its exposed | 955 // Connects to a Mojo application and returns a proxy to its exposed |
940 // ServiceProvider. | 956 // ServiceProvider. |
941 mojo::ServiceProviderPtr ConnectToApplication(const GURL& url); | 957 mojo::ServiceProviderPtr ConnectToApplication(const GURL& url); |
942 | 958 |
943 // Returns the media delegate for WebMediaPlayer usage. If | 959 // Returns the media delegate for WebMediaPlayer usage. If |
944 // |media_player_delegate_| is NULL, one is created. | 960 // |media_player_delegate_| is NULL, one is created. |
945 media::RendererWebMediaPlayerDelegate* GetWebMediaPlayerDelegate(); | 961 media::RendererWebMediaPlayerDelegate* GetWebMediaPlayerDelegate(); |
946 | 962 |
963 // Called to get the WebPlugin to handle find requests in the document. | |
964 // Returns NULL if there is no such WebPlugin. | |
nasko
2016/01/20 21:43:32
s/NULL/null/
paulmeyer
2016/01/20 22:54:15
Did you mean "nullptr"?
nasko
2016/01/20 23:38:26
I'm fine with "null" in comments as it is the conc
| |
965 blink::WebPlugin* GetWebPluginForFind(); | |
966 | |
967 // Sends a reply to the current find operation handling if it was a | |
968 // synchronous find request. | |
969 void SendFindReply(int request_id, | |
970 int match_count, | |
971 int ordinal, | |
972 const blink::WebRect& selection_rect, | |
973 bool final_status_update); | |
974 | |
947 // Stores the WebLocalFrame we are associated with. This is null from the | 975 // Stores the WebLocalFrame we are associated with. This is null from the |
948 // constructor until BindToWebFrame is called, and it is null after | 976 // constructor until BindToWebFrame is called, and it is null after |
949 // frameDetached is called until destruction (which is asynchronous in the | 977 // frameDetached is called until destruction (which is asynchronous in the |
950 // case of the main frame, but not subframes). | 978 // case of the main frame, but not subframes). |
951 blink::WebLocalFrame* frame_; | 979 blink::WebLocalFrame* frame_; |
952 | 980 |
953 // Boolean value indicating whether this RenderFrameImpl object is for the | 981 // Boolean value indicating whether this RenderFrameImpl object is for the |
954 // main frame or not. It remains accurate during destruction, even when | 982 // main frame or not. It remains accurate during destruction, even when |
955 // |frame_| has been invalidated. | 983 // |frame_| has been invalidated. |
956 bool is_main_frame_; | 984 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 | 1030 // Stores the current history item for this frame, so that updates to it can |
1003 // be reported to the browser process via SendUpdateState. | 1031 // be reported to the browser process via SendUpdateState. |
1004 blink::WebHistoryItem current_history_item_; | 1032 blink::WebHistoryItem current_history_item_; |
1005 | 1033 |
1006 #if defined(ENABLE_PLUGINS) | 1034 #if defined(ENABLE_PLUGINS) |
1007 // Current text input composition text. Empty if no composition is in | 1035 // Current text input composition text. Empty if no composition is in |
1008 // progress. | 1036 // progress. |
1009 base::string16 pepper_composition_text_; | 1037 base::string16 pepper_composition_text_; |
1010 | 1038 |
1011 PluginPowerSaverHelper* plugin_power_saver_helper_; | 1039 PluginPowerSaverHelper* plugin_power_saver_helper_; |
1040 | |
1041 PepperPluginInstanceImpl* plugin_find_handler_; | |
1012 #endif | 1042 #endif |
1013 | 1043 |
1014 RendererWebCookieJarImpl cookie_jar_; | 1044 RendererWebCookieJarImpl cookie_jar_; |
1015 | 1045 |
1016 // All the registered observers. | 1046 // All the registered observers. |
1017 base::ObserverList<RenderFrameObserver> observers_; | 1047 base::ObserverList<RenderFrameObserver> observers_; |
1018 | 1048 |
1019 scoped_refptr<ChildFrameCompositingHelper> compositing_helper_; | 1049 scoped_refptr<ChildFrameCompositingHelper> compositing_helper_; |
1020 | 1050 |
1021 // The node that the context menu was pressed over. | 1051 // The node that the context menu was pressed over. |
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1166 #endif | 1196 #endif |
1167 | 1197 |
1168 base::WeakPtrFactory<RenderFrameImpl> weak_factory_; | 1198 base::WeakPtrFactory<RenderFrameImpl> weak_factory_; |
1169 | 1199 |
1170 DISALLOW_COPY_AND_ASSIGN(RenderFrameImpl); | 1200 DISALLOW_COPY_AND_ASSIGN(RenderFrameImpl); |
1171 }; | 1201 }; |
1172 | 1202 |
1173 } // namespace content | 1203 } // namespace content |
1174 | 1204 |
1175 #endif // CONTENT_RENDERER_RENDER_FRAME_IMPL_H_ | 1205 #endif // CONTENT_RENDERER_RENDER_FRAME_IMPL_H_ |
OLD | NEW |