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

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

Issue 2765443004: AndroidOverlay implementation using Dialog. (Closed)
Patch Set: Callable<Void> => Runnable 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 #include "content/renderer/render_frame_impl.h" 5 #include "content/renderer/render_frame_impl.h"
6 6
7 #include <map> 7 #include <map>
8 #include <string> 8 #include <string>
9 #include <utility> 9 #include <utility>
10 #include <vector> 10 #include <vector>
(...skipping 1603 matching lines...) Expand 10 before | Expand all | Expand 10 after
1614 IPC_MESSAGE_HANDLER(FrameMsg_ClearFocusedElement, OnClearFocusedElement) 1614 IPC_MESSAGE_HANDLER(FrameMsg_ClearFocusedElement, OnClearFocusedElement)
1615 IPC_MESSAGE_HANDLER(FrameMsg_BlinkFeatureUsageReport, 1615 IPC_MESSAGE_HANDLER(FrameMsg_BlinkFeatureUsageReport,
1616 OnBlinkFeatureUsageReport) 1616 OnBlinkFeatureUsageReport)
1617 IPC_MESSAGE_HANDLER(FrameMsg_MixedContentFound, OnMixedContentFound) 1617 IPC_MESSAGE_HANDLER(FrameMsg_MixedContentFound, OnMixedContentFound)
1618 #if defined(OS_ANDROID) 1618 #if defined(OS_ANDROID)
1619 IPC_MESSAGE_HANDLER(FrameMsg_ActivateNearestFindResult, 1619 IPC_MESSAGE_HANDLER(FrameMsg_ActivateNearestFindResult,
1620 OnActivateNearestFindResult) 1620 OnActivateNearestFindResult)
1621 IPC_MESSAGE_HANDLER(FrameMsg_GetNearestFindResult, 1621 IPC_MESSAGE_HANDLER(FrameMsg_GetNearestFindResult,
1622 OnGetNearestFindResult) 1622 OnGetNearestFindResult)
1623 IPC_MESSAGE_HANDLER(FrameMsg_FindMatchRects, OnFindMatchRects) 1623 IPC_MESSAGE_HANDLER(FrameMsg_FindMatchRects, OnFindMatchRects)
1624 IPC_MESSAGE_HANDLER(FrameMsg_SetOverlayRoutingToken,
1625 OnSetOverlayRoutingToken)
1624 #endif 1626 #endif
1625 1627
1626 #if BUILDFLAG(USE_EXTERNAL_POPUP_MENU) 1628 #if BUILDFLAG(USE_EXTERNAL_POPUP_MENU)
1627 #if defined(OS_MACOSX) 1629 #if defined(OS_MACOSX)
1628 IPC_MESSAGE_HANDLER(FrameMsg_SelectPopupMenuItem, OnSelectPopupMenuItem) 1630 IPC_MESSAGE_HANDLER(FrameMsg_SelectPopupMenuItem, OnSelectPopupMenuItem)
1629 #else 1631 #else
1630 IPC_MESSAGE_HANDLER(FrameMsg_SelectPopupMenuItems, OnSelectPopupMenuItems) 1632 IPC_MESSAGE_HANDLER(FrameMsg_SelectPopupMenuItems, OnSelectPopupMenuItems)
1631 #endif 1633 #endif
1632 #endif 1634 #endif
1633 1635
(...skipping 4232 matching lines...) Expand 10 before | Expand all | Expand 10 after
5866 frame_->FindMatchRects(web_match_rects); 5868 frame_->FindMatchRects(web_match_rects);
5867 match_rects.reserve(web_match_rects.size()); 5869 match_rects.reserve(web_match_rects.size());
5868 for (size_t i = 0; i < web_match_rects.size(); ++i) 5870 for (size_t i = 0; i < web_match_rects.size(); ++i)
5869 match_rects.push_back(gfx::RectF(web_match_rects[i])); 5871 match_rects.push_back(gfx::RectF(web_match_rects[i]));
5870 } 5872 }
5871 5873
5872 gfx::RectF active_rect = frame_->ActiveFindMatchRect(); 5874 gfx::RectF active_rect = frame_->ActiveFindMatchRect();
5873 Send(new FrameHostMsg_FindMatchRects_Reply(routing_id_, rects_version, 5875 Send(new FrameHostMsg_FindMatchRects_Reply(routing_id_, rects_version,
5874 match_rects, active_rect)); 5876 match_rects, active_rect));
5875 } 5877 }
5878
5879 void RenderFrameImpl::OnSetOverlayRoutingToken(
5880 const base::UnguessableToken& token) {
5881 overlay_routing_token_ = token;
5882 for (const auto& cb : pending_routing_token_callbacks_)
5883 cb.Run(overlay_routing_token_.value());
5884 pending_routing_token_callbacks_.clear();
5885 }
5886
5887 void RenderFrameImpl::GetOverlayRoutingToken(
aelias_OOO_until_Jul13 2017/04/26 23:41:22 I typically expect methods named "Get" to be more
liberato (no reviews please) 2017/05/02 17:05:12 Done.
5888 const media::RoutingTokenCallback& callback) {
5889 if (overlay_routing_token_.has_value()) {
5890 callback.Run(overlay_routing_token_.value());
5891 return;
5892 }
5893
5894 // Send a request to the host for the token. We'll notify |callback| when it
5895 // arrives later.
5896 Send(new FrameHostMsg_RequestOverlayRoutingToken(routing_id_));
5897
5898 pending_routing_token_callbacks_.push_back(callback);
5899 }
5876 #endif 5900 #endif
5877 5901
5878 #if BUILDFLAG(USE_EXTERNAL_POPUP_MENU) 5902 #if BUILDFLAG(USE_EXTERNAL_POPUP_MENU)
5879 #if defined(OS_MACOSX) 5903 #if defined(OS_MACOSX)
5880 void RenderFrameImpl::OnSelectPopupMenuItem(int selected_index) { 5904 void RenderFrameImpl::OnSelectPopupMenuItem(int selected_index) {
5881 if (external_popup_menu_ == NULL) 5905 if (external_popup_menu_ == NULL)
5882 return; 5906 return;
5883 external_popup_menu_->DidSelectItem(selected_index); 5907 external_popup_menu_->DidSelectItem(selected_index);
5884 external_popup_menu_.reset(); 5908 external_popup_menu_.reset();
5885 } 5909 }
(...skipping 1110 matching lines...) Expand 10 before | Expand all | Expand 10 after
6996 policy(info.default_policy), 7020 policy(info.default_policy),
6997 replaces_current_history_item(info.replaces_current_history_item), 7021 replaces_current_history_item(info.replaces_current_history_item),
6998 history_navigation_in_new_child_frame( 7022 history_navigation_in_new_child_frame(
6999 info.is_history_navigation_in_new_child_frame), 7023 info.is_history_navigation_in_new_child_frame),
7000 client_redirect(info.is_client_redirect), 7024 client_redirect(info.is_client_redirect),
7001 cache_disabled(info.is_cache_disabled), 7025 cache_disabled(info.is_cache_disabled),
7002 form(info.form), 7026 form(info.form),
7003 source_location(info.source_location) {} 7027 source_location(info.source_location) {}
7004 7028
7005 } // namespace content 7029 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698