Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(212)

Side by Side Diff: content/renderer/render_frame_impl.h

Issue 2765443004: AndroidOverlay implementation using Dialog. (Closed)
Patch Set: fixed test Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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/common/url_loader_factory.mojom.h" 40 #include "content/common/url_loader_factory.mojom.h"
38 #include "content/public/common/console_message_level.h" 41 #include "content/public/common/console_message_level.h"
39 #include "content/public/common/javascript_dialog_type.h" 42 #include "content/public/common/javascript_dialog_type.h"
40 #include "content/public/common/previews_state.h" 43 #include "content/public/common/previews_state.h"
41 #include "content/public/common/referrer.h" 44 #include "content/public/common/referrer.h"
42 #include "content/public/common/request_context_type.h" 45 #include "content/public/common/request_context_type.h"
43 #include "content/public/common/stop_find_action.h" 46 #include "content/public/common/stop_find_action.h"
44 #include "content/public/renderer/render_frame.h" 47 #include "content/public/renderer/render_frame.h"
45 #include "content/renderer/frame_blame_context.h" 48 #include "content/renderer/frame_blame_context.h"
46 #include "content/renderer/mojo/blink_interface_provider_impl.h" 49 #include "content/renderer/mojo/blink_interface_provider_impl.h"
47 #include "content/renderer/renderer_webcookiejar_impl.h" 50 #include "content/renderer/renderer_webcookiejar_impl.h"
48 #include "content/renderer/unique_name_helper.h" 51 #include "content/renderer/unique_name_helper.h"
49 #include "ipc/ipc_message.h" 52 #include "ipc/ipc_message.h"
50 #include "ipc/ipc_platform_file.h" 53 #include "ipc/ipc_platform_file.h"
54 #include "media/base/routing_token_callback.h"
51 #include "media/blink/webmediaplayer_delegate.h" 55 #include "media/blink/webmediaplayer_delegate.h"
52 #include "media/blink/webmediaplayer_params.h" 56 #include "media/blink/webmediaplayer_params.h"
53 #include "media/mojo/interfaces/remoting.mojom.h" 57 #include "media/mojo/interfaces/remoting.mojom.h"
54 #include "mojo/public/cpp/bindings/associated_binding.h" 58 #include "mojo/public/cpp/bindings/associated_binding.h"
55 #include "mojo/public/cpp/bindings/binding.h" 59 #include "mojo/public/cpp/bindings/binding.h"
56 #include "mojo/public/cpp/bindings/binding_set.h" 60 #include "mojo/public/cpp/bindings/binding_set.h"
57 #include "mojo/public/cpp/system/data_pipe.h" 61 #include "mojo/public/cpp/system/data_pipe.h"
58 #include "ppapi/features/features.h" 62 #include "ppapi/features/features.h"
59 #include "services/service_manager/public/cpp/bind_source_info.h" 63 #include "services/service_manager/public/cpp/bind_source_info.h"
60 #include "services/service_manager/public/cpp/binder_registry.h" 64 #include "services/service_manager/public/cpp/binder_registry.h"
(...skipping 708 matching lines...) Expand 10 before | Expand all | Expand 10 after
769 friend class RenderFrameObserver; 773 friend class RenderFrameObserver;
770 friend class RenderAccessibilityImplTest; 774 friend class RenderAccessibilityImplTest;
771 friend class TestRenderFrame; 775 friend class TestRenderFrame;
772 FRIEND_TEST_ALL_PREFIXES(ExternalPopupMenuDisplayNoneTest, SelectItem); 776 FRIEND_TEST_ALL_PREFIXES(ExternalPopupMenuDisplayNoneTest, SelectItem);
773 FRIEND_TEST_ALL_PREFIXES(ExternalPopupMenuRemoveTest, RemoveOnChange); 777 FRIEND_TEST_ALL_PREFIXES(ExternalPopupMenuRemoveTest, RemoveOnChange);
774 FRIEND_TEST_ALL_PREFIXES(ExternalPopupMenuTest, NormalCase); 778 FRIEND_TEST_ALL_PREFIXES(ExternalPopupMenuTest, NormalCase);
775 FRIEND_TEST_ALL_PREFIXES(ExternalPopupMenuTest, ShowPopupThenNavigate); 779 FRIEND_TEST_ALL_PREFIXES(ExternalPopupMenuTest, ShowPopupThenNavigate);
776 FRIEND_TEST_ALL_PREFIXES(RenderAccessibilityImplTest, 780 FRIEND_TEST_ALL_PREFIXES(RenderAccessibilityImplTest,
777 AccessibilityMessagesQueueWhileSwappedOut); 781 AccessibilityMessagesQueueWhileSwappedOut);
778 FRIEND_TEST_ALL_PREFIXES(RenderFrameImplTest, ZoomLimit); 782 FRIEND_TEST_ALL_PREFIXES(RenderFrameImplTest, ZoomLimit);
783 FRIEND_TEST_ALL_PREFIXES(RenderFrameImplTest,
784 TestOverlayRoutingTokenSendsLater);
785 FRIEND_TEST_ALL_PREFIXES(RenderFrameImplTest,
786 TestOverlayRoutingTokenSendsNow);
779 787
780 // A wrapper class used as the callback for JavaScript executed 788 // A wrapper class used as the callback for JavaScript executed
781 // in an isolated world. 789 // in an isolated world.
782 class JavaScriptIsolatedWorldRequest 790 class JavaScriptIsolatedWorldRequest
783 : public blink::WebScriptExecutionCallback { 791 : public blink::WebScriptExecutionCallback {
784 public: 792 public:
785 JavaScriptIsolatedWorldRequest( 793 JavaScriptIsolatedWorldRequest(
786 int id, 794 int id,
787 bool notify_result, 795 bool notify_result,
788 int routing_id, 796 int routing_id,
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after
934 void OnFileChooserResponse( 942 void OnFileChooserResponse(
935 const std::vector<content::FileChooserFileInfo>& files); 943 const std::vector<content::FileChooserFileInfo>& files);
936 void OnClearFocusedElement(); 944 void OnClearFocusedElement();
937 void OnBlinkFeatureUsageReport(const std::set<int>& features); 945 void OnBlinkFeatureUsageReport(const std::set<int>& features);
938 void OnMixedContentFound(const FrameMsg_MixedContentFound_Params& params); 946 void OnMixedContentFound(const FrameMsg_MixedContentFound_Params& params);
939 #if defined(OS_ANDROID) 947 #if defined(OS_ANDROID)
940 void OnActivateNearestFindResult(int request_id, float x, float y); 948 void OnActivateNearestFindResult(int request_id, float x, float y);
941 void OnGetNearestFindResult(int request_id, float x, float y); 949 void OnGetNearestFindResult(int request_id, float x, float y);
942 void OnFindMatchRects(int current_version); 950 void OnFindMatchRects(int current_version);
943 #endif 951 #endif
952 void OnSetOverlayRoutingToken(const base::UnguessableToken& token);
944 953
945 #if BUILDFLAG(USE_EXTERNAL_POPUP_MENU) 954 #if BUILDFLAG(USE_EXTERNAL_POPUP_MENU)
946 #if defined(OS_MACOSX) 955 #if defined(OS_MACOSX)
947 void OnSelectPopupMenuItem(int selected_index); 956 void OnSelectPopupMenuItem(int selected_index);
948 #else 957 #else
949 void OnSelectPopupMenuItems(bool canceled, 958 void OnSelectPopupMenuItems(bool canceled,
950 const std::vector<int>& selected_indices); 959 const std::vector<int>& selected_indices);
951 #endif 960 #endif
952 #endif 961 #endif
953 962
(...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after
1132 int ordinal, 1141 int ordinal,
1133 const blink::WebRect& selection_rect, 1142 const blink::WebRect& selection_rect,
1134 bool final_status_update); 1143 bool final_status_update);
1135 1144
1136 void InitializeBlameContext(RenderFrameImpl* parent_frame); 1145 void InitializeBlameContext(RenderFrameImpl* parent_frame);
1137 1146
1138 // service_manager::mojom::InterfaceProvider: 1147 // service_manager::mojom::InterfaceProvider:
1139 void GetInterface(const std::string& interface_name, 1148 void GetInterface(const std::string& interface_name,
1140 mojo::ScopedMessagePipeHandle interface_pipe) override; 1149 mojo::ScopedMessagePipeHandle interface_pipe) override;
1141 1150
1151 // Send |callback| our AndroidOverlay routing token when it arrives. We may
1152 // call |callback| before returning.
1153 void RequestOverlayRoutingToken(const media::RoutingTokenCallback& callback);
1154
1155 // Ask the host to send our AndroidOverlay routing token to us.
1156 void RequestOverlayRoutingTokenFromHost();
1157
1142 // Stores the WebLocalFrame we are associated with. This is null from the 1158 // Stores the WebLocalFrame we are associated with. This is null from the
1143 // constructor until BindToWebFrame is called, and it is null after 1159 // constructor until BindToWebFrame is called, and it is null after
1144 // frameDetached is called until destruction (which is asynchronous in the 1160 // frameDetached is called until destruction (which is asynchronous in the
1145 // case of the main frame, but not subframes). 1161 // case of the main frame, but not subframes).
1146 blink::WebLocalFrame* frame_; 1162 blink::WebLocalFrame* frame_;
1147 1163
1148 // Boolean value indicating whether this RenderFrameImpl object is for the 1164 // Boolean value indicating whether this RenderFrameImpl object is for the
1149 // main frame or not. It remains accurate during destruction, even when 1165 // main frame or not. It remains accurate during destruction, even when
1150 // |frame_| has been invalidated. 1166 // |frame_| has been invalidated.
1151 bool is_main_frame_; 1167 bool is_main_frame_;
(...skipping 291 matching lines...) Expand 10 before | Expand all | Expand 10 after
1443 // is used and released in didStartProvisionalLoad(). 1459 // is used and released in didStartProvisionalLoad().
1444 std::unique_ptr<PendingNavigationInfo> pending_navigation_info_; 1460 std::unique_ptr<PendingNavigationInfo> pending_navigation_info_;
1445 1461
1446 service_manager::BindSourceInfo browser_info_; 1462 service_manager::BindSourceInfo browser_info_;
1447 1463
1448 mojo::BindingSet<service_manager::mojom::InterfaceProvider> 1464 mojo::BindingSet<service_manager::mojom::InterfaceProvider>
1449 interface_provider_bindings_; 1465 interface_provider_bindings_;
1450 1466
1451 mojom::URLLoaderFactoryPtr url_loader_factory_; 1467 mojom::URLLoaderFactoryPtr url_loader_factory_;
1452 1468
1469 // AndroidOverlay routing token from the browser, if we have one yet.
1470 base::Optional<base::UnguessableToken> overlay_routing_token_;
1471
1472 // Callbacks that we should call when we get a routing token.
1473 std::vector<media::RoutingTokenCallback> pending_routing_token_callbacks_;
1474
1453 base::WeakPtrFactory<RenderFrameImpl> weak_factory_; 1475 base::WeakPtrFactory<RenderFrameImpl> weak_factory_;
1454 1476
1455 DISALLOW_COPY_AND_ASSIGN(RenderFrameImpl); 1477 DISALLOW_COPY_AND_ASSIGN(RenderFrameImpl);
1456 }; 1478 };
1457 1479
1458 } // namespace content 1480 } // namespace content
1459 1481
1460 #endif // CONTENT_RENDERER_RENDER_FRAME_IMPL_H_ 1482 #endif // CONTENT_RENDERER_RENDER_FRAME_IMPL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698