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 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
75 #include "ui/gfx/range/range.h" | 78 #include "ui/gfx/range/range.h" |
76 #include "url/gurl.h" | 79 #include "url/gurl.h" |
77 #include "url/origin.h" | 80 #include "url/origin.h" |
78 | 81 |
79 #if BUILDFLAG(ENABLE_PLUGINS) | 82 #if BUILDFLAG(ENABLE_PLUGINS) |
80 #include "content/renderer/pepper/plugin_power_saver_helper.h" | 83 #include "content/renderer/pepper/plugin_power_saver_helper.h" |
81 #endif | 84 #endif |
82 | 85 |
83 #if defined(OS_ANDROID) | 86 #if defined(OS_ANDROID) |
84 #include "content/renderer/media/android/renderer_media_player_manager.h" | 87 #include "content/renderer/media/android/renderer_media_player_manager.h" |
88 #include "media/base/android/routing_token_callback.h" | |
85 #endif | 89 #endif |
86 | 90 |
87 struct FrameMsg_MixedContentFound_Params; | 91 struct FrameMsg_MixedContentFound_Params; |
88 struct FrameMsg_PostMessage_Params; | 92 struct FrameMsg_PostMessage_Params; |
89 struct FrameMsg_SerializeAsMHTML_Params; | 93 struct FrameMsg_SerializeAsMHTML_Params; |
90 struct FrameMsg_TextTrackSettings_Params; | 94 struct FrameMsg_TextTrackSettings_Params; |
91 | 95 |
92 namespace blink { | 96 namespace blink { |
93 class WebContentDecryptionModule; | 97 class WebContentDecryptionModule; |
94 class WebPresentationClient; | 98 class WebPresentationClient; |
(...skipping 657 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
752 friend class RenderFrameObserver; | 756 friend class RenderFrameObserver; |
753 friend class RenderAccessibilityImplTest; | 757 friend class RenderAccessibilityImplTest; |
754 friend class TestRenderFrame; | 758 friend class TestRenderFrame; |
755 FRIEND_TEST_ALL_PREFIXES(ExternalPopupMenuDisplayNoneTest, SelectItem); | 759 FRIEND_TEST_ALL_PREFIXES(ExternalPopupMenuDisplayNoneTest, SelectItem); |
756 FRIEND_TEST_ALL_PREFIXES(ExternalPopupMenuRemoveTest, RemoveOnChange); | 760 FRIEND_TEST_ALL_PREFIXES(ExternalPopupMenuRemoveTest, RemoveOnChange); |
757 FRIEND_TEST_ALL_PREFIXES(ExternalPopupMenuTest, NormalCase); | 761 FRIEND_TEST_ALL_PREFIXES(ExternalPopupMenuTest, NormalCase); |
758 FRIEND_TEST_ALL_PREFIXES(ExternalPopupMenuTest, ShowPopupThenNavigate); | 762 FRIEND_TEST_ALL_PREFIXES(ExternalPopupMenuTest, ShowPopupThenNavigate); |
759 FRIEND_TEST_ALL_PREFIXES(RenderAccessibilityImplTest, | 763 FRIEND_TEST_ALL_PREFIXES(RenderAccessibilityImplTest, |
760 AccessibilityMessagesQueueWhileSwappedOut); | 764 AccessibilityMessagesQueueWhileSwappedOut); |
761 FRIEND_TEST_ALL_PREFIXES(RenderFrameImplTest, ZoomLimit); | 765 FRIEND_TEST_ALL_PREFIXES(RenderFrameImplTest, ZoomLimit); |
766 FRIEND_TEST_ALL_PREFIXES(RenderFrameImplTest, | |
767 TestOverlayRoutingTokenSendsLater); | |
768 FRIEND_TEST_ALL_PREFIXES(RenderFrameImplTest, | |
769 TestOverlayRoutingTokenSendsNow); | |
762 | 770 |
763 // A wrapper class used as the callback for JavaScript executed | 771 // A wrapper class used as the callback for JavaScript executed |
764 // in an isolated world. | 772 // in an isolated world. |
765 class JavaScriptIsolatedWorldRequest | 773 class JavaScriptIsolatedWorldRequest |
766 : public blink::WebScriptExecutionCallback { | 774 : public blink::WebScriptExecutionCallback { |
767 public: | 775 public: |
768 JavaScriptIsolatedWorldRequest( | 776 JavaScriptIsolatedWorldRequest( |
769 int id, | 777 int id, |
770 bool notify_result, | 778 bool notify_result, |
771 int routing_id, | 779 int routing_id, |
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
915 void OnSuppressFurtherDialogs(); | 923 void OnSuppressFurtherDialogs(); |
916 void OnFileChooserResponse( | 924 void OnFileChooserResponse( |
917 const std::vector<content::FileChooserFileInfo>& files); | 925 const std::vector<content::FileChooserFileInfo>& files); |
918 void OnClearFocusedElement(); | 926 void OnClearFocusedElement(); |
919 void OnBlinkFeatureUsageReport(const std::set<int>& features); | 927 void OnBlinkFeatureUsageReport(const std::set<int>& features); |
920 void OnMixedContentFound(const FrameMsg_MixedContentFound_Params& params); | 928 void OnMixedContentFound(const FrameMsg_MixedContentFound_Params& params); |
921 #if defined(OS_ANDROID) | 929 #if defined(OS_ANDROID) |
922 void OnActivateNearestFindResult(int request_id, float x, float y); | 930 void OnActivateNearestFindResult(int request_id, float x, float y); |
923 void OnGetNearestFindResult(int request_id, float x, float y); | 931 void OnGetNearestFindResult(int request_id, float x, float y); |
924 void OnFindMatchRects(int current_version); | 932 void OnFindMatchRects(int current_version); |
933 void OnSetOverlayRoutingToken(const base::UnguessableToken& token); | |
925 #endif | 934 #endif |
926 | 935 |
927 #if BUILDFLAG(USE_EXTERNAL_POPUP_MENU) | 936 #if BUILDFLAG(USE_EXTERNAL_POPUP_MENU) |
928 #if defined(OS_MACOSX) | 937 #if defined(OS_MACOSX) |
929 void OnSelectPopupMenuItem(int selected_index); | 938 void OnSelectPopupMenuItem(int selected_index); |
930 #else | 939 #else |
931 void OnSelectPopupMenuItems(bool canceled, | 940 void OnSelectPopupMenuItems(bool canceled, |
932 const std::vector<int>& selected_indices); | 941 const std::vector<int>& selected_indices); |
933 #endif | 942 #endif |
934 #endif | 943 #endif |
(...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1110 // Sends a reply to the current find operation handling if it was a | 1119 // Sends a reply to the current find operation handling if it was a |
1111 // synchronous find request. | 1120 // synchronous find request. |
1112 void SendFindReply(int request_id, | 1121 void SendFindReply(int request_id, |
1113 int match_count, | 1122 int match_count, |
1114 int ordinal, | 1123 int ordinal, |
1115 const blink::WebRect& selection_rect, | 1124 const blink::WebRect& selection_rect, |
1116 bool final_status_update); | 1125 bool final_status_update); |
1117 | 1126 |
1118 void InitializeBlameContext(RenderFrameImpl* parent_frame); | 1127 void InitializeBlameContext(RenderFrameImpl* parent_frame); |
1119 | 1128 |
1129 #if defined(OS_ANDROID) | |
aelias_OOO_until_Jul13
2017/04/26 23:41:22
Can you remove all "#if defined(OS_ANDROID)" from
liberato (no reviews please)
2017/05/02 17:05:12
Done.
| |
1130 // Send |callback| our AndroidOverlay routing token when it arrives. We may | |
1131 // call |callback| before returning. | |
1132 void GetOverlayRoutingToken(const media::RoutingTokenCallback& callback); | |
1133 | |
1134 // Ask the host to send our AndroidOverlay routing token to us. | |
1135 void RequestOverlayRoutingTokenFromHost(); | |
1136 #endif | |
1137 | |
1120 // Stores the WebLocalFrame we are associated with. This is null from the | 1138 // Stores the WebLocalFrame we are associated with. This is null from the |
1121 // constructor until BindToWebFrame is called, and it is null after | 1139 // constructor until BindToWebFrame is called, and it is null after |
1122 // frameDetached is called until destruction (which is asynchronous in the | 1140 // frameDetached is called until destruction (which is asynchronous in the |
1123 // case of the main frame, but not subframes). | 1141 // case of the main frame, but not subframes). |
1124 blink::WebLocalFrame* frame_; | 1142 blink::WebLocalFrame* frame_; |
1125 | 1143 |
1126 // Boolean value indicating whether this RenderFrameImpl object is for the | 1144 // Boolean value indicating whether this RenderFrameImpl object is for the |
1127 // main frame or not. It remains accurate during destruction, even when | 1145 // main frame or not. It remains accurate during destruction, even when |
1128 // |frame_| has been invalidated. | 1146 // |frame_| has been invalidated. |
1129 bool is_main_frame_; | 1147 bool is_main_frame_; |
(...skipping 284 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 |