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/ash_switches.h" | 7 #include "ash/ash_switches.h" |
8 #include "ash/desktop_background/desktop_background_controller_observer.h" | 8 #include "ash/desktop_background/desktop_background_controller_observer.h" |
9 #include "ash/desktop_background/desktop_background_view.h" | 9 #include "ash/desktop_background/desktop_background_view.h" |
10 #include "ash/desktop_background/desktop_background_widget_controller.h" | 10 #include "ash/desktop_background/desktop_background_widget_controller.h" |
(...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
217 IDR_AURA_WALLPAPER_DEFAULT_SMALL; | 217 IDR_AURA_WALLPAPER_DEFAULT_SMALL; |
218 WallpaperLayout resource_layout = WALLPAPER_LAYOUT_TILE; | 218 WallpaperLayout resource_layout = WALLPAPER_LAYOUT_TILE; |
219 | 219 |
220 CommandLine* command_line = command_line_for_testing_ ? | 220 CommandLine* command_line = command_line_for_testing_ ? |
221 command_line_for_testing_ : CommandLine::ForCurrentProcess(); | 221 command_line_for_testing_ : CommandLine::ForCurrentProcess(); |
222 const char* switch_name = NULL; | 222 const char* switch_name = NULL; |
223 if (is_guest) { | 223 if (is_guest) { |
224 switch_name = use_large ? switches::kAshGuestWallpaperLarge : | 224 switch_name = use_large ? switches::kAshGuestWallpaperLarge : |
225 switches::kAshGuestWallpaperSmall; | 225 switches::kAshGuestWallpaperSmall; |
226 } else { | 226 } else { |
227 const char* oem_switch_name = use_large ? switches::kAshOemWallpaperLarge : | 227 switch_name = use_large ? switches::kAshDefaultWallpaperLarge : |
228 switches::kAshOemWallpaperSmall; | |
229 const char* default_switch_name = use_large ? | |
230 switches::kAshDefaultWallpaperLarge : | |
231 switches::kAshDefaultWallpaperSmall; | 228 switches::kAshDefaultWallpaperSmall; |
232 switch_name = command_line->HasSwitch(oem_switch_name) ? oem_switch_name : | |
233 default_switch_name; | |
234 } | 229 } |
235 file_path = command_line->GetSwitchValuePath(switch_name); | 230 file_path = command_line->GetSwitchValuePath(switch_name); |
236 | 231 |
237 if (DefaultWallpaperIsAlreadyLoadingOrLoaded(file_path, resource_id)) | 232 if (DefaultWallpaperIsAlreadyLoadingOrLoaded(file_path, resource_id)) |
238 return false; | 233 return false; |
239 | 234 |
240 CancelPendingWallpaperOperation(); | 235 CancelPendingWallpaperOperation(); |
241 wallpaper_loader_ = new WallpaperLoader( | 236 wallpaper_loader_ = new WallpaperLoader( |
242 file_path, file_layout, resource_id, resource_layout); | 237 file_path, file_layout, resource_id, resource_layout); |
243 base::WorkerPool::PostTaskAndReply( | 238 base::WorkerPool::PostTaskAndReply( |
(...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
455 iter->rotation() == gfx::Display::ROTATE_270) { | 450 iter->rotation() == gfx::Display::ROTATE_270) { |
456 size_in_pixel = gfx::Size(size_in_pixel.height(), size_in_pixel.width()); | 451 size_in_pixel = gfx::Size(size_in_pixel.height(), size_in_pixel.width()); |
457 } | 452 } |
458 width = std::max(size_in_pixel.width(), width); | 453 width = std::max(size_in_pixel.width(), width); |
459 height = std::max(size_in_pixel.height(), height); | 454 height = std::max(size_in_pixel.height(), height); |
460 } | 455 } |
461 return gfx::Size(width, height); | 456 return gfx::Size(width, height); |
462 } | 457 } |
463 | 458 |
464 } // namespace ash | 459 } // namespace ash |
OLD | NEW |