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

Side by Side Diff: content/browser/frame_host/render_widget_host_view_guest.cc

Issue 1845083002: Fix <webview> cursors with --site-per-process and --isolate-extensions. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/browser/frame_host/render_widget_host_view_guest.h" 5 #include "content/browser/frame_host/render_widget_host_view_guest.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/bind_helpers.h" 9 #include "base/bind_helpers.h"
10 #include "base/command_line.h" 10 #include "base/command_line.h"
11 #include "base/logging.h" 11 #include "base/logging.h"
12 #include "base/message_loop/message_loop.h" 12 #include "base/message_loop/message_loop.h"
13 #include "build/build_config.h" 13 #include "build/build_config.h"
14 #include "cc/surfaces/surface.h" 14 #include "cc/surfaces/surface.h"
15 #include "cc/surfaces/surface_factory.h" 15 #include "cc/surfaces/surface_factory.h"
16 #include "cc/surfaces/surface_manager.h" 16 #include "cc/surfaces/surface_manager.h"
17 #include "cc/surfaces/surface_sequence.h" 17 #include "cc/surfaces/surface_sequence.h"
18 #include "content/browser/browser_plugin/browser_plugin_guest.h" 18 #include "content/browser/browser_plugin/browser_plugin_guest.h"
19 #include "content/browser/compositor/surface_utils.h" 19 #include "content/browser/compositor/surface_utils.h"
20 #include "content/browser/renderer_host/render_view_host_impl.h" 20 #include "content/browser/renderer_host/render_view_host_impl.h"
21 #include "content/browser/renderer_host/render_widget_host_delegate.h" 21 #include "content/browser/renderer_host/render_widget_host_delegate.h"
22 #include "content/browser/renderer_host/render_widget_host_input_event_router.h" 22 #include "content/browser/renderer_host/render_widget_host_input_event_router.h"
23 #include "content/common/browser_plugin/browser_plugin_messages.h" 23 #include "content/common/browser_plugin/browser_plugin_messages.h"
24 #include "content/common/frame_messages.h" 24 #include "content/common/frame_messages.h"
25 #include "content/common/input/web_touch_event_traits.h" 25 #include "content/common/input/web_touch_event_traits.h"
26 #include "content/common/site_isolation_policy.h"
26 #include "content/common/view_messages.h" 27 #include "content/common/view_messages.h"
27 #include "content/common/webplugin_geometry.h" 28 #include "content/common/webplugin_geometry.h"
28 #include "content/public/common/content_switches.h" 29 #include "content/public/common/content_switches.h"
29 #include "gpu/ipc/common/gpu_messages.h" 30 #include "gpu/ipc/common/gpu_messages.h"
30 #include "skia/ext/platform_canvas.h" 31 #include "skia/ext/platform_canvas.h"
31 #include "third_party/WebKit/public/platform/WebScreenInfo.h" 32 #include "third_party/WebKit/public/platform/WebScreenInfo.h"
32 33
33 #if defined(OS_MACOSX) 34 #if defined(OS_MACOSX)
34 #import "content/browser/renderer_host/render_widget_host_view_mac_dictionary_he lper.h" 35 #import "content/browser/renderer_host/render_widget_host_view_mac_dictionary_he lper.h"
35 #endif 36 #endif
(...skipping 291 matching lines...) Expand 10 before | Expand all | Expand 10 after
327 return rwhv->GetNativeViewAccessible(); 328 return rwhv->GetNativeViewAccessible();
328 } 329 }
329 330
330 void RenderWidgetHostViewGuest::UpdateCursor(const WebCursor& cursor) { 331 void RenderWidgetHostViewGuest::UpdateCursor(const WebCursor& cursor) {
331 // InterstitialPages are not WebContents so we cannot intercept 332 // InterstitialPages are not WebContents so we cannot intercept
332 // ViewHostMsg_SetCursor for interstitial pages in BrowserPluginGuest. 333 // ViewHostMsg_SetCursor for interstitial pages in BrowserPluginGuest.
333 // All guest RenderViewHosts have RenderWidgetHostViewGuests however, 334 // All guest RenderViewHosts have RenderWidgetHostViewGuests however,
334 // and so we will always hit this code path. 335 // and so we will always hit this code path.
335 if (!guest_) 336 if (!guest_)
336 return; 337 return;
337 guest_->SendMessageToEmbedder( 338 if (SiteIsolationPolicy::AreCrossProcessFramesPossible()) {
338 new BrowserPluginMsg_SetCursor(guest_->browser_plugin_instance_id(), 339 RenderWidgetHostViewBase* rwhvb = GetOwnerRenderWidgetHostView();
339 cursor)); 340 if (rwhvb)
340 341 rwhvb->UpdateCursor(cursor);
342 } else {
343 guest_->SendMessageToEmbedder(new BrowserPluginMsg_SetCursor(
344 guest_->browser_plugin_instance_id(), cursor));
345 }
341 } 346 }
342 347
343 void RenderWidgetHostViewGuest::SetIsLoading(bool is_loading) { 348 void RenderWidgetHostViewGuest::SetIsLoading(bool is_loading) {
344 platform_view_->SetIsLoading(is_loading); 349 platform_view_->SetIsLoading(is_loading);
345 } 350 }
346 351
347 void RenderWidgetHostViewGuest::TextInputStateChanged( 352 void RenderWidgetHostViewGuest::TextInputStateChanged(
348 const ViewHostMsg_TextInputState_Params& params) { 353 const ViewHostMsg_TextInputState_Params& params) {
349 if (!guest_) 354 if (!guest_)
350 return; 355 return;
(...skipping 263 matching lines...) Expand 10 before | Expand all | Expand 10 after
614 if (gesture_event.type == blink::WebInputEvent::GestureScrollUpdate && 619 if (gesture_event.type == blink::WebInputEvent::GestureScrollUpdate &&
615 gesture_event.data.scrollUpdate.inertial) { 620 gesture_event.data.scrollUpdate.inertial) {
616 return; 621 return;
617 } 622 }
618 host_->ForwardGestureEvent(gesture_event); 623 host_->ForwardGestureEvent(gesture_event);
619 return; 624 return;
620 } 625 }
621 } 626 }
622 627
623 } // namespace content 628 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698