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

Unified Diff: components/guest_view/browser/guest_view_base.cc

Issue 2808923003: Revert of Enable find-in-page across GuestViews. (Closed)
Patch Set: Fixed patch conflicts. 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 side-by-side diff with in-line comments
Download patch
Index: components/guest_view/browser/guest_view_base.cc
diff --git a/components/guest_view/browser/guest_view_base.cc b/components/guest_view/browser/guest_view_base.cc
index 71747bd58c405988fe9ecdaad5ba81df2d063eeb..4a260c65b66591fb68840a643dfc8fb80e718645 100644
--- a/components/guest_view/browser/guest_view_base.cc
+++ b/components/guest_view/browser/guest_view_base.cc
@@ -445,6 +445,26 @@ void GuestViewBase::DidDetach() {
Destroy(true);
}
+bool GuestViewBase::HandleFindForEmbedder(
+ int request_id,
+ const base::string16& search_text,
+ const blink::WebFindOptions& options) {
+ if (ShouldHandleFindRequestsForEmbedder()) {
+ web_contents()->Find(request_id, search_text, options);
+ return true;
+ }
+ return false;
+}
+
+bool GuestViewBase::HandleStopFindingForEmbedder(
+ content::StopFindAction action) {
+ if (ShouldHandleFindRequestsForEmbedder()) {
+ web_contents()->StopFinding(action);
+ return true;
+ }
+ return false;
+}
+
WebContents* GuestViewBase::GetOwnerWebContents() const {
return owner_web_contents_;
}
@@ -550,6 +570,10 @@ void GuestViewBase::SignalWhenReady(const base::Closure& callback) {
callback.Run();
}
+bool GuestViewBase::ShouldHandleFindRequestsForEmbedder() const {
+ return false;
+}
+
int GuestViewBase::LogicalPixelsToPhysicalPixels(double logical_pixels) const {
DCHECK(logical_pixels >= 0);
double zoom_factor = GetEmbedderZoomFactor();
@@ -702,6 +726,23 @@ bool GuestViewBase::ShouldResumeRequestsForCreatedWindow() {
return false;
}
+void GuestViewBase::FindReply(WebContents* source,
+ int request_id,
+ int number_of_matches,
+ const gfx::Rect& selection_rect,
+ int active_match_ordinal,
+ bool final_update) {
+ if (ShouldHandleFindRequestsForEmbedder() &&
+ attached() && embedder_web_contents()->GetDelegate()) {
+ embedder_web_contents()->GetDelegate()->FindReply(embedder_web_contents(),
+ request_id,
+ number_of_matches,
+ selection_rect,
+ active_match_ordinal,
+ final_update);
+ }
+}
+
content::RenderWidgetHost* GuestViewBase::GetOwnerRenderWidgetHost() {
// We assume guests live inside an owner RenderFrame but the RenderFrame may
// not be cross-process. In case a type of guest should be allowed to be
« no previous file with comments | « components/guest_view/browser/guest_view_base.h ('k') | content/browser/browser_plugin/browser_plugin_embedder.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698