| 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 "ash/desktop_background/desktop_background_view.h" | 5 #include "ash/desktop_background/desktop_background_view.h" |
| 6 | 6 |
| 7 #include "ash/aura/wm_window_aura.h" | 7 #include "ash/aura/wm_window_aura.h" |
| 8 #include "ash/common/display/display_info.h" | 8 #include "ash/common/display/display_info.h" |
| 9 #include "ash/common/session/session_state_delegate.h" | 9 #include "ash/common/session/session_state_delegate.h" |
| 10 #include "ash/common/wm/overview/window_selector_controller.h" | 10 #include "ash/common/wm/overview/window_selector_controller.h" |
| (...skipping 23 matching lines...) Expand all Loading... |
| 34 class LayerControlView : public views::View { | 34 class LayerControlView : public views::View { |
| 35 public: | 35 public: |
| 36 explicit LayerControlView(views::View* view) { | 36 explicit LayerControlView(views::View* view) { |
| 37 AddChildView(view); | 37 AddChildView(view); |
| 38 view->SetPaintToLayer(true); | 38 view->SetPaintToLayer(true); |
| 39 } | 39 } |
| 40 | 40 |
| 41 // Overrides views::View. | 41 // Overrides views::View. |
| 42 void Layout() override { | 42 void Layout() override { |
| 43 WmWindow* window = WmLookup::Get()->GetWindowForWidget(GetWidget()); | 43 WmWindow* window = WmLookup::Get()->GetWindowForWidget(GetWidget()); |
| 44 // Keep |this| at the bottom since there may be other windows on top of the |
| 45 // background view such as an overview mode shield. |
| 46 window->GetParent()->StackChildAtBottom(window); |
| 44 display::Display display = window->GetDisplayNearestWindow(); | 47 display::Display display = window->GetDisplayNearestWindow(); |
| 45 DisplayInfo info = WmShell::Get()->GetDisplayInfo(display.id()); | 48 DisplayInfo info = WmShell::Get()->GetDisplayInfo(display.id()); |
| 46 float ui_scale = info.GetEffectiveUIScale(); | 49 float ui_scale = info.GetEffectiveUIScale(); |
| 47 gfx::Size rounded_size = | 50 gfx::Size rounded_size = |
| 48 gfx::ScaleToFlooredSize(display.size(), 1.f / ui_scale); | 51 gfx::ScaleToFlooredSize(display.size(), 1.f / ui_scale); |
| 49 DCHECK_EQ(1, child_count()); | 52 DCHECK_EQ(1, child_count()); |
| 50 views::View* child = child_at(0); | 53 views::View* child = child_at(0); |
| 51 child->SetBounds(0, 0, rounded_size.width(), rounded_size.height()); | 54 child->SetBounds(0, 0, rounded_size.width(), rounded_size.height()); |
| 52 gfx::Transform transform; | 55 gfx::Transform transform; |
| 53 // Apply RTL transform explicitly becacuse Views layer code | 56 // Apply RTL transform explicitly becacuse Views layer code |
| (...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 229 } else { | 232 } else { |
| 230 // Disable animation if transition to login screen from an empty background. | 233 // Disable animation if transition to login screen from an empty background. |
| 231 desktop_window->SetVisibilityAnimationTransition(::wm::ANIMATE_NONE); | 234 desktop_window->SetVisibilityAnimationTransition(::wm::ANIMATE_NONE); |
| 232 } | 235 } |
| 233 | 236 |
| 234 desktop_widget->SetBounds(params.parent->bounds()); | 237 desktop_widget->SetBounds(params.parent->bounds()); |
| 235 return desktop_widget; | 238 return desktop_widget; |
| 236 } | 239 } |
| 237 | 240 |
| 238 } // namespace ash | 241 } // namespace ash |
| OLD | NEW |