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

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

Issue 2765443004: AndroidOverlay implementation using Dialog. (Closed)
Patch Set: fixes after rebase Created 3 years, 8 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 1592 matching lines...) Expand 10 before | Expand all | Expand 10 after
1603 IPC_MESSAGE_HANDLER(FrameMsg_ClearFocusedElement, OnClearFocusedElement) 1603 IPC_MESSAGE_HANDLER(FrameMsg_ClearFocusedElement, OnClearFocusedElement)
1604 IPC_MESSAGE_HANDLER(FrameMsg_BlinkFeatureUsageReport, 1604 IPC_MESSAGE_HANDLER(FrameMsg_BlinkFeatureUsageReport,
1605 OnBlinkFeatureUsageReport) 1605 OnBlinkFeatureUsageReport)
1606 IPC_MESSAGE_HANDLER(FrameMsg_MixedContentFound, OnMixedContentFound) 1606 IPC_MESSAGE_HANDLER(FrameMsg_MixedContentFound, OnMixedContentFound)
1607 #if defined(OS_ANDROID) 1607 #if defined(OS_ANDROID)
1608 IPC_MESSAGE_HANDLER(FrameMsg_ActivateNearestFindResult, 1608 IPC_MESSAGE_HANDLER(FrameMsg_ActivateNearestFindResult,
1609 OnActivateNearestFindResult) 1609 OnActivateNearestFindResult)
1610 IPC_MESSAGE_HANDLER(FrameMsg_GetNearestFindResult, 1610 IPC_MESSAGE_HANDLER(FrameMsg_GetNearestFindResult,
1611 OnGetNearestFindResult) 1611 OnGetNearestFindResult)
1612 IPC_MESSAGE_HANDLER(FrameMsg_FindMatchRects, OnFindMatchRects) 1612 IPC_MESSAGE_HANDLER(FrameMsg_FindMatchRects, OnFindMatchRects)
1613 IPC_MESSAGE_HANDLER(FrameMsg_SetOverlayRoutingToken,
1614 OnSetOverlayRoutingToken)
1613 #endif 1615 #endif
1614 1616
1615 #if BUILDFLAG(USE_EXTERNAL_POPUP_MENU) 1617 #if BUILDFLAG(USE_EXTERNAL_POPUP_MENU)
1616 #if defined(OS_MACOSX) 1618 #if defined(OS_MACOSX)
1617 IPC_MESSAGE_HANDLER(FrameMsg_SelectPopupMenuItem, OnSelectPopupMenuItem) 1619 IPC_MESSAGE_HANDLER(FrameMsg_SelectPopupMenuItem, OnSelectPopupMenuItem)
1618 #else 1620 #else
1619 IPC_MESSAGE_HANDLER(FrameMsg_SelectPopupMenuItems, OnSelectPopupMenuItems) 1621 IPC_MESSAGE_HANDLER(FrameMsg_SelectPopupMenuItems, OnSelectPopupMenuItems)
1620 #endif 1622 #endif
1621 #endif 1623 #endif
1622 1624
(...skipping 4220 matching lines...) Expand 10 before | Expand all | Expand 10 after
5843 frame_->findMatchRects(web_match_rects); 5845 frame_->findMatchRects(web_match_rects);
5844 match_rects.reserve(web_match_rects.size()); 5846 match_rects.reserve(web_match_rects.size());
5845 for (size_t i = 0; i < web_match_rects.size(); ++i) 5847 for (size_t i = 0; i < web_match_rects.size(); ++i)
5846 match_rects.push_back(gfx::RectF(web_match_rects[i])); 5848 match_rects.push_back(gfx::RectF(web_match_rects[i]));
5847 } 5849 }
5848 5850
5849 gfx::RectF active_rect = frame_->activeFindMatchRect(); 5851 gfx::RectF active_rect = frame_->activeFindMatchRect();
5850 Send(new FrameHostMsg_FindMatchRects_Reply(routing_id_, rects_version, 5852 Send(new FrameHostMsg_FindMatchRects_Reply(routing_id_, rects_version,
5851 match_rects, active_rect)); 5853 match_rects, active_rect));
5852 } 5854 }
5855
5856 void RenderFrameImpl::OnSetOverlayRoutingToken(
5857 const base::UnguessableToken& token) {
5858 overlay_routing_token_ = token;
5859 for (const auto& cb : pending_routing_token_callbacks_)
5860 cb.Run(overlay_routing_token_.value());
5861 pending_routing_token_callbacks_.clear();
5862 }
5863
5864 void RenderFrameImpl::GetOverlayRoutingToken(
5865 const media::RoutingTokenCallback& callback) {
5866 if (overlay_routing_token_.has_value()) {
5867 callback.Run(overlay_routing_token_.value());
5868 return;
5869 }
5870
5871 // Send a request to the host for the token. We'll notify |callback| when it
5872 // arrives later.
5873 Send(new FrameHostMsg_RequestOverlayRoutingToken(routing_id_));
5874
5875 pending_routing_token_callbacks_.push_back(callback);
5876 }
5853 #endif 5877 #endif
5854 5878
5855 #if BUILDFLAG(USE_EXTERNAL_POPUP_MENU) 5879 #if BUILDFLAG(USE_EXTERNAL_POPUP_MENU)
5856 #if defined(OS_MACOSX) 5880 #if defined(OS_MACOSX)
5857 void RenderFrameImpl::OnSelectPopupMenuItem(int selected_index) { 5881 void RenderFrameImpl::OnSelectPopupMenuItem(int selected_index) {
5858 if (external_popup_menu_ == NULL) 5882 if (external_popup_menu_ == NULL)
5859 return; 5883 return;
5860 external_popup_menu_->DidSelectItem(selected_index); 5884 external_popup_menu_->DidSelectItem(selected_index);
5861 external_popup_menu_.reset(); 5885 external_popup_menu_.reset();
5862 } 5886 }
(...skipping 1109 matching lines...) Expand 10 before | Expand all | Expand 10 after
6972 policy(info.defaultPolicy), 6996 policy(info.defaultPolicy),
6973 replaces_current_history_item(info.replacesCurrentHistoryItem), 6997 replaces_current_history_item(info.replacesCurrentHistoryItem),
6974 history_navigation_in_new_child_frame( 6998 history_navigation_in_new_child_frame(
6975 info.isHistoryNavigationInNewChildFrame), 6999 info.isHistoryNavigationInNewChildFrame),
6976 client_redirect(info.isClientRedirect), 7000 client_redirect(info.isClientRedirect),
6977 cache_disabled(info.isCacheDisabled), 7001 cache_disabled(info.isCacheDisabled),
6978 form(info.form), 7002 form(info.form),
6979 source_location(info.sourceLocation) {} 7003 source_location(info.sourceLocation) {}
6980 7004
6981 } // namespace content 7005 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698