| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/chromeos/login/users/wallpaper/wallpaper_manager.h" | 5 #include "chrome/browser/chromeos/login/users/wallpaper/wallpaper_manager.h" |
| 6 | 6 |
| 7 #include <numeric> | 7 #include <numeric> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "ash/ash_constants.h" | 10 #include "ash/ash_constants.h" |
| (...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 185 const base::FilePath& wallpaper_path, | 185 const base::FilePath& wallpaper_path, |
| 186 const bool is_default) { | 186 const bool is_default) { |
| 187 user_wallpaper_ = image; | 187 user_wallpaper_ = image; |
| 188 info_ = info; | 188 info_ = info; |
| 189 wallpaper_path_ = wallpaper_path; | 189 wallpaper_path_ = wallpaper_path; |
| 190 default_ = is_default; | 190 default_ = is_default; |
| 191 } | 191 } |
| 192 | 192 |
| 193 // This method is usually triggered by timer to actually load request. | 193 // This method is usually triggered by timer to actually load request. |
| 194 void ProcessRequest() { | 194 void ProcessRequest() { |
| 195 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 195 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
| 196 | 196 |
| 197 timer.Stop(); // Erase reference to self. | 197 timer.Stop(); // Erase reference to self. |
| 198 | 198 |
| 199 WallpaperManager* manager = WallpaperManager::Get(); | 199 WallpaperManager* manager = WallpaperManager::Get(); |
| 200 if (manager->pending_inactive_ == this) | 200 if (manager->pending_inactive_ == this) |
| 201 manager->pending_inactive_ = NULL; | 201 manager->pending_inactive_ = NULL; |
| 202 | 202 |
| 203 started_load_at_ = base::Time::Now(); | 203 started_load_at_ = base::Time::Now(); |
| 204 | 204 |
| 205 if (default_) { | 205 if (default_) { |
| (...skipping 18 matching lines...) Expand all Loading... |
| 224 // PendingWallpaper was created and never initialized? | 224 // PendingWallpaper was created and never initialized? |
| 225 NOTREACHED(); | 225 NOTREACHED(); |
| 226 // Error. Do not record time. | 226 // Error. Do not record time. |
| 227 started_load_at_ = base::Time(); | 227 started_load_at_ = base::Time(); |
| 228 } | 228 } |
| 229 on_finish_.reset(); | 229 on_finish_.reset(); |
| 230 } | 230 } |
| 231 | 231 |
| 232 // This method is called by callback, when load request is finished. | 232 // This method is called by callback, when load request is finished. |
| 233 void OnWallpaperSet() { | 233 void OnWallpaperSet() { |
| 234 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 234 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
| 235 | 235 |
| 236 // The only known case for this check to fail is global destruction during | 236 // The only known case for this check to fail is global destruction during |
| 237 // wallpaper load. It should never happen. | 237 // wallpaper load. It should never happen. |
| 238 if (!BrowserThread::CurrentlyOn(BrowserThread::UI)) | 238 if (!BrowserThread::CurrentlyOn(BrowserThread::UI)) |
| 239 return; // We are in a process of global destruction. | 239 return; // We are in a process of global destruction. |
| 240 | 240 |
| 241 timer.Stop(); // Erase reference to self. | 241 timer.Stop(); // Erase reference to self. |
| 242 | 242 |
| 243 WallpaperManager* manager = WallpaperManager::Get(); | 243 WallpaperManager* manager = WallpaperManager::Get(); |
| 244 if (!started_load_at_.is_null()) { | 244 if (!started_load_at_.is_null()) { |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 296 | 296 |
| 297 // static | 297 // static |
| 298 void WallpaperManager::Shutdown() { | 298 void WallpaperManager::Shutdown() { |
| 299 CHECK(wallpaper_manager); | 299 CHECK(wallpaper_manager); |
| 300 delete wallpaper_manager; | 300 delete wallpaper_manager; |
| 301 wallpaper_manager = nullptr; | 301 wallpaper_manager = nullptr; |
| 302 } | 302 } |
| 303 | 303 |
| 304 WallpaperManager::WallpaperResolution | 304 WallpaperManager::WallpaperResolution |
| 305 WallpaperManager::GetAppropriateResolution() { | 305 WallpaperManager::GetAppropriateResolution() { |
| 306 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 306 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
| 307 gfx::Size size = | 307 gfx::Size size = |
| 308 ash::DesktopBackgroundController::GetMaxDisplaySizeInNative(); | 308 ash::DesktopBackgroundController::GetMaxDisplaySizeInNative(); |
| 309 return (size.width() > wallpaper::kSmallWallpaperMaxWidth || | 309 return (size.width() > wallpaper::kSmallWallpaperMaxWidth || |
| 310 size.height() > wallpaper::kSmallWallpaperMaxHeight) | 310 size.height() > wallpaper::kSmallWallpaperMaxHeight) |
| 311 ? WALLPAPER_RESOLUTION_LARGE | 311 ? WALLPAPER_RESOLUTION_LARGE |
| 312 : WALLPAPER_RESOLUTION_SMALL; | 312 : WALLPAPER_RESOLUTION_SMALL; |
| 313 } | 313 } |
| 314 | 314 |
| 315 void WallpaperManager::AddObservers() { | 315 void WallpaperManager::AddObservers() { |
| 316 show_user_name_on_signin_subscription_ = | 316 show_user_name_on_signin_subscription_ = |
| (...skipping 15 matching lines...) Expand all Loading... |
| 332 UMA_HISTOGRAM_ENUMERATION("Ash.Wallpaper.Type", info.type, | 332 UMA_HISTOGRAM_ENUMERATION("Ash.Wallpaper.Type", info.type, |
| 333 user_manager::User::WALLPAPER_TYPE_COUNT); | 333 user_manager::User::WALLPAPER_TYPE_COUNT); |
| 334 if (info == current_user_wallpaper_info_) | 334 if (info == current_user_wallpaper_info_) |
| 335 return; | 335 return; |
| 336 } | 336 } |
| 337 SetUserWallpaperNow( | 337 SetUserWallpaperNow( |
| 338 user_manager::UserManager::Get()->GetLoggedInUser()->email()); | 338 user_manager::UserManager::Get()->GetLoggedInUser()->email()); |
| 339 } | 339 } |
| 340 | 340 |
| 341 void WallpaperManager::InitializeWallpaper() { | 341 void WallpaperManager::InitializeWallpaper() { |
| 342 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 342 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
| 343 user_manager::UserManager* user_manager = user_manager::UserManager::Get(); | 343 user_manager::UserManager* user_manager = user_manager::UserManager::Get(); |
| 344 | 344 |
| 345 // Apply device customization. | 345 // Apply device customization. |
| 346 if (ShouldUseCustomizedDefaultWallpaper()) { | 346 if (ShouldUseCustomizedDefaultWallpaper()) { |
| 347 SetDefaultWallpaperPath(GetCustomizedWallpaperDefaultRescaledFileName( | 347 SetDefaultWallpaperPath(GetCustomizedWallpaperDefaultRescaledFileName( |
| 348 wallpaper::kSmallWallpaperSuffix), | 348 wallpaper::kSmallWallpaperSuffix), |
| 349 scoped_ptr<gfx::ImageSkia>().Pass(), | 349 scoped_ptr<gfx::ImageSkia>().Pass(), |
| 350 GetCustomizedWallpaperDefaultRescaledFileName( | 350 GetCustomizedWallpaperDefaultRescaledFileName( |
| 351 wallpaper::kLargeWallpaperSuffix), | 351 wallpaper::kLargeWallpaperSuffix), |
| 352 scoped_ptr<gfx::ImageSkia>().Pass()); | 352 scoped_ptr<gfx::ImageSkia>().Pass()); |
| (...skipping 24 matching lines...) Expand all Loading... |
| 377 else | 377 else |
| 378 InitializeRegisteredDeviceWallpaper(); | 378 InitializeRegisteredDeviceWallpaper(); |
| 379 return; | 379 return; |
| 380 } | 380 } |
| 381 SetUserWallpaperDelayed(user_manager->GetLoggedInUser()->email()); | 381 SetUserWallpaperDelayed(user_manager->GetLoggedInUser()->email()); |
| 382 } | 382 } |
| 383 | 383 |
| 384 void WallpaperManager::Observe(int type, | 384 void WallpaperManager::Observe(int type, |
| 385 const content::NotificationSource& source, | 385 const content::NotificationSource& source, |
| 386 const content::NotificationDetails& details) { | 386 const content::NotificationDetails& details) { |
| 387 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 387 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
| 388 switch (type) { | 388 switch (type) { |
| 389 case chrome::NOTIFICATION_LOGIN_USER_CHANGED: { | 389 case chrome::NOTIFICATION_LOGIN_USER_CHANGED: { |
| 390 ClearDisposableWallpaperCache(); | 390 ClearDisposableWallpaperCache(); |
| 391 BrowserThread::PostDelayedTask( | 391 BrowserThread::PostDelayedTask( |
| 392 BrowserThread::UI, | 392 BrowserThread::UI, |
| 393 FROM_HERE, | 393 FROM_HERE, |
| 394 base::Bind(&WallpaperManager::MoveLoggedInUserCustomWallpaper, | 394 base::Bind(&WallpaperManager::MoveLoggedInUserCustomWallpaper, |
| 395 weak_factory_.GetWeakPtr()), | 395 weak_factory_.GetWeakPtr()), |
| 396 base::TimeDelta::FromSeconds(kMoveCustomWallpaperDelaySeconds)); | 396 base::TimeDelta::FromSeconds(kMoveCustomWallpaperDelaySeconds)); |
| 397 break; | 397 break; |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 450 } | 450 } |
| 451 | 451 |
| 452 void WallpaperManager::SetCustomWallpaper( | 452 void WallpaperManager::SetCustomWallpaper( |
| 453 const std::string& user_id, | 453 const std::string& user_id, |
| 454 const std::string& user_id_hash, | 454 const std::string& user_id_hash, |
| 455 const std::string& file, | 455 const std::string& file, |
| 456 wallpaper::WallpaperLayout layout, | 456 wallpaper::WallpaperLayout layout, |
| 457 user_manager::User::WallpaperType type, | 457 user_manager::User::WallpaperType type, |
| 458 const gfx::ImageSkia& image, | 458 const gfx::ImageSkia& image, |
| 459 bool update_wallpaper) { | 459 bool update_wallpaper) { |
| 460 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 460 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
| 461 | 461 |
| 462 // There is no visible background in kiosk mode. | 462 // There is no visible background in kiosk mode. |
| 463 if (user_manager::UserManager::Get()->IsLoggedInAsKioskApp()) | 463 if (user_manager::UserManager::Get()->IsLoggedInAsKioskApp()) |
| 464 return; | 464 return; |
| 465 | 465 |
| 466 // Don't allow custom wallpapers while policy is in effect. | 466 // Don't allow custom wallpapers while policy is in effect. |
| 467 if (type != user_manager::User::POLICY && IsPolicyControlled(user_id)) | 467 if (type != user_manager::User::POLICY && IsPolicyControlled(user_id)) |
| 468 return; | 468 return; |
| 469 | 469 |
| 470 base::FilePath wallpaper_path = GetCustomWallpaperPath( | 470 base::FilePath wallpaper_path = GetCustomWallpaperPath( |
| (...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 589 default_wallpaper_image_->image().height() == 1) | 589 default_wallpaper_image_->image().height() == 1) |
| 590 layout = wallpaper::WALLPAPER_LAYOUT_STRETCH; | 590 layout = wallpaper::WALLPAPER_LAYOUT_STRETCH; |
| 591 | 591 |
| 592 ash::Shell::GetInstance()->desktop_background_controller()->SetWallpaperImage( | 592 ash::Shell::GetInstance()->desktop_background_controller()->SetWallpaperImage( |
| 593 default_wallpaper_image_->image(), layout); | 593 default_wallpaper_image_->image(), layout); |
| 594 } | 594 } |
| 595 | 595 |
| 596 void WallpaperManager::SetUserWallpaperInfo(const std::string& user_id, | 596 void WallpaperManager::SetUserWallpaperInfo(const std::string& user_id, |
| 597 const WallpaperInfo& info, | 597 const WallpaperInfo& info, |
| 598 bool is_persistent) { | 598 bool is_persistent) { |
| 599 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 599 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
| 600 current_user_wallpaper_info_ = info; | 600 current_user_wallpaper_info_ = info; |
| 601 if (!is_persistent) | 601 if (!is_persistent) |
| 602 return; | 602 return; |
| 603 | 603 |
| 604 PrefService* local_state = g_browser_process->local_state(); | 604 PrefService* local_state = g_browser_process->local_state(); |
| 605 DictionaryPrefUpdate wallpaper_update(local_state, | 605 DictionaryPrefUpdate wallpaper_update(local_state, |
| 606 wallpaper::kUsersWallpaperInfo); | 606 wallpaper::kUsersWallpaperInfo); |
| 607 | 607 |
| 608 base::DictionaryValue* wallpaper_info_dict = new base::DictionaryValue(); | 608 base::DictionaryValue* wallpaper_info_dict = new base::DictionaryValue(); |
| 609 wallpaper_info_dict->SetString(kNewWallpaperDateNodeName, | 609 wallpaper_info_dict->SetString(kNewWallpaperDateNodeName, |
| 610 base::Int64ToString(info.date.ToInternalValue())); | 610 base::Int64ToString(info.date.ToInternalValue())); |
| 611 wallpaper_info_dict->SetString(kNewWallpaperLocationNodeName, info.location); | 611 wallpaper_info_dict->SetString(kNewWallpaperLocationNodeName, info.location); |
| 612 wallpaper_info_dict->SetInteger(kNewWallpaperLayoutNodeName, info.layout); | 612 wallpaper_info_dict->SetInteger(kNewWallpaperLayoutNodeName, info.layout); |
| 613 wallpaper_info_dict->SetInteger(kNewWallpaperTypeNodeName, info.type); | 613 wallpaper_info_dict->SetInteger(kNewWallpaperTypeNodeName, info.type); |
| 614 wallpaper_update->SetWithoutPathExpansion(user_id, wallpaper_info_dict); | 614 wallpaper_update->SetWithoutPathExpansion(user_id, wallpaper_info_dict); |
| 615 } | 615 } |
| 616 | 616 |
| 617 void WallpaperManager::ScheduleSetUserWallpaper(const std::string& user_id, | 617 void WallpaperManager::ScheduleSetUserWallpaper(const std::string& user_id, |
| 618 bool delayed) { | 618 bool delayed) { |
| 619 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 619 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
| 620 // Some unit tests come here without a UserManager or without a pref system.q | 620 // Some unit tests come here without a UserManager or without a pref system.q |
| 621 if (!user_manager::UserManager::IsInitialized() || | 621 if (!user_manager::UserManager::IsInitialized() || |
| 622 !g_browser_process->local_state()) { | 622 !g_browser_process->local_state()) { |
| 623 return; | 623 return; |
| 624 } | 624 } |
| 625 | 625 |
| 626 // There is no visible background in kiosk mode. | 626 // There is no visible background in kiosk mode. |
| 627 if (user_manager::UserManager::Get()->IsLoggedInAsKioskApp()) | 627 if (user_manager::UserManager::Get()->IsLoggedInAsKioskApp()) |
| 628 return; | 628 return; |
| 629 // Guest user, regular user in ephemeral mode, or kiosk app. | 629 // Guest user, regular user in ephemeral mode, or kiosk app. |
| (...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 811 int index = public_session_user_index != -1 ? public_session_user_index : 0; | 811 int index = public_session_user_index != -1 ? public_session_user_index : 0; |
| 812 // Normal boot, load user wallpaper. | 812 // Normal boot, load user wallpaper. |
| 813 // If normal boot animation is disabled wallpaper would be set | 813 // If normal boot animation is disabled wallpaper would be set |
| 814 // asynchronously once user pods are loaded. | 814 // asynchronously once user pods are loaded. |
| 815 SetUserWallpaperDelayed(users[index]->email()); | 815 SetUserWallpaperDelayed(users[index]->email()); |
| 816 } | 816 } |
| 817 } | 817 } |
| 818 | 818 |
| 819 bool WallpaperManager::GetUserWallpaperInfo(const std::string& user_id, | 819 bool WallpaperManager::GetUserWallpaperInfo(const std::string& user_id, |
| 820 WallpaperInfo* info) const { | 820 WallpaperInfo* info) const { |
| 821 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 821 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
| 822 | 822 |
| 823 if (user_manager::UserManager::Get()->IsUserNonCryptohomeDataEphemeral( | 823 if (user_manager::UserManager::Get()->IsUserNonCryptohomeDataEphemeral( |
| 824 user_id)) { | 824 user_id)) { |
| 825 // Default to the values cached in memory. | 825 // Default to the values cached in memory. |
| 826 *info = current_user_wallpaper_info_; | 826 *info = current_user_wallpaper_info_; |
| 827 | 827 |
| 828 // Ephemeral users do not save anything to local state. But we have got | 828 // Ephemeral users do not save anything to local state. But we have got |
| 829 // wallpaper info from memory. Returns true. | 829 // wallpaper info from memory. Returns true. |
| 830 return true; | 830 return true; |
| 831 } | 831 } |
| (...skipping 28 matching lines...) Expand all Loading... |
| 860 info->date = base::Time::FromInternalValue(date_val); | 860 info->date = base::Time::FromInternalValue(date_val); |
| 861 return true; | 861 return true; |
| 862 } | 862 } |
| 863 | 863 |
| 864 void WallpaperManager::OnWallpaperDecoded( | 864 void WallpaperManager::OnWallpaperDecoded( |
| 865 const std::string& user_id, | 865 const std::string& user_id, |
| 866 wallpaper::WallpaperLayout layout, | 866 wallpaper::WallpaperLayout layout, |
| 867 bool update_wallpaper, | 867 bool update_wallpaper, |
| 868 MovableOnDestroyCallbackHolder on_finish, | 868 MovableOnDestroyCallbackHolder on_finish, |
| 869 const user_manager::UserImage& user_image) { | 869 const user_manager::UserImage& user_image) { |
| 870 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 870 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
| 871 TRACE_EVENT_ASYNC_END0("ui", "LoadAndDecodeWallpaper", this); | 871 TRACE_EVENT_ASYNC_END0("ui", "LoadAndDecodeWallpaper", this); |
| 872 | 872 |
| 873 // If decoded wallpaper is empty, we have probably failed to decode the file. | 873 // If decoded wallpaper is empty, we have probably failed to decode the file. |
| 874 // Use default wallpaper in this case. | 874 // Use default wallpaper in this case. |
| 875 if (user_image.image().isNull()) { | 875 if (user_image.image().isNull()) { |
| 876 // Updates user pref to default wallpaper. | 876 // Updates user pref to default wallpaper. |
| 877 WallpaperInfo info = {"", | 877 WallpaperInfo info = {"", |
| 878 wallpaper::WALLPAPER_LAYOUT_CENTER_CROPPED, | 878 wallpaper::WALLPAPER_LAYOUT_CENTER_CROPPED, |
| 879 user_manager::User::DEFAULT, | 879 user_manager::User::DEFAULT, |
| 880 base::Time::Now().LocalMidnight()}; | 880 base::Time::Now().LocalMidnight()}; |
| (...skipping 12 matching lines...) Expand all Loading... |
| 893 ->desktop_background_controller() | 893 ->desktop_background_controller() |
| 894 ->SetWallpaperImage(user_image.image(), layout); | 894 ->SetWallpaperImage(user_image.image(), layout); |
| 895 } | 895 } |
| 896 } | 896 } |
| 897 | 897 |
| 898 void WallpaperManager::StartLoad(const std::string& user_id, | 898 void WallpaperManager::StartLoad(const std::string& user_id, |
| 899 const WallpaperInfo& info, | 899 const WallpaperInfo& info, |
| 900 bool update_wallpaper, | 900 bool update_wallpaper, |
| 901 const base::FilePath& wallpaper_path, | 901 const base::FilePath& wallpaper_path, |
| 902 MovableOnDestroyCallbackHolder on_finish) { | 902 MovableOnDestroyCallbackHolder on_finish) { |
| 903 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 903 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
| 904 TRACE_EVENT_ASYNC_BEGIN0("ui", "LoadAndDecodeWallpaper", this); | 904 TRACE_EVENT_ASYNC_BEGIN0("ui", "LoadAndDecodeWallpaper", this); |
| 905 if (update_wallpaper) { | 905 if (update_wallpaper) { |
| 906 // We are now about to change the wallpaper, so update the path and remove | 906 // We are now about to change the wallpaper, so update the path and remove |
| 907 // the existing image. | 907 // the existing image. |
| 908 wallpaper_cache_[user_id] = CustomWallpaperElement(wallpaper_path, | 908 wallpaper_cache_[user_id] = CustomWallpaperElement(wallpaper_path, |
| 909 gfx::ImageSkia()); | 909 gfx::ImageSkia()); |
| 910 } | 910 } |
| 911 wallpaper_loader_->Start(wallpaper_path.value(), | 911 wallpaper_loader_->Start(wallpaper_path.value(), |
| 912 0, // Do not crop. | 912 0, // Do not crop. |
| 913 base::Bind(&WallpaperManager::OnWallpaperDecoded, | 913 base::Bind(&WallpaperManager::OnWallpaperDecoded, |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 945 scoped_ptr<gfx::ImageSkia>().Pass()); | 945 scoped_ptr<gfx::ImageSkia>().Pass()); |
| 946 } | 946 } |
| 947 } | 947 } |
| 948 | 948 |
| 949 void WallpaperManager::OnCustomizedDefaultWallpaperResized( | 949 void WallpaperManager::OnCustomizedDefaultWallpaperResized( |
| 950 const GURL& wallpaper_url, | 950 const GURL& wallpaper_url, |
| 951 scoped_ptr<CustomizedWallpaperRescaledFiles> rescaled_files, | 951 scoped_ptr<CustomizedWallpaperRescaledFiles> rescaled_files, |
| 952 scoped_ptr<bool> success, | 952 scoped_ptr<bool> success, |
| 953 scoped_ptr<gfx::ImageSkia> small_wallpaper_image, | 953 scoped_ptr<gfx::ImageSkia> small_wallpaper_image, |
| 954 scoped_ptr<gfx::ImageSkia> large_wallpaper_image) { | 954 scoped_ptr<gfx::ImageSkia> large_wallpaper_image) { |
| 955 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 955 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
| 956 DCHECK(rescaled_files); | 956 DCHECK(rescaled_files); |
| 957 DCHECK(success.get()); | 957 DCHECK(success.get()); |
| 958 if (!*success) { | 958 if (!*success) { |
| 959 LOG(WARNING) << "Failed to save resized customized default wallpaper"; | 959 LOG(WARNING) << "Failed to save resized customized default wallpaper"; |
| 960 return; | 960 return; |
| 961 } | 961 } |
| 962 PrefService* pref_service = g_browser_process->local_state(); | 962 PrefService* pref_service = g_browser_process->local_state(); |
| 963 pref_service->SetString(prefs::kCustomizationDefaultWallpaperURL, | 963 pref_service->SetString(prefs::kCustomizationDefaultWallpaperURL, |
| 964 wallpaper_url.spec()); | 964 wallpaper_url.spec()); |
| 965 SetDefaultWallpaperPath(rescaled_files->path_rescaled_small(), | 965 SetDefaultWallpaperPath(rescaled_files->path_rescaled_small(), |
| (...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1043 } | 1043 } |
| 1044 } | 1044 } |
| 1045 | 1045 |
| 1046 if (need_update_screen) { | 1046 if (need_update_screen) { |
| 1047 DoSetDefaultWallpaper(std::string(), | 1047 DoSetDefaultWallpaper(std::string(), |
| 1048 MovableOnDestroyCallbackHolder().Pass()); | 1048 MovableOnDestroyCallbackHolder().Pass()); |
| 1049 } | 1049 } |
| 1050 } | 1050 } |
| 1051 | 1051 |
| 1052 } // namespace chromeos | 1052 } // namespace chromeos |
| OLD | NEW |