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 "base/bind_helpers.h" | 5 #include "base/bind_helpers.h" |
6 #include "base/command_line.h" | 6 #include "base/command_line.h" |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "base/message_loop/message_loop.h" | 8 #include "base/message_loop/message_loop.h" |
9 #include "content/browser/browser_plugin/browser_plugin_guest.h" | 9 #include "content/browser/browser_plugin/browser_plugin_guest.h" |
10 #include "content/browser/frame_host/render_widget_host_view_guest.h" | 10 #include "content/browser/frame_host/render_widget_host_view_guest.h" |
(...skipping 349 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
360 void RenderWidgetHostViewGuest::CopyFromCompositingSurface( | 360 void RenderWidgetHostViewGuest::CopyFromCompositingSurface( |
361 const gfx::Rect& src_subrect, | 361 const gfx::Rect& src_subrect, |
362 const gfx::Size& dst_size, | 362 const gfx::Size& dst_size, |
363 CopyFromCompositingSurfaceCallback& callback, | 363 CopyFromCompositingSurfaceCallback& callback, |
364 const SkColorType color_type) { | 364 const SkColorType color_type) { |
365 CHECK(guest_); | 365 CHECK(guest_); |
366 guest_->CopyFromCompositingSurface(src_subrect, dst_size, callback); | 366 guest_->CopyFromCompositingSurface(src_subrect, dst_size, callback); |
367 } | 367 } |
368 | 368 |
369 void RenderWidgetHostViewGuest::SetBackgroundOpaque(bool opaque) { | 369 void RenderWidgetHostViewGuest::SetBackgroundOpaque(bool opaque) { |
370 platform_view_->SetBackgroundOpaque(opaque); | 370 // Content embedders can toggle opaque backgrounds through this API. |
| 371 // We plumb the value here so that BrowserPlugin updates its compositing |
| 372 // state in response to this change. We also want to preserve this flag |
| 373 // after recovering from a crash so we let BrowserPluginGuest store it. |
| 374 if (!guest_) |
| 375 return; |
| 376 RenderWidgetHostViewBase::SetBackgroundOpaque(opaque); |
| 377 host_->SetBackgroundOpaque(opaque); |
| 378 guest_->SetContentsOpaque(opaque); |
371 } | 379 } |
372 | 380 |
373 bool RenderWidgetHostViewGuest::LockMouse() { | 381 bool RenderWidgetHostViewGuest::LockMouse() { |
374 return platform_view_->LockMouse(); | 382 return platform_view_->LockMouse(); |
375 } | 383 } |
376 | 384 |
377 void RenderWidgetHostViewGuest::UnlockMouse() { | 385 void RenderWidgetHostViewGuest::UnlockMouse() { |
378 return platform_view_->UnlockMouse(); | 386 return platform_view_->UnlockMouse(); |
379 } | 387 } |
380 | 388 |
(...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
594 } | 602 } |
595 | 603 |
596 if (blink::WebInputEvent::isGestureEventType(event->type)) { | 604 if (blink::WebInputEvent::isGestureEventType(event->type)) { |
597 host_->ForwardGestureEvent( | 605 host_->ForwardGestureEvent( |
598 *static_cast<const blink::WebGestureEvent*>(event)); | 606 *static_cast<const blink::WebGestureEvent*>(event)); |
599 return; | 607 return; |
600 } | 608 } |
601 } | 609 } |
602 | 610 |
603 } // namespace content | 611 } // namespace content |
OLD | NEW |