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_controller.h" | 5 #include "ash/desktop_background/desktop_background_controller.h" |
6 | 6 |
7 #include "ash/desktop_background/desktop_background_view.h" | 7 #include "ash/desktop_background/desktop_background_view.h" |
8 #include "ash/desktop_background/desktop_background_widget_controller.h" | 8 #include "ash/desktop_background/desktop_background_widget_controller.h" |
9 #include "ash/shell.h" | 9 #include "ash/shell.h" |
10 #include "ash/shell_factory.h" | 10 #include "ash/shell_factory.h" |
(...skipping 10 matching lines...) Expand all Loading... |
21 #include "ui/compositor/layer.h" | 21 #include "ui/compositor/layer.h" |
22 #include "ui/gfx/rect.h" | 22 #include "ui/gfx/rect.h" |
23 #include "ui/gfx/image/image.h" | 23 #include "ui/gfx/image/image.h" |
24 #include "ui/views/widget/widget.h" | 24 #include "ui/views/widget/widget.h" |
25 | 25 |
26 namespace ash { | 26 namespace ash { |
27 namespace { | 27 namespace { |
28 | 28 |
29 const int kSmallWallpaperMaximalWidth = 1366; | 29 const int kSmallWallpaperMaximalWidth = 1366; |
30 const int kSmallWallpaperMaximalHeight = 800; | 30 const int kSmallWallpaperMaximalHeight = 800; |
| 31 const SkColor kTransparentColor = SkColorSetARGB(0x00, 0x00, 0x00, 0x00); |
31 | 32 |
32 internal::RootWindowLayoutManager* GetRootWindowLayoutManager( | 33 internal::RootWindowLayoutManager* GetRootWindowLayoutManager( |
33 aura::RootWindow* root_window) { | 34 aura::RootWindow* root_window) { |
34 return static_cast<internal::RootWindowLayoutManager*>( | 35 return static_cast<internal::RootWindowLayoutManager*>( |
35 root_window->layout_manager()); | 36 root_window->layout_manager()); |
36 } | 37 } |
37 } // namespace | 38 } // namespace |
38 | 39 |
39 // Stores the current wallpaper data. | 40 // Stores the current wallpaper data. |
40 struct DesktopBackgroundController::WallpaperData { | 41 struct DesktopBackgroundController::WallpaperData { |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
96 const int index_; | 97 const int index_; |
97 | 98 |
98 const WallpaperResolution resolution_; | 99 const WallpaperResolution resolution_; |
99 | 100 |
100 DISALLOW_COPY_AND_ASSIGN(WallpaperOperation); | 101 DISALLOW_COPY_AND_ASSIGN(WallpaperOperation); |
101 }; | 102 }; |
102 | 103 |
103 DesktopBackgroundController::DesktopBackgroundController() | 104 DesktopBackgroundController::DesktopBackgroundController() |
104 : locked_(false), | 105 : locked_(false), |
105 desktop_background_mode_(BACKGROUND_SOLID_COLOR), | 106 desktop_background_mode_(BACKGROUND_SOLID_COLOR), |
106 background_color_(SK_ColorGRAY), | 107 background_color_(kTransparentColor), |
107 weak_ptr_factory_(ALLOW_THIS_IN_INITIALIZER_LIST(this)) { | 108 weak_ptr_factory_(ALLOW_THIS_IN_INITIALIZER_LIST(this)) { |
108 InstallComponentForAllWindows(); | 109 InstallComponentForAllWindows(); |
109 } | 110 } |
110 | 111 |
111 DesktopBackgroundController::~DesktopBackgroundController() { | 112 DesktopBackgroundController::~DesktopBackgroundController() { |
112 CancelPendingWallpaperOperation(); | 113 CancelPendingWallpaperOperation(); |
113 } | 114 } |
114 | 115 |
115 gfx::ImageSkia DesktopBackgroundController::GetWallpaper() const { | 116 gfx::ImageSkia DesktopBackgroundController::GetWallpaper() const { |
116 if (current_wallpaper_.get()) | 117 if (current_wallpaper_.get()) |
(...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
348 dst_container); | 349 dst_container); |
349 } | 350 } |
350 } | 351 } |
351 | 352 |
352 int DesktopBackgroundController::GetBackgroundContainerId(bool locked) { | 353 int DesktopBackgroundController::GetBackgroundContainerId(bool locked) { |
353 return locked ? internal::kShellWindowId_LockScreenBackgroundContainer : | 354 return locked ? internal::kShellWindowId_LockScreenBackgroundContainer : |
354 internal::kShellWindowId_DesktopBackgroundContainer; | 355 internal::kShellWindowId_DesktopBackgroundContainer; |
355 } | 356 } |
356 | 357 |
357 } // namespace ash | 358 } // namespace ash |
OLD | NEW |