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 <deque> | 11 #include <deque> |
12 #include <map> | 12 #include <map> |
13 #include <memory> | 13 #include <memory> |
14 #include <set> | 14 #include <set> |
15 #include <string> | 15 #include <string> |
16 #include <vector> | 16 #include <vector> |
17 | 17 |
| 18 #include "base/callback.h" |
18 #include "base/files/file_path.h" | 19 #include "base/files/file_path.h" |
19 #include "base/gtest_prod_util.h" | 20 #include "base/gtest_prod_util.h" |
20 #include "base/id_map.h" | 21 #include "base/id_map.h" |
21 #include "base/macros.h" | 22 #include "base/macros.h" |
22 #include "base/memory/linked_ptr.h" | 23 #include "base/memory/linked_ptr.h" |
23 #include "base/memory/ref_counted.h" | 24 #include "base/memory/ref_counted.h" |
24 #include "base/memory/weak_ptr.h" | 25 #include "base/memory/weak_ptr.h" |
25 #include "base/observer_list.h" | 26 #include "base/observer_list.h" |
| 27 #include "base/optional.h" |
26 #include "base/process/process_handle.h" | 28 #include "base/process/process_handle.h" |
27 #include "base/single_thread_task_runner.h" | 29 #include "base/single_thread_task_runner.h" |
| 30 #include "base/unguessable_token.h" |
28 #include "build/build_config.h" | 31 #include "build/build_config.h" |
29 #include "content/common/accessibility_mode.h" | 32 #include "content/common/accessibility_mode.h" |
30 #include "content/common/associated_interface_registry_impl.h" | 33 #include "content/common/associated_interface_registry_impl.h" |
31 #include "content/common/download/mhtml_save_status.h" | 34 #include "content/common/download/mhtml_save_status.h" |
32 #include "content/common/features.h" | 35 #include "content/common/features.h" |
33 #include "content/common/frame.mojom.h" | 36 #include "content/common/frame.mojom.h" |
34 #include "content/common/frame_message_enums.h" | 37 #include "content/common/frame_message_enums.h" |
35 #include "content/common/host_zoom.mojom.h" | 38 #include "content/common/host_zoom.mojom.h" |
36 #include "content/common/renderer.mojom.h" | 39 #include "content/common/renderer.mojom.h" |
37 #include "content/public/common/console_message_level.h" | 40 #include "content/public/common/console_message_level.h" |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
74 #include "ui/gfx/range/range.h" | 77 #include "ui/gfx/range/range.h" |
75 #include "url/gurl.h" | 78 #include "url/gurl.h" |
76 #include "url/origin.h" | 79 #include "url/origin.h" |
77 | 80 |
78 #if BUILDFLAG(ENABLE_PLUGINS) | 81 #if BUILDFLAG(ENABLE_PLUGINS) |
79 #include "content/renderer/pepper/plugin_power_saver_helper.h" | 82 #include "content/renderer/pepper/plugin_power_saver_helper.h" |
80 #endif | 83 #endif |
81 | 84 |
82 #if defined(OS_ANDROID) | 85 #if defined(OS_ANDROID) |
83 #include "content/renderer/media/android/renderer_media_player_manager.h" | 86 #include "content/renderer/media/android/renderer_media_player_manager.h" |
| 87 #include "media/base/android/routing_token_callback.h" |
84 #endif | 88 #endif |
85 | 89 |
86 struct FrameMsg_MixedContentFound_Params; | 90 struct FrameMsg_MixedContentFound_Params; |
87 struct FrameMsg_PostMessage_Params; | 91 struct FrameMsg_PostMessage_Params; |
88 struct FrameMsg_SerializeAsMHTML_Params; | 92 struct FrameMsg_SerializeAsMHTML_Params; |
89 struct FrameMsg_TextTrackSettings_Params; | 93 struct FrameMsg_TextTrackSettings_Params; |
90 | 94 |
91 namespace blink { | 95 namespace blink { |
92 class WebContentDecryptionModule; | 96 class WebContentDecryptionModule; |
93 class WebPresentationClient; | 97 class WebPresentationClient; |
(...skipping 662 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
756 friend class RenderFrameObserver; | 760 friend class RenderFrameObserver; |
757 friend class RenderAccessibilityImplTest; | 761 friend class RenderAccessibilityImplTest; |
758 friend class TestRenderFrame; | 762 friend class TestRenderFrame; |
759 FRIEND_TEST_ALL_PREFIXES(ExternalPopupMenuDisplayNoneTest, SelectItem); | 763 FRIEND_TEST_ALL_PREFIXES(ExternalPopupMenuDisplayNoneTest, SelectItem); |
760 FRIEND_TEST_ALL_PREFIXES(ExternalPopupMenuRemoveTest, RemoveOnChange); | 764 FRIEND_TEST_ALL_PREFIXES(ExternalPopupMenuRemoveTest, RemoveOnChange); |
761 FRIEND_TEST_ALL_PREFIXES(ExternalPopupMenuTest, NormalCase); | 765 FRIEND_TEST_ALL_PREFIXES(ExternalPopupMenuTest, NormalCase); |
762 FRIEND_TEST_ALL_PREFIXES(ExternalPopupMenuTest, ShowPopupThenNavigate); | 766 FRIEND_TEST_ALL_PREFIXES(ExternalPopupMenuTest, ShowPopupThenNavigate); |
763 FRIEND_TEST_ALL_PREFIXES(RenderAccessibilityImplTest, | 767 FRIEND_TEST_ALL_PREFIXES(RenderAccessibilityImplTest, |
764 AccessibilityMessagesQueueWhileSwappedOut); | 768 AccessibilityMessagesQueueWhileSwappedOut); |
765 FRIEND_TEST_ALL_PREFIXES(RenderFrameImplTest, ZoomLimit); | 769 FRIEND_TEST_ALL_PREFIXES(RenderFrameImplTest, ZoomLimit); |
| 770 FRIEND_TEST_ALL_PREFIXES(RenderFrameImplTest, |
| 771 TestOverlayRoutingTokenSendsLater); |
| 772 FRIEND_TEST_ALL_PREFIXES(RenderFrameImplTest, |
| 773 TestOverlayRoutingTokenSendsNow); |
766 | 774 |
767 // A wrapper class used as the callback for JavaScript executed | 775 // A wrapper class used as the callback for JavaScript executed |
768 // in an isolated world. | 776 // in an isolated world. |
769 class JavaScriptIsolatedWorldRequest | 777 class JavaScriptIsolatedWorldRequest |
770 : public blink::WebScriptExecutionCallback { | 778 : public blink::WebScriptExecutionCallback { |
771 public: | 779 public: |
772 JavaScriptIsolatedWorldRequest( | 780 JavaScriptIsolatedWorldRequest( |
773 int id, | 781 int id, |
774 bool notify_result, | 782 bool notify_result, |
775 int routing_id, | 783 int routing_id, |
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
916 void OnSuppressFurtherDialogs(); | 924 void OnSuppressFurtherDialogs(); |
917 void OnFileChooserResponse( | 925 void OnFileChooserResponse( |
918 const std::vector<content::FileChooserFileInfo>& files); | 926 const std::vector<content::FileChooserFileInfo>& files); |
919 void OnClearFocusedElement(); | 927 void OnClearFocusedElement(); |
920 void OnBlinkFeatureUsageReport(const std::set<int>& features); | 928 void OnBlinkFeatureUsageReport(const std::set<int>& features); |
921 void OnMixedContentFound(const FrameMsg_MixedContentFound_Params& params); | 929 void OnMixedContentFound(const FrameMsg_MixedContentFound_Params& params); |
922 #if defined(OS_ANDROID) | 930 #if defined(OS_ANDROID) |
923 void OnActivateNearestFindResult(int request_id, float x, float y); | 931 void OnActivateNearestFindResult(int request_id, float x, float y); |
924 void OnGetNearestFindResult(int request_id, float x, float y); | 932 void OnGetNearestFindResult(int request_id, float x, float y); |
925 void OnFindMatchRects(int current_version); | 933 void OnFindMatchRects(int current_version); |
| 934 void OnSetOverlayRoutingToken(const base::UnguessableToken& token); |
926 #endif | 935 #endif |
927 | 936 |
928 #if BUILDFLAG(USE_EXTERNAL_POPUP_MENU) | 937 #if BUILDFLAG(USE_EXTERNAL_POPUP_MENU) |
929 #if defined(OS_MACOSX) | 938 #if defined(OS_MACOSX) |
930 void OnSelectPopupMenuItem(int selected_index); | 939 void OnSelectPopupMenuItem(int selected_index); |
931 #else | 940 #else |
932 void OnSelectPopupMenuItems(bool canceled, | 941 void OnSelectPopupMenuItems(bool canceled, |
933 const std::vector<int>& selected_indices); | 942 const std::vector<int>& selected_indices); |
934 #endif | 943 #endif |
935 #endif | 944 #endif |
(...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1111 // Sends a reply to the current find operation handling if it was a | 1120 // Sends a reply to the current find operation handling if it was a |
1112 // synchronous find request. | 1121 // synchronous find request. |
1113 void SendFindReply(int request_id, | 1122 void SendFindReply(int request_id, |
1114 int match_count, | 1123 int match_count, |
1115 int ordinal, | 1124 int ordinal, |
1116 const blink::WebRect& selection_rect, | 1125 const blink::WebRect& selection_rect, |
1117 bool final_status_update); | 1126 bool final_status_update); |
1118 | 1127 |
1119 void InitializeBlameContext(RenderFrameImpl* parent_frame); | 1128 void InitializeBlameContext(RenderFrameImpl* parent_frame); |
1120 | 1129 |
| 1130 #if defined(OS_ANDROID) |
| 1131 // Send |callback| our AndroidOverlay routing token when it arrives. We may |
| 1132 // call |callback| before returning. |
| 1133 void GetOverlayRoutingToken(const media::RoutingTokenCallback& callback); |
| 1134 |
| 1135 // Ask the host to send our AndroidOverlay routing token to us. |
| 1136 void RequestOverlayRoutingTokenFromHost(); |
| 1137 #endif |
| 1138 |
1121 // Stores the WebLocalFrame we are associated with. This is null from the | 1139 // Stores the WebLocalFrame we are associated with. This is null from the |
1122 // constructor until BindToWebFrame is called, and it is null after | 1140 // constructor until BindToWebFrame is called, and it is null after |
1123 // frameDetached is called until destruction (which is asynchronous in the | 1141 // frameDetached is called until destruction (which is asynchronous in the |
1124 // case of the main frame, but not subframes). | 1142 // case of the main frame, but not subframes). |
1125 blink::WebLocalFrame* frame_; | 1143 blink::WebLocalFrame* frame_; |
1126 | 1144 |
1127 // Boolean value indicating whether this RenderFrameImpl object is for the | 1145 // Boolean value indicating whether this RenderFrameImpl object is for the |
1128 // main frame or not. It remains accurate during destruction, even when | 1146 // main frame or not. It remains accurate during destruction, even when |
1129 // |frame_| has been invalidated. | 1147 // |frame_| has been invalidated. |
1130 bool is_main_frame_; | 1148 bool is_main_frame_; |
(...skipping 283 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1414 blink::WebSourceLocation source_location; | 1432 blink::WebSourceLocation source_location; |
1415 | 1433 |
1416 PendingNavigationInfo(const NavigationPolicyInfo& info); | 1434 PendingNavigationInfo(const NavigationPolicyInfo& info); |
1417 }; | 1435 }; |
1418 | 1436 |
1419 // PlzNavigate: Contains information about a pending navigation to be sent to | 1437 // PlzNavigate: Contains information about a pending navigation to be sent to |
1420 // the browser. This state is allocated in decidePolicyForNavigation() and | 1438 // the browser. This state is allocated in decidePolicyForNavigation() and |
1421 // is used and released in didStartProvisionalLoad(). | 1439 // is used and released in didStartProvisionalLoad(). |
1422 std::unique_ptr<PendingNavigationInfo> pending_navigation_info_; | 1440 std::unique_ptr<PendingNavigationInfo> pending_navigation_info_; |
1423 | 1441 |
| 1442 #if defined(OS_ANDROID) |
| 1443 // AndroidOverlay routing token from the browser, if we have one yet. |
| 1444 base::Optional<base::UnguessableToken> overlay_routing_token_; |
| 1445 |
| 1446 // Callbacks that we should call when we get a routing token. |
| 1447 std::vector<media::RoutingTokenCallback> pending_routing_token_callbacks_; |
| 1448 #endif |
| 1449 |
1424 base::WeakPtrFactory<RenderFrameImpl> weak_factory_; | 1450 base::WeakPtrFactory<RenderFrameImpl> weak_factory_; |
1425 | 1451 |
1426 DISALLOW_COPY_AND_ASSIGN(RenderFrameImpl); | 1452 DISALLOW_COPY_AND_ASSIGN(RenderFrameImpl); |
1427 }; | 1453 }; |
1428 | 1454 |
1429 } // namespace content | 1455 } // namespace content |
1430 | 1456 |
1431 #endif // CONTENT_RENDERER_RENDER_FRAME_IMPL_H_ | 1457 #endif // CONTENT_RENDERER_RENDER_FRAME_IMPL_H_ |
OLD | NEW |