| 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 28 matching lines...) Expand all Loading... |
| 39 #include "content/renderer/frame_blame_context.h" | 39 #include "content/renderer/frame_blame_context.h" |
| 40 #include "content/renderer/mojo/blink_interface_provider_impl.h" | 40 #include "content/renderer/mojo/blink_interface_provider_impl.h" |
| 41 #include "content/renderer/renderer_webcookiejar_impl.h" | 41 #include "content/renderer/renderer_webcookiejar_impl.h" |
| 42 #include "ipc/ipc_message.h" | 42 #include "ipc/ipc_message.h" |
| 43 #include "ipc/ipc_platform_file.h" | 43 #include "ipc/ipc_platform_file.h" |
| 44 #include "media/blink/webmediaplayer_delegate.h" | 44 #include "media/blink/webmediaplayer_delegate.h" |
| 45 #include "media/blink/webmediaplayer_params.h" | 45 #include "media/blink/webmediaplayer_params.h" |
| 46 #include "media/mojo/interfaces/remoting.mojom.h" | 46 #include "media/mojo/interfaces/remoting.mojom.h" |
| 47 #include "mojo/public/cpp/bindings/associated_binding.h" | 47 #include "mojo/public/cpp/bindings/associated_binding.h" |
| 48 #include "mojo/public/cpp/bindings/binding.h" | 48 #include "mojo/public/cpp/bindings/binding.h" |
| 49 #include "ppapi/features/features.h" |
| 49 #include "services/service_manager/public/interfaces/connector.mojom.h" | 50 #include "services/service_manager/public/interfaces/connector.mojom.h" |
| 50 #include "services/service_manager/public/interfaces/interface_provider.mojom.h" | 51 #include "services/service_manager/public/interfaces/interface_provider.mojom.h" |
| 51 #include "third_party/WebKit/public/platform/WebEffectiveConnectionType.h" | 52 #include "third_party/WebKit/public/platform/WebEffectiveConnectionType.h" |
| 52 #include "third_party/WebKit/public/platform/WebFocusType.h" | 53 #include "third_party/WebKit/public/platform/WebFocusType.h" |
| 53 #include "third_party/WebKit/public/platform/WebLoadingBehaviorFlag.h" | 54 #include "third_party/WebKit/public/platform/WebLoadingBehaviorFlag.h" |
| 54 #include "third_party/WebKit/public/platform/WebMediaPlayer.h" | 55 #include "third_party/WebKit/public/platform/WebMediaPlayer.h" |
| 55 #include "third_party/WebKit/public/platform/WebPageVisibilityState.h" | 56 #include "third_party/WebKit/public/platform/WebPageVisibilityState.h" |
| 56 #include "third_party/WebKit/public/web/WebAXObject.h" | 57 #include "third_party/WebKit/public/web/WebAXObject.h" |
| 57 #include "third_party/WebKit/public/web/WebDataSource.h" | 58 #include "third_party/WebKit/public/web/WebDataSource.h" |
| 58 #include "third_party/WebKit/public/web/WebFrameClient.h" | 59 #include "third_party/WebKit/public/web/WebFrameClient.h" |
| 59 #include "third_party/WebKit/public/web/WebFrameLoadType.h" | 60 #include "third_party/WebKit/public/web/WebFrameLoadType.h" |
| 60 #include "third_party/WebKit/public/web/WebFrameSerializerClient.h" | 61 #include "third_party/WebKit/public/web/WebFrameSerializerClient.h" |
| 61 #include "third_party/WebKit/public/web/WebHistoryCommitType.h" | 62 #include "third_party/WebKit/public/web/WebHistoryCommitType.h" |
| 62 #include "third_party/WebKit/public/web/WebMeaningfulLayout.h" | 63 #include "third_party/WebKit/public/web/WebMeaningfulLayout.h" |
| 63 #include "third_party/WebKit/public/web/WebScriptExecutionCallback.h" | 64 #include "third_party/WebKit/public/web/WebScriptExecutionCallback.h" |
| 64 #include "ui/gfx/range/range.h" | 65 #include "ui/gfx/range/range.h" |
| 65 #include "url/gurl.h" | 66 #include "url/gurl.h" |
| 66 | 67 |
| 67 #if defined(ENABLE_PLUGINS) | 68 #if BUILDFLAG(ENABLE_PLUGINS) |
| 68 #include "content/renderer/pepper/plugin_power_saver_helper.h" | 69 #include "content/renderer/pepper/plugin_power_saver_helper.h" |
| 69 #endif | 70 #endif |
| 70 | 71 |
| 71 #if defined(OS_ANDROID) | 72 #if defined(OS_ANDROID) |
| 72 #include "content/renderer/media/android/renderer_media_player_manager.h" | 73 #include "content/renderer/media/android/renderer_media_player_manager.h" |
| 73 #endif | 74 #endif |
| 74 | 75 |
| 75 struct FrameMsg_PostMessage_Params; | 76 struct FrameMsg_PostMessage_Params; |
| 76 struct FrameMsg_SerializeAsMHTML_Params; | 77 struct FrameMsg_SerializeAsMHTML_Params; |
| 77 struct FrameMsg_TextTrackSettings_Params; | 78 struct FrameMsg_TextTrackSettings_Params; |
| (...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 304 // RenderAccessibilityImpl. It should use the RenderFrameObserver method, once | 305 // RenderAccessibilityImpl. It should use the RenderFrameObserver method, once |
| 305 // blink has a separate accessibility tree per frame. | 306 // blink has a separate accessibility tree per frame. |
| 306 void FocusedNodeChangedForAccessibility(const blink::WebNode& node); | 307 void FocusedNodeChangedForAccessibility(const blink::WebNode& node); |
| 307 | 308 |
| 308 // Called when this frame's widget is focused. | 309 // Called when this frame's widget is focused. |
| 309 void RenderWidgetSetFocus(bool enable); | 310 void RenderWidgetSetFocus(bool enable); |
| 310 | 311 |
| 311 // Called when the widget receives a mouse event. | 312 // Called when the widget receives a mouse event. |
| 312 void RenderWidgetWillHandleMouseEvent(); | 313 void RenderWidgetWillHandleMouseEvent(); |
| 313 | 314 |
| 314 #if defined(ENABLE_PLUGINS) | 315 #if BUILDFLAG(ENABLE_PLUGINS) |
| 315 // Get/set the plugin which will be used to handle document find requests. | 316 // Get/set the plugin which will be used to handle document find requests. |
| 316 void set_plugin_find_handler(PepperPluginInstanceImpl* plugin) { | 317 void set_plugin_find_handler(PepperPluginInstanceImpl* plugin) { |
| 317 plugin_find_handler_ = plugin; | 318 plugin_find_handler_ = plugin; |
| 318 } | 319 } |
| 319 PepperPluginInstanceImpl* plugin_find_handler() { | 320 PepperPluginInstanceImpl* plugin_find_handler() { |
| 320 return plugin_find_handler_; | 321 return plugin_find_handler_; |
| 321 } | 322 } |
| 322 | 323 |
| 323 // Notification that a PPAPI plugin has been created. | 324 // Notification that a PPAPI plugin has been created. |
| 324 void PepperPluginCreated(RendererPpapiHost* host); | 325 void PepperPluginCreated(RendererPpapiHost* host); |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 367 void OnImeSetComposition( | 368 void OnImeSetComposition( |
| 368 const base::string16& text, | 369 const base::string16& text, |
| 369 const std::vector<blink::WebCompositionUnderline>& underlines, | 370 const std::vector<blink::WebCompositionUnderline>& underlines, |
| 370 int selection_start, | 371 int selection_start, |
| 371 int selection_end); | 372 int selection_end); |
| 372 void OnImeCommitText(const base::string16& text, | 373 void OnImeCommitText(const base::string16& text, |
| 373 const gfx::Range& replacement_range, | 374 const gfx::Range& replacement_range, |
| 374 int relative_cursor_pos); | 375 int relative_cursor_pos); |
| 375 void OnImeFinishComposingText(bool keep_selection); | 376 void OnImeFinishComposingText(bool keep_selection); |
| 376 | 377 |
| 377 #endif // defined(ENABLE_PLUGINS) | 378 #endif // BUILDFLAG(ENABLE_PLUGINS) |
| 378 | 379 |
| 379 // May return NULL in some cases, especially if userMediaClient() returns | 380 // May return NULL in some cases, especially if userMediaClient() returns |
| 380 // NULL. | 381 // NULL. |
| 381 MediaStreamDispatcher* GetMediaStreamDispatcher(); | 382 MediaStreamDispatcher* GetMediaStreamDispatcher(); |
| 382 | 383 |
| 383 void ScriptedPrint(bool user_initiated); | 384 void ScriptedPrint(bool user_initiated); |
| 384 | 385 |
| 385 #if defined(USE_EXTERNAL_POPUP_MENU) | 386 #if defined(USE_EXTERNAL_POPUP_MENU) |
| 386 void DidHideExternalPopupMenu(); | 387 void DidHideExternalPopupMenu(); |
| 387 #endif | 388 #endif |
| (...skipping 23 matching lines...) Expand all Loading... |
| 411 std::unique_ptr<PluginInstanceThrottler> throttler) override; | 412 std::unique_ptr<PluginInstanceThrottler> throttler) override; |
| 412 void LoadURLExternally(const blink::WebURLRequest& request, | 413 void LoadURLExternally(const blink::WebURLRequest& request, |
| 413 blink::WebNavigationPolicy policy) override; | 414 blink::WebNavigationPolicy policy) override; |
| 414 void ExecuteJavaScript(const base::string16& javascript) override; | 415 void ExecuteJavaScript(const base::string16& javascript) override; |
| 415 bool IsMainFrame() override; | 416 bool IsMainFrame() override; |
| 416 bool IsHidden() override; | 417 bool IsHidden() override; |
| 417 service_manager::InterfaceRegistry* GetInterfaceRegistry() override; | 418 service_manager::InterfaceRegistry* GetInterfaceRegistry() override; |
| 418 service_manager::InterfaceProvider* GetRemoteInterfaces() override; | 419 service_manager::InterfaceProvider* GetRemoteInterfaces() override; |
| 419 AssociatedInterfaceRegistry* GetAssociatedInterfaceRegistry() override; | 420 AssociatedInterfaceRegistry* GetAssociatedInterfaceRegistry() override; |
| 420 AssociatedInterfaceProvider* GetRemoteAssociatedInterfaces() override; | 421 AssociatedInterfaceProvider* GetRemoteAssociatedInterfaces() override; |
| 421 #if defined(ENABLE_PLUGINS) | 422 #if BUILDFLAG(ENABLE_PLUGINS) |
| 422 void RegisterPeripheralPlugin( | 423 void RegisterPeripheralPlugin( |
| 423 const url::Origin& content_origin, | 424 const url::Origin& content_origin, |
| 424 const base::Closure& unthrottle_callback) override; | 425 const base::Closure& unthrottle_callback) override; |
| 425 RenderFrame::PeripheralContentStatus GetPeripheralContentStatus( | 426 RenderFrame::PeripheralContentStatus GetPeripheralContentStatus( |
| 426 const url::Origin& main_frame_origin, | 427 const url::Origin& main_frame_origin, |
| 427 const url::Origin& content_origin, | 428 const url::Origin& content_origin, |
| 428 const gfx::Size& unobscured_size, | 429 const gfx::Size& unobscured_size, |
| 429 RecordPeripheralDecision record_decision) const override; | 430 RecordPeripheralDecision record_decision) const override; |
| 430 void WhitelistContentOrigin(const url::Origin& content_origin) override; | 431 void WhitelistContentOrigin(const url::Origin& content_origin) override; |
| 431 void DidStartLoading() override; | 432 void DidStartLoading() override; |
| (...skipping 243 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 675 // (see that var for more) and requests the chooser be displayed if there are | 676 // (see that var for more) and requests the chooser be displayed if there are |
| 676 // no other waiting items in the queue. | 677 // no other waiting items in the queue. |
| 677 // | 678 // |
| 678 // Returns true if the chooser was successfully scheduled. False means we | 679 // Returns true if the chooser was successfully scheduled. False means we |
| 679 // didn't schedule anything. | 680 // didn't schedule anything. |
| 680 bool ScheduleFileChooser(const FileChooserParams& params, | 681 bool ScheduleFileChooser(const FileChooserParams& params, |
| 681 blink::WebFileChooserCompletion* completion); | 682 blink::WebFileChooserCompletion* completion); |
| 682 | 683 |
| 683 // Plugin-related functions -------------------------------------------------- | 684 // Plugin-related functions -------------------------------------------------- |
| 684 | 685 |
| 685 #if defined(ENABLE_PLUGINS) | 686 #if BUILDFLAG(ENABLE_PLUGINS) |
| 686 PepperPluginInstanceImpl* focused_pepper_plugin() { | 687 PepperPluginInstanceImpl* focused_pepper_plugin() { |
| 687 return focused_pepper_plugin_; | 688 return focused_pepper_plugin_; |
| 688 } | 689 } |
| 689 PepperPluginInstanceImpl* pepper_last_mouse_event_target() { | 690 PepperPluginInstanceImpl* pepper_last_mouse_event_target() { |
| 690 return pepper_last_mouse_event_target_; | 691 return pepper_last_mouse_event_target_; |
| 691 } | 692 } |
| 692 void set_pepper_last_mouse_event_target(PepperPluginInstanceImpl* plugin) { | 693 void set_pepper_last_mouse_event_target(PepperPluginInstanceImpl* plugin) { |
| 693 pepper_last_mouse_event_target_ = plugin; | 694 pepper_last_mouse_event_target_ = plugin; |
| 694 } | 695 } |
| 695 | 696 |
| (...skipping 337 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1033 service_manager::mojom::InterfaceProvider* GetMediaInterfaceProvider(); | 1034 service_manager::mojom::InterfaceProvider* GetMediaInterfaceProvider(); |
| 1034 #endif | 1035 #endif |
| 1035 | 1036 |
| 1036 #if BUILDFLAG(ENABLE_MEDIA_REMOTING) | 1037 #if BUILDFLAG(ENABLE_MEDIA_REMOTING) |
| 1037 media::mojom::RemoterFactory* GetRemoterFactory(); | 1038 media::mojom::RemoterFactory* GetRemoterFactory(); |
| 1038 #endif | 1039 #endif |
| 1039 | 1040 |
| 1040 media::CdmFactory* GetCdmFactory(); | 1041 media::CdmFactory* GetCdmFactory(); |
| 1041 media::DecoderFactory* GetDecoderFactory(); | 1042 media::DecoderFactory* GetDecoderFactory(); |
| 1042 | 1043 |
| 1043 #if defined(ENABLE_PLUGINS) | 1044 #if BUILDFLAG(ENABLE_PLUGINS) |
| 1044 void HandlePepperImeCommit(const base::string16& text); | 1045 void HandlePepperImeCommit(const base::string16& text); |
| 1045 #endif // ENABLE_PLUGINS | 1046 #endif // ENABLE_PLUGINS |
| 1046 | 1047 |
| 1047 void RegisterMojoInterfaces(); | 1048 void RegisterMojoInterfaces(); |
| 1048 | 1049 |
| 1049 // Connect to an interface provided by the service registry. | 1050 // Connect to an interface provided by the service registry. |
| 1050 template <typename Interface> | 1051 template <typename Interface> |
| 1051 void GetInterface(mojo::InterfaceRequest<Interface> request); | 1052 void GetInterface(mojo::InterfaceRequest<Interface> request); |
| 1052 | 1053 |
| 1053 void OnHostZoomClientRequest(mojom::HostZoomAssociatedRequest request); | 1054 void OnHostZoomClientRequest(mojom::HostZoomAssociatedRequest request); |
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1136 // didStopLoading, since it is not needed after the first load completes and | 1137 // didStopLoading, since it is not needed after the first load completes and |
| 1137 // is never used after the initial navigation. | 1138 // is never used after the initial navigation. |
| 1138 // TODO(creis): Expand this to include any corresponding same-process | 1139 // TODO(creis): Expand this to include any corresponding same-process |
| 1139 // PageStates for the whole subtree in https://crbug.com/639842. | 1140 // PageStates for the whole subtree in https://crbug.com/639842. |
| 1140 std::map<std::string, bool> history_subframe_unique_names_; | 1141 std::map<std::string, bool> history_subframe_unique_names_; |
| 1141 | 1142 |
| 1142 // Stores the current history item for this frame, so that updates to it can | 1143 // Stores the current history item for this frame, so that updates to it can |
| 1143 // be reported to the browser process via SendUpdateState. | 1144 // be reported to the browser process via SendUpdateState. |
| 1144 blink::WebHistoryItem current_history_item_; | 1145 blink::WebHistoryItem current_history_item_; |
| 1145 | 1146 |
| 1146 #if defined(ENABLE_PLUGINS) | 1147 #if BUILDFLAG(ENABLE_PLUGINS) |
| 1147 // Current text input composition text. Empty if no composition is in | 1148 // Current text input composition text. Empty if no composition is in |
| 1148 // progress. | 1149 // progress. |
| 1149 base::string16 pepper_composition_text_; | 1150 base::string16 pepper_composition_text_; |
| 1150 | 1151 |
| 1151 PluginPowerSaverHelper* plugin_power_saver_helper_; | 1152 PluginPowerSaverHelper* plugin_power_saver_helper_; |
| 1152 | 1153 |
| 1153 PepperPluginInstanceImpl* plugin_find_handler_; | 1154 PepperPluginInstanceImpl* plugin_find_handler_; |
| 1154 #endif | 1155 #endif |
| 1155 | 1156 |
| 1156 RendererWebCookieJarImpl cookie_jar_; | 1157 RendererWebCookieJarImpl cookie_jar_; |
| (...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1304 std::deque<std::unique_ptr<PendingFileChooser>> file_chooser_completions_; | 1305 std::deque<std::unique_ptr<PendingFileChooser>> file_chooser_completions_; |
| 1305 | 1306 |
| 1306 #if defined(USE_EXTERNAL_POPUP_MENU) | 1307 #if defined(USE_EXTERNAL_POPUP_MENU) |
| 1307 // The external popup for the currently showing select popup. | 1308 // The external popup for the currently showing select popup. |
| 1308 std::unique_ptr<ExternalPopupMenu> external_popup_menu_; | 1309 std::unique_ptr<ExternalPopupMenu> external_popup_menu_; |
| 1309 #endif | 1310 #endif |
| 1310 | 1311 |
| 1311 std::unique_ptr<FrameBlameContext> blame_context_; | 1312 std::unique_ptr<FrameBlameContext> blame_context_; |
| 1312 | 1313 |
| 1313 // Plugins ------------------------------------------------------------------- | 1314 // Plugins ------------------------------------------------------------------- |
| 1314 #if defined(ENABLE_PLUGINS) | 1315 #if BUILDFLAG(ENABLE_PLUGINS) |
| 1315 typedef std::set<PepperPluginInstanceImpl*> PepperPluginSet; | 1316 typedef std::set<PepperPluginInstanceImpl*> PepperPluginSet; |
| 1316 PepperPluginSet active_pepper_instances_; | 1317 PepperPluginSet active_pepper_instances_; |
| 1317 | 1318 |
| 1318 // Whether or not the focus is on a PPAPI plugin | 1319 // Whether or not the focus is on a PPAPI plugin |
| 1319 PepperPluginInstanceImpl* focused_pepper_plugin_; | 1320 PepperPluginInstanceImpl* focused_pepper_plugin_; |
| 1320 | 1321 |
| 1321 // The plugin instance that received the last mouse event. It is set to NULL | 1322 // The plugin instance that received the last mouse event. It is set to NULL |
| 1322 // if the last mouse event went to elements other than Pepper plugins. | 1323 // if the last mouse event went to elements other than Pepper plugins. |
| 1323 // |pepper_last_mouse_event_target_| is not owned by this class. We depend on | 1324 // |pepper_last_mouse_event_target_| is not owned by this class. We depend on |
| 1324 // the RenderFrameImpl to NULL it out when it destructs. | 1325 // the RenderFrameImpl to NULL it out when it destructs. |
| (...skipping 20 matching lines...) Expand all Loading... |
| 1345 bool browser_side_navigation_pending_ = false; | 1346 bool browser_side_navigation_pending_ = false; |
| 1346 | 1347 |
| 1347 base::WeakPtrFactory<RenderFrameImpl> weak_factory_; | 1348 base::WeakPtrFactory<RenderFrameImpl> weak_factory_; |
| 1348 | 1349 |
| 1349 DISALLOW_COPY_AND_ASSIGN(RenderFrameImpl); | 1350 DISALLOW_COPY_AND_ASSIGN(RenderFrameImpl); |
| 1350 }; | 1351 }; |
| 1351 | 1352 |
| 1352 } // namespace content | 1353 } // namespace content |
| 1353 | 1354 |
| 1354 #endif // CONTENT_RENDERER_RENDER_FRAME_IMPL_H_ | 1355 #endif // CONTENT_RENDERER_RENDER_FRAME_IMPL_H_ |
| OLD | NEW |