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

Unified Diff: content/browser/browser_plugin/browser_plugin_guest.cc

Issue 2836973002: Enable find-in-page across GuestViews. (Closed)
Patch Set: Small fix. 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
« no previous file with comments | « content/browser/browser_plugin/browser_plugin_guest.h ('k') | content/browser/find_request_manager.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/browser_plugin/browser_plugin_guest.cc
diff --git a/content/browser/browser_plugin/browser_plugin_guest.cc b/content/browser/browser_plugin/browser_plugin_guest.cc
index e6baddc7d35f1ff5d1b0efcf65ba65ddca6405d2..cdc1381ae2d8b97c0b4900fae02cb38a03ad9278 100644
--- a/content/browser/browser_plugin/browser_plugin_guest.cc
+++ b/content/browser/browser_plugin/browser_plugin_guest.cc
@@ -147,6 +147,8 @@ int BrowserPluginGuest::GetGuestProxyRoutingID() {
// create a RenderFrameProxyHost for the reverse path, or implement
// MimeHandlerViewGuest using OOPIF (https://crbug.com/659750).
SiteInstance* owner_site_instance = delegate_->GetOwnerSiteInstance();
+ if (!owner_site_instance)
+ return MSG_ROUTING_NONE;
int proxy_routing_id = GetWebContents()
->GetFrameTree()
->root()
@@ -178,8 +180,12 @@ void BrowserPluginGuest::SizeContents(const gfx::Size& new_size) {
void BrowserPluginGuest::WillDestroy() {
is_in_destruction_ = true;
- owner_web_contents_ = nullptr;
+
+ // It is important that the WebContents is notified before detaching.
+ GetWebContents()->BrowserPluginGuestWillDetach();
+
attached_ = false;
+ owner_web_contents_ = nullptr;
}
RenderWidgetHostImpl* BrowserPluginGuest::GetOwnerRenderWidgetHost() const {
@@ -430,17 +436,6 @@ void BrowserPluginGuest::OnRequireSequence(
GetSurfaceManager()->RequireSequence(id, sequence);
}
-bool BrowserPluginGuest::HandleFindForEmbedder(
- int request_id,
- const base::string16& search_text,
- const blink::WebFindOptions& options) {
- return delegate_->HandleFindForEmbedder(request_id, search_text, options);
-}
-
-bool BrowserPluginGuest::HandleStopFindingForEmbedder(StopFindAction action) {
- return delegate_->HandleStopFindingForEmbedder(action);
-}
-
void BrowserPluginGuest::ResendEventToEmbedder(
const blink::WebInputEvent& event) {
if (!attached() || !owner_web_contents_)
@@ -823,6 +818,9 @@ void BrowserPluginGuest::OnDetach(int browser_plugin_instance_id) {
if (!attached())
return;
+ // It is important that the WebContents is notified before detaching.
+ GetWebContents()->BrowserPluginGuestWillDetach();
+
// This tells BrowserPluginGuest to queue up all IPCs to BrowserPlugin until
// it's attached again.
attached_ = false;
« no previous file with comments | « content/browser/browser_plugin/browser_plugin_guest.h ('k') | content/browser/find_request_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698