Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(801)

Side by Side Diff: ash/desktop_background/desktop_background_controller.cc

Issue 10827368: ash: Avoid implicit conversion from ImageSkia into SkBitmap. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « ash/desktop_background/desktop_background_controller.h ('k') | ash/launcher/tabbed_launcher_button.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698