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

Unified Diff: content/browser/frame_host/render_widget_host_view_guest.cc

Issue 549323002: BrowserPlugin: Interstitial Pages work (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed unit test Created 6 years, 3 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/frame_host/render_widget_host_view_guest.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/frame_host/render_widget_host_view_guest.cc
diff --git a/content/browser/frame_host/render_widget_host_view_guest.cc b/content/browser/frame_host/render_widget_host_view_guest.cc
index 7aa5b21148e40076aca06e7c744b7e898179770e..17abb252d92c7562124ec8045e335e6c7e332e3d 100644
--- a/content/browser/frame_host/render_widget_host_view_guest.cc
+++ b/content/browser/frame_host/render_widget_host_view_guest.cc
@@ -86,6 +86,12 @@ void RenderWidgetHostViewGuest::WasShown() {
// |guest_| is NULL during test.
if ((guest_ && guest_->is_in_destruction()) || !host_->is_hidden())
return;
+ // Make sure the size of this view matches the size of the WebContentsView.
+ // The two sizes may fall out of sync if we switch RenderWidgetHostViews,
+ // resize, and then switch page, as is the case with interstitial pages.
+ // NOTE: |guest_| is NULL in unit tests.
+ if (guest_)
+ SetSize(guest_->web_contents()->GetViewBounds().size());
host_->WasShown(ui::LatencyInfo());
}
@@ -105,6 +111,20 @@ void RenderWidgetHostViewGuest::SetBounds(const gfx::Rect& rect) {
SetSize(rect.size());
}
+void RenderWidgetHostViewGuest::Focus() {
+ // InterstitialPageImpl focuses views directly, so we place focus logic here.
+ // InterstitialPages are not WebContents, and so BrowserPluginGuest does not
+ // have direct access to the interstitial page's RenderWidgetHost.
+ if (guest_)
+ guest_->SetFocus(host_, true);
+}
+
+bool RenderWidgetHostViewGuest::HasFocus() const {
+ if (!guest_)
+ return false;
+ return guest_->focused();
+}
+
#if defined(USE_AURA)
void RenderWidgetHostViewGuest::ProcessAckedTouchEvent(
const TouchEventWithLatencyInfo& touch, InputEventAckState ack_result) {
@@ -266,7 +286,16 @@ void RenderWidgetHostViewGuest::MovePluginWindows(
}
void RenderWidgetHostViewGuest::UpdateCursor(const WebCursor& cursor) {
- platform_view_->UpdateCursor(cursor);
+ // InterstitialPages are not WebContents so we cannot intercept
+ // ViewHostMsg_SetCursor for interstitial pages in BrowserPluginGuest.
+ // All guest RenderViewHosts have RenderWidgetHostViewGuests however,
+ // and so we will always hit this code path.
+ if (!guest_)
+ return;
+ guest_->SendMessageToEmbedder(
+ new BrowserPluginMsg_SetCursor(guest_->browser_plugin_instance_id(),
+ cursor));
+
}
void RenderWidgetHostViewGuest::SetIsLoading(bool is_loading) {
@@ -563,8 +592,7 @@ void RenderWidgetHostViewGuest::OnHandleInputEvent(
if (blink::WebInputEvent::isKeyboardEventType(event->type)) {
if (!embedder->GetLastKeyboardEvent())
return;
- NativeWebKeyboardEvent keyboard_event(
- *embedder->GetLastKeyboardEvent());
+ NativeWebKeyboardEvent keyboard_event(*embedder->GetLastKeyboardEvent());
host_->ForwardKeyboardEvent(keyboard_event);
return;
}
« no previous file with comments | « content/browser/frame_host/render_widget_host_view_guest.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698