| 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/renderer_host/render_widget_host_view_aura.h" | 5 #include "content/browser/renderer_host/render_widget_host_view_aura.h" |
| 6 | 6 |
| 7 #include "base/auto_reset.h" | 7 #include "base/auto_reset.h" |
| 8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/callback_helpers.h" | 10 #include "base/callback_helpers.h" |
| (...skipping 784 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 795 } | 795 } |
| 796 | 796 |
| 797 bool RenderWidgetHostViewAura::IsShowing() { | 797 bool RenderWidgetHostViewAura::IsShowing() { |
| 798 return window_->IsVisible(); | 798 return window_->IsVisible(); |
| 799 } | 799 } |
| 800 | 800 |
| 801 gfx::Rect RenderWidgetHostViewAura::GetViewBounds() const { | 801 gfx::Rect RenderWidgetHostViewAura::GetViewBounds() const { |
| 802 return window_->GetBoundsInScreen(); | 802 return window_->GetBoundsInScreen(); |
| 803 } | 803 } |
| 804 | 804 |
| 805 void RenderWidgetHostViewAura::SetBackgroundOpaque(bool opaque) { | 805 void RenderWidgetHostViewAura::SetBackgroundColor(SkColor color) { |
| 806 RenderWidgetHostViewBase::SetBackgroundOpaque(opaque); | 806 RenderWidgetHostViewBase::SetBackgroundColor(color); |
| 807 bool opaque = GetBackgroundOpaque(); |
| 807 host_->SetBackgroundOpaque(opaque); | 808 host_->SetBackgroundOpaque(opaque); |
| 808 window_->layer()->SetFillsBoundsOpaquely(opaque); | 809 window_->layer()->SetFillsBoundsOpaquely(opaque); |
| 809 } | 810 } |
| 810 | 811 |
| 811 gfx::Size RenderWidgetHostViewAura::GetVisibleViewportSize() const { | 812 gfx::Size RenderWidgetHostViewAura::GetVisibleViewportSize() const { |
| 812 gfx::Rect requested_rect(GetRequestedRendererSize()); | 813 gfx::Rect requested_rect(GetRequestedRendererSize()); |
| 813 requested_rect.Inset(insets_); | 814 requested_rect.Inset(insets_); |
| 814 return requested_rect.size(); | 815 return requested_rect.size(); |
| 815 } | 816 } |
| 816 | 817 |
| (...skipping 863 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1680 host_->LostCapture(); | 1681 host_->LostCapture(); |
| 1681 if (touch_editing_client_) | 1682 if (touch_editing_client_) |
| 1682 touch_editing_client_->EndTouchEditing(false); | 1683 touch_editing_client_->EndTouchEditing(false); |
| 1683 } | 1684 } |
| 1684 | 1685 |
| 1685 void RenderWidgetHostViewAura::OnPaint(gfx::Canvas* canvas) { | 1686 void RenderWidgetHostViewAura::OnPaint(gfx::Canvas* canvas) { |
| 1686 // For non-opaque windows, we don't draw anything, since we depend on the | 1687 // For non-opaque windows, we don't draw anything, since we depend on the |
| 1687 // canvas coming from the compositor to already be initialized as | 1688 // canvas coming from the compositor to already be initialized as |
| 1688 // transparent. | 1689 // transparent. |
| 1689 if (window_->layer()->fills_bounds_opaquely()) | 1690 if (window_->layer()->fills_bounds_opaquely()) |
| 1690 canvas->DrawColor(SK_ColorWHITE); | 1691 canvas->DrawColor(background_color_); |
| 1691 } | 1692 } |
| 1692 | 1693 |
| 1693 void RenderWidgetHostViewAura::OnDeviceScaleFactorChanged( | 1694 void RenderWidgetHostViewAura::OnDeviceScaleFactorChanged( |
| 1694 float device_scale_factor) { | 1695 float device_scale_factor) { |
| 1695 if (!host_ || !window_->GetRootWindow()) | 1696 if (!host_ || !window_->GetRootWindow()) |
| 1696 return; | 1697 return; |
| 1697 | 1698 |
| 1698 UpdateScreenInfo(window_); | 1699 UpdateScreenInfo(window_); |
| 1699 | 1700 |
| 1700 const gfx::Display display = gfx::Screen::GetScreenFor(window_)-> | 1701 const gfx::Display display = gfx::Screen::GetScreenFor(window_)-> |
| (...skipping 877 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2578 | 2579 |
| 2579 //////////////////////////////////////////////////////////////////////////////// | 2580 //////////////////////////////////////////////////////////////////////////////// |
| 2580 // RenderWidgetHostViewBase, public: | 2581 // RenderWidgetHostViewBase, public: |
| 2581 | 2582 |
| 2582 // static | 2583 // static |
| 2583 void RenderWidgetHostViewBase::GetDefaultScreenInfo(WebScreenInfo* results) { | 2584 void RenderWidgetHostViewBase::GetDefaultScreenInfo(WebScreenInfo* results) { |
| 2584 GetScreenInfoForWindow(results, NULL); | 2585 GetScreenInfoForWindow(results, NULL); |
| 2585 } | 2586 } |
| 2586 | 2587 |
| 2587 } // namespace content | 2588 } // namespace content |
| OLD | NEW |