| 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 "chrome/browser/ui/webui/options2/chromeos/set_wallpaper_options_handle
r2.h" | 5 #include "chrome/browser/ui/webui/options2/chromeos/set_wallpaper_options_handle
r2.h" |
| 6 | 6 |
| 7 #include "ash/desktop_background/desktop_background_controller.h" | 7 #include "ash/desktop_background/desktop_background_controller.h" |
| 8 #include "ash/desktop_background/desktop_background_resources.h" | 8 #include "ash/desktop_background/desktop_background_resources.h" |
| 9 #include "ash/shell.h" | 9 #include "ash/shell.h" |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 99 !args->GetString(0, &image_url)) | 99 !args->GetString(0, &image_url)) |
| 100 NOTREACHED(); | 100 NOTREACHED(); |
| 101 | 101 |
| 102 if (image_url.empty()) | 102 if (image_url.empty()) |
| 103 return; | 103 return; |
| 104 | 104 |
| 105 int user_image_index; | 105 int user_image_index; |
| 106 if (IsDefaultWallpaperURL(image_url, &user_image_index)) { | 106 if (IsDefaultWallpaperURL(image_url, &user_image_index)) { |
| 107 UserManager::Get()->SaveUserWallpaperIndex(user_image_index); | 107 UserManager::Get()->SaveUserWallpaperIndex(user_image_index); |
| 108 ash::Shell::GetInstance()->desktop_background_controller()-> | 108 ash::Shell::GetInstance()->desktop_background_controller()-> |
| 109 SetDesktopBackgroundImageMode(); | 109 SetLoggedInUserWallpaper(); |
| 110 } | 110 } |
| 111 } | 111 } |
| 112 | 112 |
| 113 gfx::NativeWindow SetWallpaperOptionsHandler::GetBrowserWindow() const { | 113 gfx::NativeWindow SetWallpaperOptionsHandler::GetBrowserWindow() const { |
| 114 Browser* browser = | 114 Browser* browser = |
| 115 BrowserList::FindBrowserWithProfile(Profile::FromWebUI(web_ui())); | 115 BrowserList::FindBrowserWithProfile(Profile::FromWebUI(web_ui())); |
| 116 if (!browser) | 116 if (!browser) |
| 117 return NULL; | 117 return NULL; |
| 118 return browser->window()->GetNativeHandle(); | 118 return browser->window()->GetNativeHandle(); |
| 119 } | 119 } |
| 120 | 120 |
| 121 } // namespace options2 | 121 } // namespace options2 |
| 122 } // namespace chromeos | 122 } // namespace chromeos |
| OLD | NEW |