OLD | NEW |
---|---|
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/gpu/gpu_messages.h" | 25 #include "content/common/gpu/gpu_messages.h" |
26 #include "content/common/input/web_touch_event_traits.h" | 26 #include "content/common/input/web_touch_event_traits.h" |
27 #include "content/common/site_isolation_policy.h" | |
27 #include "content/common/view_messages.h" | 28 #include "content/common/view_messages.h" |
28 #include "content/common/webplugin_geometry.h" | 29 #include "content/common/webplugin_geometry.h" |
29 #include "content/public/common/content_switches.h" | 30 #include "content/public/common/content_switches.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 |
36 | 37 |
(...skipping 321 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
358 return gfx::NativeViewAccessible(); | 359 return gfx::NativeViewAccessible(); |
359 return rwhv->GetNativeViewAccessible(); | 360 return rwhv->GetNativeViewAccessible(); |
360 } | 361 } |
361 | 362 |
362 void RenderWidgetHostViewGuest::MovePluginWindows( | 363 void RenderWidgetHostViewGuest::MovePluginWindows( |
363 const std::vector<WebPluginGeometry>& moves) { | 364 const std::vector<WebPluginGeometry>& moves) { |
364 platform_view_->MovePluginWindows(moves); | 365 platform_view_->MovePluginWindows(moves); |
365 } | 366 } |
366 | 367 |
367 void RenderWidgetHostViewGuest::UpdateCursor(const WebCursor& cursor) { | 368 void RenderWidgetHostViewGuest::UpdateCursor(const WebCursor& cursor) { |
368 // InterstitialPages are not WebContents so we cannot intercept | 369 // InterstitialPages are not WebContents so we cannot interceptG |
kenrb
2016/02/01 20:12:43
nit: typo
EhsanK
2016/02/12 15:46:59
Done.
| |
369 // ViewHostMsg_SetCursor for interstitial pages in BrowserPluginGuest. | 370 // ViewHostMsg_SetCursor for interstitial pages in BrowserPluginGuest. |
370 // All guest RenderViewHosts have RenderWidgetHostViewGuests however, | 371 // All guest RenderViewHosts have RenderWidgetHostViewGuests however, |
371 // and so we will always hit this code path. | 372 // and so we will always hit this code path. |
372 if (!guest_) | 373 if (!guest_) |
373 return; | 374 return; |
374 guest_->SendMessageToEmbedder( | 375 guest_->SendMessageToEmbedder( |
375 new BrowserPluginMsg_SetCursor(guest_->browser_plugin_instance_id(), | 376 new BrowserPluginMsg_SetCursor(guest_->browser_plugin_instance_id(), |
376 cursor)); | 377 cursor)); |
377 | 378 |
378 } | 379 } |
379 | 380 |
380 void RenderWidgetHostViewGuest::SetIsLoading(bool is_loading) { | 381 void RenderWidgetHostViewGuest::SetIsLoading(bool is_loading) { |
381 platform_view_->SetIsLoading(is_loading); | 382 platform_view_->SetIsLoading(is_loading); |
382 } | 383 } |
383 | 384 |
384 void RenderWidgetHostViewGuest::TextInputStateChanged( | 385 void RenderWidgetHostViewGuest::NotifyTextInputStateChanged() { |
385 const ViewHostMsg_TextInputState_Params& params) { | |
386 if (!guest_) | 386 if (!guest_) |
387 return; | 387 return; |
388 | 388 |
389 RenderWidgetHostViewBase::NotifyTextInputStateChanged(); | |
390 | |
389 RenderWidgetHostViewBase* rwhv = GetOwnerRenderWidgetHostView(); | 391 RenderWidgetHostViewBase* rwhv = GetOwnerRenderWidgetHostView(); |
390 if (!rwhv) | 392 // Notify the embedder of a change in text input state. |
391 return; | 393 rwhv->NotifyGuestTextInputStateChanged(this); |
392 // Forward the information to embedding RWHV. | |
393 rwhv->TextInputStateChanged(params); | |
394 } | 394 } |
395 | 395 |
396 void RenderWidgetHostViewGuest::ImeCancelComposition() { | 396 void RenderWidgetHostViewGuest::ImeCancelComposition() { |
397 if (!guest_) | 397 if (!guest_) |
398 return; | 398 return; |
399 | 399 |
400 RenderWidgetHostViewBase* rwhv = GetOwnerRenderWidgetHostView(); | 400 RenderWidgetHostViewBase* rwhv = GetOwnerRenderWidgetHostView(); |
401 if (!rwhv) | 401 if (!rwhv) |
402 return; | 402 return; |
403 // Forward the information to embedding RWHV. | 403 // Forward the information to embedding RWHV. |
(...skipping 302 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
706 if (gesture_event.type == blink::WebInputEvent::GestureScrollUpdate && | 706 if (gesture_event.type == blink::WebInputEvent::GestureScrollUpdate && |
707 gesture_event.data.scrollUpdate.inertial) { | 707 gesture_event.data.scrollUpdate.inertial) { |
708 return; | 708 return; |
709 } | 709 } |
710 host_->ForwardGestureEvent(gesture_event); | 710 host_->ForwardGestureEvent(gesture_event); |
711 return; | 711 return; |
712 } | 712 } |
713 } | 713 } |
714 | 714 |
715 } // namespace content | 715 } // namespace content |
OLD | NEW |