diff options
author | paulmeyer <paulmeyer@chromium.org> | 2015-08-24 15:12:49 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-08-24 22:13:38 +0000 |
commit | 9c87a756bf398d12f66e7abb94fade7728f110b1 (patch) | |
tree | 7cc37b3e7fc11156e2374d9cf1f71b56b2cbf966 /extensions/browser/guest_view | |
parent | 8a5fe2730e021794a1bdf4bf77422d1351dad8d7 (diff) | |
download | chromium_src-9c87a756bf398d12f66e7abb94fade7728f110b1.zip chromium_src-9c87a756bf398d12f66e7abb94fade7728f110b1.tar.gz chromium_src-9c87a756bf398d12f66e7abb94fade7728f110b1.tar.bz2 |
This patch fixes the bug where find results were not showing up in the find bar for the Chrome signin page. This also fixed the same bug (which was not reported) for extension options.
This bug resulted from GuestViews not properly propagating FindReply data to their embedder when handling find requests in place of their embedder.
BUG=524003
Review URL: https://codereview.chromium.org/1310333002
Cr-Commit-Position: refs/heads/master@{#345192}
Diffstat (limited to 'extensions/browser/guest_view')
4 files changed, 13 insertions, 35 deletions
diff --git a/extensions/browser/guest_view/mime_handler_view/mime_handler_view_guest.cc b/extensions/browser/guest_view/mime_handler_view/mime_handler_view_guest.cc index 5cfc1ee..aee7d72 100644 --- a/extensions/browser/guest_view/mime_handler_view/mime_handler_view_guest.cc +++ b/extensions/browser/guest_view/mime_handler_view/mime_handler_view_guest.cc @@ -190,23 +190,6 @@ MimeHandlerViewGuest::GetJavaScriptDialogManager( web_contents()); } -void MimeHandlerViewGuest::FindReply(content::WebContents* web_contents, - int request_id, - int number_of_matches, - const gfx::Rect& selection_rect, - int active_match_ordinal, - bool final_update) { - if (!attached() || !embedder_web_contents()->GetDelegate()) - return; - - embedder_web_contents()->GetDelegate()->FindReply(embedder_web_contents(), - request_id, - number_of_matches, - selection_rect, - active_match_ordinal, - final_update); -} - bool MimeHandlerViewGuest::SaveFrame(const GURL& url, const content::Referrer& referrer) { if (!attached()) diff --git a/extensions/browser/guest_view/mime_handler_view/mime_handler_view_guest.h b/extensions/browser/guest_view/mime_handler_view/mime_handler_view_guest.h index 5a2b0169..26c0e11 100644 --- a/extensions/browser/guest_view/mime_handler_view/mime_handler_view_guest.h +++ b/extensions/browser/guest_view/mime_handler_view/mime_handler_view_guest.h @@ -76,12 +76,6 @@ class MimeHandlerViewGuest : const blink::WebGestureEvent& event) override; content::JavaScriptDialogManager* GetJavaScriptDialogManager( content::WebContents* source) override; - void FindReply(content::WebContents* web_contents, - int request_id, - int number_of_matches, - const gfx::Rect& selection_rect, - int active_match_ordinal, - bool final_update) override; bool SaveFrame(const GURL& url, const content::Referrer& referrer) override; // content::WebContentsObserver implementation. diff --git a/extensions/browser/guest_view/web_view/web_view_guest.cc b/extensions/browser/guest_view/web_view/web_view_guest.cc index 6d3f617..da15b9f 100644 --- a/extensions/browser/guest_view/web_view/web_view_guest.cc +++ b/extensions/browser/guest_view/web_view/web_view_guest.cc @@ -507,11 +507,10 @@ void WebViewGuest::FindReply(WebContents* source, const gfx::Rect& selection_rect, int active_match_ordinal, bool final_update) { - find_helper_.FindReply(request_id, - number_of_matches, - selection_rect, - active_match_ordinal, - final_update); + GuestViewBase::FindReply(source, request_id, number_of_matches, + selection_rect, active_match_ordinal, final_update); + find_helper_.FindReply(request_id, number_of_matches, selection_rect, + active_match_ordinal, final_update); } double WebViewGuest::GetZoom() const { @@ -959,7 +958,9 @@ void WebViewGuest::SignalWhenReady(const base::Closure& callback) { } bool WebViewGuest::ShouldHandleFindRequestsForEmbedder() const { - return web_view_guest_delegate_->ShouldHandleFindRequestsForEmbedder(); + if (web_view_guest_delegate_) + return web_view_guest_delegate_->ShouldHandleFindRequestsForEmbedder(); + return false; } void WebViewGuest::WillAttachToEmbedder() { diff --git a/extensions/browser/guest_view/web_view/web_view_guest.h b/extensions/browser/guest_view/web_view/web_view_guest.h index a3f61ee..9605ad2 100644 --- a/extensions/browser/guest_view/web_view/web_view_guest.h +++ b/extensions/browser/guest_view/web_view/web_view_guest.h @@ -115,6 +115,12 @@ class WebViewGuest : public guest_view::GuestView<WebViewGuest>, void DidAttachToEmbedder() override; void DidDropLink(const GURL& url) override; void DidInitialize(const base::DictionaryValue& create_params) override; + void FindReply(content::WebContents* source, + int request_id, + int number_of_matches, + const gfx::Rect& selection_rect, + int active_match_ordinal, + bool final_update) override; void GuestViewDidStopLoading() override; void EmbedderFullscreenToggled(bool entered_fullscreen) override; const char* GetAPINamespace() const override; @@ -139,12 +145,6 @@ class WebViewGuest : public guest_view::GuestView<WebViewGuest>, void LoadProgressChanged(content::WebContents* source, double progress) override; void CloseContents(content::WebContents* source) override; - void FindReply(content::WebContents* source, - int request_id, - int number_of_matches, - const gfx::Rect& selection_rect, - int active_match_ordinal, - bool final_update) override; bool HandleContextMenu(const content::ContextMenuParams& params) override; void HandleKeyboardEvent( content::WebContents* source, |