| 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 |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 44 #include "third_party/WebKit/public/web/WebDataSource.h" | 44 #include "third_party/WebKit/public/web/WebDataSource.h" |
| 45 #include "third_party/WebKit/public/web/WebFrameClient.h" | 45 #include "third_party/WebKit/public/web/WebFrameClient.h" |
| 46 #include "third_party/WebKit/public/web/WebFrameLoadType.h" | 46 #include "third_party/WebKit/public/web/WebFrameLoadType.h" |
| 47 #include "third_party/WebKit/public/web/WebFrameOwnerProperties.h" | 47 #include "third_party/WebKit/public/web/WebFrameOwnerProperties.h" |
| 48 #include "third_party/WebKit/public/web/WebFrameSerializerClient.h" | 48 #include "third_party/WebKit/public/web/WebFrameSerializerClient.h" |
| 49 #include "third_party/WebKit/public/web/WebHistoryCommitType.h" | 49 #include "third_party/WebKit/public/web/WebHistoryCommitType.h" |
| 50 #include "third_party/WebKit/public/web/WebMeaningfulLayout.h" | 50 #include "third_party/WebKit/public/web/WebMeaningfulLayout.h" |
| 51 #include "third_party/WebKit/public/web/WebScriptExecutionCallback.h" | 51 #include "third_party/WebKit/public/web/WebScriptExecutionCallback.h" |
| 52 #include "ui/gfx/range/range.h" | 52 #include "ui/gfx/range/range.h" |
| 53 #include "url/gurl.h" | 53 #include "url/gurl.h" |
| 54 #include "content/public/common/resource_response.h" |
| 55 #include "content/common/navigation_params.h" |
| 54 | 56 |
| 55 #if defined(ENABLE_PLUGINS) | 57 #if defined(ENABLE_PLUGINS) |
| 56 #include "content/renderer/pepper/plugin_power_saver_helper.h" | 58 #include "content/renderer/pepper/plugin_power_saver_helper.h" |
| 57 #endif | 59 #endif |
| 58 | 60 |
| 59 #if defined(OS_ANDROID) | 61 #if defined(OS_ANDROID) |
| 60 #include "content/renderer/media/android/renderer_media_player_manager.h" | 62 #include "content/renderer/media/android/renderer_media_player_manager.h" |
| 61 #endif | 63 #endif |
| 62 | 64 |
| 63 #if defined(ENABLE_MOJO_MEDIA) | 65 #if defined(ENABLE_MOJO_MEDIA) |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 133 class RendererMediaPlayerManager; | 135 class RendererMediaPlayerManager; |
| 134 class RendererMediaSessionManager; | 136 class RendererMediaSessionManager; |
| 135 class RendererPpapiHost; | 137 class RendererPpapiHost; |
| 136 class RenderFrameObserver; | 138 class RenderFrameObserver; |
| 137 class RenderViewImpl; | 139 class RenderViewImpl; |
| 138 class RenderWidget; | 140 class RenderWidget; |
| 139 class RenderWidgetFullscreenPepper; | 141 class RenderWidgetFullscreenPepper; |
| 140 class ScreenOrientationDispatcher; | 142 class ScreenOrientationDispatcher; |
| 141 class UserMediaClientImpl; | 143 class UserMediaClientImpl; |
| 142 class WakeLockDispatcher; | 144 class WakeLockDispatcher; |
| 143 struct CommonNavigationParams; | |
| 144 struct CustomContextMenuContext; | 145 struct CustomContextMenuContext; |
| 145 struct FrameReplicationState; | 146 struct FrameReplicationState; |
| 146 struct NavigationParams; | 147 struct NavigationParams; |
| 147 struct RequestNavigationParams; | |
| 148 struct ResourceResponseHead; | |
| 149 struct StartNavigationParams; | 148 struct StartNavigationParams; |
| 150 struct StreamOverrideParameters; | 149 struct StreamOverrideParameters; |
| 151 class VRDispatcher; | 150 class VRDispatcher; |
| 151 class RenderThreadImpl; |
| 152 | 152 |
| 153 class CONTENT_EXPORT RenderFrameImpl | 153 class CONTENT_EXPORT RenderFrameImpl |
| 154 : public RenderFrame, | 154 : public RenderFrame, |
| 155 NON_EXPORTED_BASE(public blink::WebFrameClient), | 155 NON_EXPORTED_BASE(public blink::WebFrameClient), |
| 156 NON_EXPORTED_BASE(public blink::WebFrameSerializerClient) { | 156 NON_EXPORTED_BASE(public blink::WebFrameSerializerClient) { |
| 157 public: | 157 public: |
| 158 // Creates a new RenderFrame as the main frame of |render_view|. | 158 // Creates a new RenderFrame as the main frame of |render_view|. |
| 159 static RenderFrameImpl* CreateMainFrame( | 159 static RenderFrameImpl* CreateMainFrame( |
| 160 RenderViewImpl* render_view, | 160 RenderViewImpl* render_view, |
| 161 int32_t routing_id, | 161 int32_t routing_id, |
| (...skipping 486 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 648 media::MediaPermission* GetMediaPermission(); | 648 media::MediaPermission* GetMediaPermission(); |
| 649 | 649 |
| 650 // Sends the current frame's navigation state to the browser. | 650 // Sends the current frame's navigation state to the browser. |
| 651 void SendUpdateState(); | 651 void SendUpdateState(); |
| 652 | 652 |
| 653 // Creates a MojoBindingsController to allow WebUI documents to communicate | 653 // Creates a MojoBindingsController to allow WebUI documents to communicate |
| 654 // with the browser process. If |for_layout_tests| is true, the module system | 654 // with the browser process. If |for_layout_tests| is true, the module system |
| 655 // is exposed on a global "mojo" object rather than "define". | 655 // is exposed on a global "mojo" object rather than "define". |
| 656 void EnableMojoBindings(bool for_layout_tests); | 656 void EnableMojoBindings(bool for_layout_tests); |
| 657 | 657 |
| 658 void ReceiveNavigationDataPipeConsumerHandle( |
| 659 mojo::ScopedDataPipeConsumerHandle data_consumer_handle, int32_t handle_co
mmit_id); |
| 660 |
| 658 protected: | 661 protected: |
| 659 explicit RenderFrameImpl(const CreateParams& params); | 662 explicit RenderFrameImpl(const CreateParams& params); |
| 660 | 663 |
| 661 private: | 664 private: |
| 662 friend class RenderFrameImplTest; | 665 friend class RenderFrameImplTest; |
| 663 friend class RenderFrameObserver; | 666 friend class RenderFrameObserver; |
| 664 friend class RendererAccessibilityTest; | 667 friend class RendererAccessibilityTest; |
| 665 friend class TestRenderFrame; | 668 friend class TestRenderFrame; |
| 666 FRIEND_TEST_ALL_PREFIXES(ExternalPopupMenuDisplayNoneTest, SelectItem); | 669 FRIEND_TEST_ALL_PREFIXES(ExternalPopupMenuDisplayNoneTest, SelectItem); |
| 667 FRIEND_TEST_ALL_PREFIXES(ExternalPopupMenuRemoveTest, RemoveOnChange); | 670 FRIEND_TEST_ALL_PREFIXES(ExternalPopupMenuRemoveTest, RemoveOnChange); |
| (...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 779 void OnSetFrameOwnerProperties( | 782 void OnSetFrameOwnerProperties( |
| 780 const blink::WebFrameOwnerProperties& frame_owner_properties); | 783 const blink::WebFrameOwnerProperties& frame_owner_properties); |
| 781 void OnAdvanceFocus(blink::WebFocusType type, int32_t source_routing_id); | 784 void OnAdvanceFocus(blink::WebFocusType type, int32_t source_routing_id); |
| 782 void OnSetFocusedFrame(); | 785 void OnSetFocusedFrame(); |
| 783 void OnTextTrackSettingsChanged( | 786 void OnTextTrackSettingsChanged( |
| 784 const FrameMsg_TextTrackSettings_Params& params); | 787 const FrameMsg_TextTrackSettings_Params& params); |
| 785 void OnPostMessageEvent(const FrameMsg_PostMessage_Params& params); | 788 void OnPostMessageEvent(const FrameMsg_PostMessage_Params& params); |
| 786 void OnCommitNavigation(const ResourceResponseHead& response, | 789 void OnCommitNavigation(const ResourceResponseHead& response, |
| 787 const GURL& stream_url, | 790 const GURL& stream_url, |
| 788 const CommonNavigationParams& common_params, | 791 const CommonNavigationParams& common_params, |
| 789 const RequestNavigationParams& request_params); | 792 const RequestNavigationParams& request_params, |
| 793 int32_t navigation_commit_id); |
| 790 void OnFailedNavigation(const CommonNavigationParams& common_params, | 794 void OnFailedNavigation(const CommonNavigationParams& common_params, |
| 791 const RequestNavigationParams& request_params, | 795 const RequestNavigationParams& request_params, |
| 792 bool has_stale_copy_in_cache, | 796 bool has_stale_copy_in_cache, |
| 793 int error_code); | 797 int error_code); |
| 794 void OnGetSavableResourceLinks(); | 798 void OnGetSavableResourceLinks(); |
| 795 void OnGetSerializedHtmlWithLocalLinks( | 799 void OnGetSerializedHtmlWithLocalLinks( |
| 796 const std::map<GURL, base::FilePath>& url_to_local_path, | 800 const std::map<GURL, base::FilePath>& url_to_local_path, |
| 797 const std::map<int, base::FilePath>& frame_routing_id_to_local_path); | 801 const std::map<int, base::FilePath>& frame_routing_id_to_local_path); |
| 798 void OnSerializeAsMHTML(const FrameMsg_SerializeAsMHTML_Params& params); | 802 void OnSerializeAsMHTML(const FrameMsg_SerializeAsMHTML_Params& params); |
| 799 void OnFind(int request_id, | 803 void OnFind(int request_id, |
| 800 const base::string16& search_text, | 804 const base::string16& search_text, |
| 801 const blink::WebFindOptions& options); | 805 const blink::WebFindOptions& options); |
| 802 void OnStopFinding(StopFindAction action); | 806 void OnStopFinding(StopFindAction action); |
| 803 #if defined(OS_ANDROID) | 807 #if defined(OS_ANDROID) |
| 804 void OnActivateNearestFindResult(int request_id, float x, float y); | 808 void OnActivateNearestFindResult(int request_id, float x, float y); |
| 805 void OnFindMatchRects(int current_version); | 809 void OnFindMatchRects(int current_version); |
| 806 void OnSelectPopupMenuItems(bool canceled, | 810 void OnSelectPopupMenuItems(bool canceled, |
| 807 const std::vector<int>& selected_indices); | 811 const std::vector<int>& selected_indices); |
| 808 #elif defined(OS_MACOSX) | 812 #elif defined(OS_MACOSX) |
| 809 void OnSelectPopupMenuItem(int selected_index); | 813 void OnSelectPopupMenuItem(int selected_index); |
| 810 void OnCopyToFindPboard(); | 814 void OnCopyToFindPboard(); |
| 811 #endif | 815 #endif |
| 812 | 816 |
| 817 void NavigateIfIPCSynched(bool no_sync_needed); |
| 818 |
| 813 // Requests that the browser process navigates to |url|. If | 819 // Requests that the browser process navigates to |url|. If |
| 814 // |is_history_navigation_in_new_child| is true, the browser process should | 820 // |is_history_navigation_in_new_child| is true, the browser process should |
| 815 // look for a matching FrameNavigationEntry in the last committed entry to use | 821 // look for a matching FrameNavigationEntry in the last committed entry to use |
| 816 // instead of |url|. | 822 // instead of |url|. |
| 817 void OpenURL(const GURL& url, | 823 void OpenURL(const GURL& url, |
| 818 const Referrer& referrer, | 824 const Referrer& referrer, |
| 819 blink::WebNavigationPolicy policy, | 825 blink::WebNavigationPolicy policy, |
| 820 bool should_replace_current_entry, | 826 bool should_replace_current_entry, |
| 821 bool is_history_navigation_in_new_child); | 827 bool is_history_navigation_in_new_child); |
| 822 | 828 |
| (...skipping 366 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1189 // Manages play, pause notifications for WebMediaPlayer implementations; its | 1195 // Manages play, pause notifications for WebMediaPlayer implementations; its |
| 1190 // lifetime is tied to the RenderFrame via the RenderFrameObserver interface. | 1196 // lifetime is tied to the RenderFrame via the RenderFrameObserver interface. |
| 1191 media::RendererWebMediaPlayerDelegate* media_player_delegate_; | 1197 media::RendererWebMediaPlayerDelegate* media_player_delegate_; |
| 1192 | 1198 |
| 1193 // Whether or not this RenderFrame is using Lo-Fi mode. | 1199 // Whether or not this RenderFrame is using Lo-Fi mode. |
| 1194 bool is_using_lofi_; | 1200 bool is_using_lofi_; |
| 1195 | 1201 |
| 1196 // Whether or not this RenderFrame is currently pasting. | 1202 // Whether or not this RenderFrame is currently pasting. |
| 1197 bool is_pasting_; | 1203 bool is_pasting_; |
| 1198 | 1204 |
| 1205 // TODO: this should all be moved into a struct that holds "ongoing navigation
commit data" |
| 1206 mojo::ScopedDataPipeConsumerHandle latest_handle_; |
| 1207 int32_t latest_handle_commit_id_; |
| 1208 RenderThreadImpl* handle_render_thread_; |
| 1209 int32_t latest_navigation_commit_id_; |
| 1210 RenderThreadImpl* navigation_render_thread_; |
| 1211 ResourceResponseHead navigation_response; |
| 1212 GURL navigation_stream_url; |
| 1213 CommonNavigationParams navigation_common_params; |
| 1214 RequestNavigationParams navigation_request_params; |
| 1215 |
| 1199 #if defined(ENABLE_WEBVR) | 1216 #if defined(ENABLE_WEBVR) |
| 1200 // The VR dispatcher attached to the frame, lazily initialized. | 1217 // The VR dispatcher attached to the frame, lazily initialized. |
| 1201 scoped_ptr<VRDispatcher> vr_dispatcher_; | 1218 scoped_ptr<VRDispatcher> vr_dispatcher_; |
| 1202 #endif | 1219 #endif |
| 1203 | 1220 |
| 1204 #if defined(OS_MACOSX) || defined(OS_ANDROID) | 1221 #if defined(OS_MACOSX) || defined(OS_ANDROID) |
| 1205 // The external popup for the currently showing select popup. | 1222 // The external popup for the currently showing select popup. |
| 1206 scoped_ptr<ExternalPopupMenu> external_popup_menu_; | 1223 scoped_ptr<ExternalPopupMenu> external_popup_menu_; |
| 1207 #endif | 1224 #endif |
| 1208 | 1225 |
| 1209 base::WeakPtrFactory<RenderFrameImpl> weak_factory_; | 1226 base::WeakPtrFactory<RenderFrameImpl> weak_factory_; |
| 1210 | 1227 |
| 1211 DISALLOW_COPY_AND_ASSIGN(RenderFrameImpl); | 1228 DISALLOW_COPY_AND_ASSIGN(RenderFrameImpl); |
| 1212 }; | 1229 }; |
| 1213 | 1230 |
| 1214 } // namespace content | 1231 } // namespace content |
| 1215 | 1232 |
| 1216 #endif // CONTENT_RENDERER_RENDER_FRAME_IMPL_H_ | 1233 #endif // CONTENT_RENDERER_RENDER_FRAME_IMPL_H_ |
| OLD | NEW |