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