| 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 336 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 347 | 347 |
| 348 void RenderWidgetHostViewGuest::CopyFromCompositingSurface( | 348 void RenderWidgetHostViewGuest::CopyFromCompositingSurface( |
| 349 const gfx::Rect& src_subrect, | 349 const gfx::Rect& src_subrect, |
| 350 const gfx::Size& dst_size, | 350 const gfx::Size& dst_size, |
| 351 CopyFromCompositingSurfaceCallback& callback, | 351 CopyFromCompositingSurfaceCallback& callback, |
| 352 const SkColorType color_type) { | 352 const SkColorType color_type) { |
| 353 CHECK(guest_); | 353 CHECK(guest_); |
| 354 guest_->CopyFromCompositingSurface(src_subrect, dst_size, callback); | 354 guest_->CopyFromCompositingSurface(src_subrect, dst_size, callback); |
| 355 } | 355 } |
| 356 | 356 |
| 357 void RenderWidgetHostViewGuest::SetBackgroundOpaque(bool opaque) { | 357 void RenderWidgetHostViewGuest::SetBackgroundColor(SkColor color) { |
| 358 // Content embedders can toggle opaque backgrounds through this API. | 358 // Content embedders can toggle opaque backgrounds through this API. |
| 359 // We plumb the value here so that BrowserPlugin updates its compositing | 359 // We plumb the value here so that BrowserPlugin updates its compositing |
| 360 // state in response to this change. We also want to preserve this flag | 360 // state in response to this change. We also want to preserve this flag |
| 361 // after recovering from a crash so we let BrowserPluginGuest store it. | 361 // after recovering from a crash so we let BrowserPluginGuest store it. |
| 362 if (!guest_) | 362 if (!guest_) |
| 363 return; | 363 return; |
| 364 RenderWidgetHostViewBase::SetBackgroundOpaque(opaque); | 364 RenderWidgetHostViewBase::SetBackgroundColor(color); |
| 365 bool opaque = GetBackgroundOpaque(); |
| 365 host_->SetBackgroundOpaque(opaque); | 366 host_->SetBackgroundOpaque(opaque); |
| 366 guest_->SetContentsOpaque(opaque); | 367 guest_->SetContentsOpaque(opaque); |
| 367 } | 368 } |
| 368 | 369 |
| 369 bool RenderWidgetHostViewGuest::LockMouse() { | 370 bool RenderWidgetHostViewGuest::LockMouse() { |
| 370 return platform_view_->LockMouse(); | 371 return platform_view_->LockMouse(); |
| 371 } | 372 } |
| 372 | 373 |
| 373 void RenderWidgetHostViewGuest::UnlockMouse() { | 374 void RenderWidgetHostViewGuest::UnlockMouse() { |
| 374 return platform_view_->UnlockMouse(); | 375 return platform_view_->UnlockMouse(); |
| (...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 592 } | 593 } |
| 593 | 594 |
| 594 if (blink::WebInputEvent::isGestureEventType(event->type)) { | 595 if (blink::WebInputEvent::isGestureEventType(event->type)) { |
| 595 host_->ForwardGestureEvent( | 596 host_->ForwardGestureEvent( |
| 596 *static_cast<const blink::WebGestureEvent*>(event)); | 597 *static_cast<const blink::WebGestureEvent*>(event)); |
| 597 return; | 598 return; |
| 598 } | 599 } |
| 599 } | 600 } |
| 600 | 601 |
| 601 } // namespace content | 602 } // namespace content |
| OLD | NEW |