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/common/wallpaper/wallpaper_view.h" | 5 #include "ash/common/wallpaper/wallpaper_view.h" |
6 | 6 |
7 #include "ash/common/session/session_state_delegate.h" | 7 #include "ash/common/session/session_state_delegate.h" |
8 #include "ash/common/wallpaper/wallpaper_controller.h" | 8 #include "ash/common/wallpaper/wallpaper_controller.h" |
9 #include "ash/common/wallpaper/wallpaper_delegate.h" | 9 #include "ash/common/wallpaper/wallpaper_delegate.h" |
10 #include "ash/common/wallpaper/wallpaper_widget_controller.h" | 10 #include "ash/common/wallpaper/wallpaper_widget_controller.h" |
(...skipping 16 matching lines...) Expand all Loading... |
27 | 27 |
28 // A view that controls the child view's layer so that the layer always has the | 28 // A view that controls the child view's layer so that the layer always has the |
29 // same size as the display's original, un-scaled size in DIP. The layer is then | 29 // same size as the display's original, un-scaled size in DIP. The layer is then |
30 // transformed to fit to the virtual screen size when laid-out. This is to avoid | 30 // transformed to fit to the virtual screen size when laid-out. This is to avoid |
31 // scaling the image at painting time, then scaling it back to the screen size | 31 // scaling the image at painting time, then scaling it back to the screen size |
32 // in the compositor. | 32 // in the compositor. |
33 class LayerControlView : public views::View { | 33 class LayerControlView : public views::View { |
34 public: | 34 public: |
35 explicit LayerControlView(views::View* view) { | 35 explicit LayerControlView(views::View* view) { |
36 AddChildView(view); | 36 AddChildView(view); |
37 view->SetPaintToLayer(true); | 37 view->SetPaintToLayer(); |
38 } | 38 } |
39 | 39 |
40 // Overrides views::View. | 40 // Overrides views::View. |
41 void Layout() override { | 41 void Layout() override { |
42 WmWindow* window = WmLookup::Get()->GetWindowForWidget(GetWidget()); | 42 WmWindow* window = WmLookup::Get()->GetWindowForWidget(GetWidget()); |
43 // Keep |this| at the bottom since there may be other windows on top of the | 43 // Keep |this| at the bottom since there may be other windows on top of the |
44 // wallpaper view such as an overview mode shield. | 44 // wallpaper view such as an overview mode shield. |
45 window->GetParent()->StackChildAtBottom(window); | 45 window->GetParent()->StackChildAtBottom(window); |
46 display::Display display = window->GetDisplayNearestWindow(); | 46 display::Display display = window->GetDisplayNearestWindow(); |
47 | 47 |
(...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
231 // Disable animation if transition to login screen from an empty background. | 231 // Disable animation if transition to login screen from an empty background. |
232 wallpaper_window->SetVisibilityAnimationTransition(::wm::ANIMATE_NONE); | 232 wallpaper_window->SetVisibilityAnimationTransition(::wm::ANIMATE_NONE); |
233 } | 233 } |
234 | 234 |
235 WmWindow* container = root_window->GetChildByShellWindowId(container_id); | 235 WmWindow* container = root_window->GetChildByShellWindowId(container_id); |
236 wallpaper_widget->SetBounds(container->GetBounds()); | 236 wallpaper_widget->SetBounds(container->GetBounds()); |
237 return wallpaper_widget; | 237 return wallpaper_widget; |
238 } | 238 } |
239 | 239 |
240 } // namespace ash | 240 } // namespace ash |
OLD | NEW |