| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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/extensions/wallpaper_private_api.h" | 5 #include "chrome/browser/chromeos/extensions/wallpaper_private_api.h" |
| 6 | 6 |
| 7 #include <map> | 7 #include <map> |
| 8 #include <memory> | 8 #include <memory> |
| 9 #include <set> | 9 #include <set> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 603 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 614 | 614 |
| 615 bool WallpaperPrivateSetCustomWallpaperFunction::RunAsync() { | 615 bool WallpaperPrivateSetCustomWallpaperFunction::RunAsync() { |
| 616 params = set_custom_wallpaper::Params::Create(*args_); | 616 params = set_custom_wallpaper::Params::Create(*args_); |
| 617 EXTENSION_FUNCTION_VALIDATE(params); | 617 EXTENSION_FUNCTION_VALIDATE(params); |
| 618 | 618 |
| 619 // Gets account id from the caller, ensuring multiprofile compatibility. | 619 // Gets account id from the caller, ensuring multiprofile compatibility. |
| 620 const user_manager::User* user = GetUserFromBrowserContext(browser_context()); | 620 const user_manager::User* user = GetUserFromBrowserContext(browser_context()); |
| 621 account_id_ = user->GetAccountId(); | 621 account_id_ = user->GetAccountId(); |
| 622 chromeos::WallpaperManager* wallpaper_manager = | 622 chromeos::WallpaperManager* wallpaper_manager = |
| 623 chromeos::WallpaperManager::Get(); | 623 chromeos::WallpaperManager::Get(); |
| 624 wallpaper_files_id_ = wallpaper_manager->GetFilesId(*user); | 624 wallpaper_files_id_ = wallpaper_manager->GetFilesId(account_id_); |
| 625 | 625 |
| 626 StartDecode(params->wallpaper); | 626 StartDecode(params->wallpaper); |
| 627 | 627 |
| 628 return true; | 628 return true; |
| 629 } | 629 } |
| 630 | 630 |
| 631 void WallpaperPrivateSetCustomWallpaperFunction::OnWallpaperDecoded( | 631 void WallpaperPrivateSetCustomWallpaperFunction::OnWallpaperDecoded( |
| 632 const gfx::ImageSkia& image) { | 632 const gfx::ImageSkia& image) { |
| 633 chromeos::WallpaperManager* wallpaper_manager = | 633 chromeos::WallpaperManager* wallpaper_manager = |
| 634 chromeos::WallpaperManager::Get(); | 634 chromeos::WallpaperManager::Get(); |
| (...skipping 325 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 960 bool WallpaperPrivateRecordWallpaperUMAFunction::RunSync() { | 960 bool WallpaperPrivateRecordWallpaperUMAFunction::RunSync() { |
| 961 scoped_ptr<record_wallpaper_uma::Params> params( | 961 scoped_ptr<record_wallpaper_uma::Params> params( |
| 962 record_wallpaper_uma::Params::Create(*args_)); | 962 record_wallpaper_uma::Params::Create(*args_)); |
| 963 EXTENSION_FUNCTION_VALIDATE(params); | 963 EXTENSION_FUNCTION_VALIDATE(params); |
| 964 | 964 |
| 965 user_manager::User::WallpaperType source = getWallpaperType(params->source); | 965 user_manager::User::WallpaperType source = getWallpaperType(params->source); |
| 966 UMA_HISTOGRAM_ENUMERATION("Ash.Wallpaper.Source", source, | 966 UMA_HISTOGRAM_ENUMERATION("Ash.Wallpaper.Source", source, |
| 967 user_manager::User::WALLPAPER_TYPE_COUNT); | 967 user_manager::User::WALLPAPER_TYPE_COUNT); |
| 968 return true; | 968 return true; |
| 969 } | 969 } |
| OLD | NEW |