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 <limits> | 7 #include <limits> |
8 | 8 |
9 #include "ash/ash_export.h" | 9 #include "ash/ash_export.h" |
10 #include "ash/desktop_background/desktop_background_controller.h" | 10 #include "ash/desktop_background/desktop_background_controller.h" |
(...skipping 10 matching lines...) Expand all Loading... |
21 #include "ui/aura/window_event_dispatcher.h" | 21 #include "ui/aura/window_event_dispatcher.h" |
22 #include "ui/base/resource/resource_bundle.h" | 22 #include "ui/base/resource/resource_bundle.h" |
23 #include "ui/compositor/layer.h" | 23 #include "ui/compositor/layer.h" |
24 #include "ui/gfx/canvas.h" | 24 #include "ui/gfx/canvas.h" |
25 #include "ui/gfx/image/image.h" | 25 #include "ui/gfx/image/image.h" |
26 #include "ui/gfx/size_conversions.h" | 26 #include "ui/gfx/size_conversions.h" |
27 #include "ui/gfx/transform.h" | 27 #include "ui/gfx/transform.h" |
28 #include "ui/views/widget/widget.h" | 28 #include "ui/views/widget/widget.h" |
29 | 29 |
30 namespace ash { | 30 namespace ash { |
31 namespace internal { | |
32 namespace { | 31 namespace { |
33 | 32 |
34 // For our scaling ratios we need to round positive numbers. | 33 // For our scaling ratios we need to round positive numbers. |
35 int RoundPositive(double x) { | 34 int RoundPositive(double x) { |
36 return static_cast<int>(floor(x + 0.5)); | 35 return static_cast<int>(floor(x + 0.5)); |
37 } | 36 } |
38 | 37 |
39 // A view that controls the child view's layer so that the layer | 38 // A view that controls the child view's layer so that the layer |
40 // always has the same size as the display's original, un-scaled size | 39 // always has the same size as the display's original, un-scaled size |
41 // in DIP. The layer then transformed to fit to the virtual screen | 40 // in DIP. The layer then transformed to fit to the virtual screen |
(...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
217 } else { | 216 } else { |
218 // Disable animation if transition to login screen from an empty background. | 217 // Disable animation if transition to login screen from an empty background. |
219 wm::SetWindowVisibilityAnimationTransition( | 218 wm::SetWindowVisibilityAnimationTransition( |
220 desktop_widget->GetNativeView(), wm::ANIMATE_NONE); | 219 desktop_widget->GetNativeView(), wm::ANIMATE_NONE); |
221 } | 220 } |
222 | 221 |
223 desktop_widget->SetBounds(params.parent->bounds()); | 222 desktop_widget->SetBounds(params.parent->bounds()); |
224 return desktop_widget; | 223 return desktop_widget; |
225 } | 224 } |
226 | 225 |
227 } // namespace internal | |
228 } // namespace ash | 226 } // namespace ash |
OLD | NEW |