OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/browser_plugin/browser_plugin_guest.h" | 5 #include "content/browser/browser_plugin/browser_plugin_guest.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include <algorithm> | 9 #include <algorithm> |
10 | 10 |
11 #include "base/macros.h" | 11 #include "base/macros.h" |
12 #include "base/memory/ptr_util.h" | 12 #include "base/memory/ptr_util.h" |
13 #include "base/message_loop/message_loop.h" | 13 #include "base/message_loop/message_loop.h" |
14 #include "base/pickle.h" | 14 #include "base/pickle.h" |
15 #include "base/strings/utf_string_conversions.h" | 15 #include "base/strings/utf_string_conversions.h" |
16 #include "build/build_config.h" | 16 #include "build/build_config.h" |
17 #include "cc/surfaces/surface.h" | 17 #include "cc/surfaces/surface.h" |
| 18 #include "cc/surfaces/surface_info.h" |
18 #include "cc/surfaces/surface_manager.h" | 19 #include "cc/surfaces/surface_manager.h" |
19 #include "content/browser/browser_plugin/browser_plugin_embedder.h" | 20 #include "content/browser/browser_plugin/browser_plugin_embedder.h" |
20 #include "content/browser/browser_thread_impl.h" | 21 #include "content/browser/browser_thread_impl.h" |
21 #include "content/browser/child_process_security_policy_impl.h" | 22 #include "content/browser/child_process_security_policy_impl.h" |
22 #include "content/browser/compositor/surface_utils.h" | 23 #include "content/browser/compositor/surface_utils.h" |
23 #include "content/browser/frame_host/render_frame_host_impl.h" | 24 #include "content/browser/frame_host/render_frame_host_impl.h" |
24 #include "content/browser/frame_host/render_frame_proxy_host.h" | 25 #include "content/browser/frame_host/render_frame_proxy_host.h" |
25 #include "content/browser/frame_host/render_widget_host_view_child_frame.h" | 26 #include "content/browser/frame_host/render_widget_host_view_child_frame.h" |
26 #include "content/browser/frame_host/render_widget_host_view_guest.h" | 27 #include "content/browser/frame_host/render_widget_host_view_guest.h" |
27 #include "content/browser/loader/resource_dispatcher_host_impl.h" | 28 #include "content/browser/loader/resource_dispatcher_host_impl.h" |
(...skipping 379 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
407 embedder_visible_ = visible; | 408 embedder_visible_ = visible; |
408 UpdateVisibility(); | 409 UpdateVisibility(); |
409 } | 410 } |
410 | 411 |
411 void BrowserPluginGuest::PointerLockPermissionResponse(bool allow) { | 412 void BrowserPluginGuest::PointerLockPermissionResponse(bool allow) { |
412 SendMessageToEmbedder(base::MakeUnique<BrowserPluginMsg_SetMouseLock>( | 413 SendMessageToEmbedder(base::MakeUnique<BrowserPluginMsg_SetMouseLock>( |
413 browser_plugin_instance_id(), allow)); | 414 browser_plugin_instance_id(), allow)); |
414 } | 415 } |
415 | 416 |
416 void BrowserPluginGuest::SetChildFrameSurface( | 417 void BrowserPluginGuest::SetChildFrameSurface( |
417 const cc::SurfaceId& surface_id, | 418 const cc::SurfaceInfo& surface_info, |
418 const gfx::Size& frame_size, | |
419 float scale_factor, | |
420 const cc::SurfaceSequence& sequence) { | 419 const cc::SurfaceSequence& sequence) { |
421 has_attached_since_surface_set_ = false; | 420 has_attached_since_surface_set_ = false; |
422 SendMessageToEmbedder(base::MakeUnique<BrowserPluginMsg_SetChildFrameSurface>( | 421 SendMessageToEmbedder(base::MakeUnique<BrowserPluginMsg_SetChildFrameSurface>( |
423 browser_plugin_instance_id(), surface_id, frame_size, scale_factor, | 422 browser_plugin_instance_id(), surface_info, sequence)); |
424 sequence)); | |
425 } | 423 } |
426 | 424 |
427 void BrowserPluginGuest::OnSatisfySequence( | 425 void BrowserPluginGuest::OnSatisfySequence( |
428 int instance_id, | 426 int instance_id, |
429 const cc::SurfaceSequence& sequence) { | 427 const cc::SurfaceSequence& sequence) { |
430 GetSurfaceManager()->SatisfySequence(sequence); | 428 GetSurfaceManager()->SatisfySequence(sequence); |
431 } | 429 } |
432 | 430 |
433 void BrowserPluginGuest::OnRequireSequence( | 431 void BrowserPluginGuest::OnRequireSequence( |
434 int instance_id, | 432 int instance_id, |
(...skipping 621 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1056 range, character_bounds); | 1054 range, character_bounds); |
1057 } | 1055 } |
1058 #endif | 1056 #endif |
1059 | 1057 |
1060 void BrowserPluginGuest::SetContextMenuPosition(const gfx::Point& position) { | 1058 void BrowserPluginGuest::SetContextMenuPosition(const gfx::Point& position) { |
1061 if (delegate_) | 1059 if (delegate_) |
1062 delegate_->SetContextMenuPosition(position); | 1060 delegate_->SetContextMenuPosition(position); |
1063 } | 1061 } |
1064 | 1062 |
1065 } // namespace content | 1063 } // namespace content |
OLD | NEW |