| 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 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 117 return current_wallpaper_->wallpaper_image; | 117 return current_wallpaper_->wallpaper_image; |
| 118 return gfx::ImageSkia(); | 118 return gfx::ImageSkia(); |
| 119 } | 119 } |
| 120 | 120 |
| 121 WallpaperLayout DesktopBackgroundController::GetWallpaperLayout() const { | 121 WallpaperLayout DesktopBackgroundController::GetWallpaperLayout() const { |
| 122 if (current_wallpaper_.get()) | 122 if (current_wallpaper_.get()) |
| 123 return current_wallpaper_->wallpaper_layout; | 123 return current_wallpaper_->wallpaper_layout; |
| 124 return CENTER_CROPPED; | 124 return CENTER_CROPPED; |
| 125 } | 125 } |
| 126 | 126 |
| 127 SkBitmap DesktopBackgroundController::GetCurrentWallpaperImage() { | 127 gfx::ImageSkia DesktopBackgroundController::GetCurrentWallpaperImage() { |
| 128 if (desktop_background_mode_ != BACKGROUND_IMAGE) | 128 if (desktop_background_mode_ != BACKGROUND_IMAGE) |
| 129 return SkBitmap(); | 129 return gfx::ImageSkia(); |
| 130 return GetWallpaper(); | 130 return GetWallpaper(); |
| 131 } | 131 } |
| 132 | 132 |
| 133 void DesktopBackgroundController::OnRootWindowAdded( | 133 void DesktopBackgroundController::OnRootWindowAdded( |
| 134 aura::RootWindow* root_window) { | 134 aura::RootWindow* root_window) { |
| 135 // Handle resolution change for "built-in" images." | 135 // Handle resolution change for "built-in" images." |
| 136 if (BACKGROUND_IMAGE == desktop_background_mode_) { | 136 if (BACKGROUND_IMAGE == desktop_background_mode_) { |
| 137 if (current_wallpaper_.get()) { | 137 if (current_wallpaper_.get()) { |
| 138 gfx::Size root_window_size = root_window->GetHostSize(); | 138 gfx::Size root_window_size = root_window->GetHostSize(); |
| 139 int wallpaper_width = current_wallpaper_->wallpaper_image.width(); | 139 int wallpaper_width = current_wallpaper_->wallpaper_image.width(); |
| (...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 340 iter != root_windows.end(); ++iter) { | 340 iter != root_windows.end(); ++iter) { |
| 341 gfx::Size root_window_size = (*iter)->GetHostSize(); | 341 gfx::Size root_window_size = (*iter)->GetHostSize(); |
| 342 if (root_window_size.width() > kSmallWallpaperMaximalWidth || | 342 if (root_window_size.width() > kSmallWallpaperMaximalWidth || |
| 343 root_window_size.height() > kSmallWallpaperMaximalHeight) | 343 root_window_size.height() > kSmallWallpaperMaximalHeight) |
| 344 resolution = LARGE; | 344 resolution = LARGE; |
| 345 } | 345 } |
| 346 return resolution; | 346 return resolution; |
| 347 } | 347 } |
| 348 | 348 |
| 349 } // namespace ash | 349 } // namespace ash |
| OLD | NEW |