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

Unified Diff: components/wallpaper/wallpaper_manager_base.h

Issue 1917673002: Convert //components/[u-z]* from scoped_ptr to std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 4 years, 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « components/visitedlink/test/visitedlink_unittest.cc ('k') | components/wallpaper/wallpaper_manager_base.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/wallpaper/wallpaper_manager_base.h
diff --git a/components/wallpaper/wallpaper_manager_base.h b/components/wallpaper/wallpaper_manager_base.h
index 1c80e4a7881ad92ec978bc17a2ac6ddf89c0c939..f748193e89e7fa8716049803ad7542d528c74944 100644
--- a/components/wallpaper/wallpaper_manager_base.h
+++ b/components/wallpaper/wallpaper_manager_base.h
@@ -9,13 +9,13 @@
#include <deque>
#include <map>
+#include <memory>
#include <string>
#include <vector>
#include "base/files/file_path.h"
#include "base/macros.h"
#include "base/memory/ref_counted_memory.h"
-#include "base/memory/scoped_ptr.h"
#include "base/memory/weak_ptr.h"
#include "base/observer_list.h"
#include "base/thread_task_runner_handle.h"
@@ -57,7 +57,8 @@ class WALLPAPER_EXPORT MovableOnDestroyCallback {
base::Closure callback_;
};
-typedef scoped_ptr<MovableOnDestroyCallback> MovableOnDestroyCallbackHolder;
+using MovableOnDestroyCallbackHolder =
+ std::unique_ptr<MovableOnDestroyCallback>;
struct WALLPAPER_EXPORT WallpaperInfo {
WallpaperInfo();
@@ -278,9 +279,9 @@ class WALLPAPER_EXPORT WallpaperManagerBase {
// |large_wallpaper_image| depending on GetAppropriateResolution().
virtual void SetDefaultWallpaperPath(
const base::FilePath& customized_default_wallpaper_file_small,
- scoped_ptr<gfx::ImageSkia> small_wallpaper_image,
+ std::unique_ptr<gfx::ImageSkia> small_wallpaper_image,
const base::FilePath& customized_default_wallpaper_file_large,
- scoped_ptr<gfx::ImageSkia> large_wallpaper_image) = 0;
+ std::unique_ptr<gfx::ImageSkia> large_wallpaper_image) = 0;
// Sets wallpaper to default wallpaper (asynchronously with zero delay).
virtual void SetDefaultWallpaperNow(const AccountId& account_id) = 0;
@@ -333,7 +334,7 @@ class WALLPAPER_EXPORT WallpaperManagerBase {
// of the JPEG |data| with a callback to SetPolicyControlledWallpaper().
virtual void OnPolicyFetched(const std::string& policy,
const AccountId& account_id,
- scoped_ptr<std::string> data) = 0;
+ std::unique_ptr<std::string> data) = 0;
// This is called from CustomizationDocument.
// |resized_directory| is the directory where resized versions are stored and
@@ -366,7 +367,7 @@ class WALLPAPER_EXPORT WallpaperManagerBase {
static void SaveCustomWallpaper(const WallpaperFilesId& wallpaper_files_id,
const base::FilePath& path,
WallpaperLayout layout,
- scoped_ptr<gfx::ImageSkia> image);
+ std::unique_ptr<gfx::ImageSkia> image);
// Moves custom wallpapers from user email directory to
// |wallpaper_files_id| directory.
@@ -390,7 +391,7 @@ class WALLPAPER_EXPORT WallpaperManagerBase {
// Resize and save customized default wallpaper.
static void ResizeCustomizedDefaultWallpaper(
- scoped_ptr<gfx::ImageSkia> image,
+ std::unique_ptr<gfx::ImageSkia> image,
const CustomizedWallpaperRescaledFiles* rescaled_files,
bool* success,
gfx::ImageSkia* small_wallpaper_image,
@@ -475,7 +476,7 @@ class WALLPAPER_EXPORT WallpaperManagerBase {
WallpaperLayout layout,
bool update_wallpaper,
MovableOnDestroyCallbackHolder on_finish,
- scoped_ptr<user_manager::UserImage> user_image) = 0;
+ std::unique_ptr<user_manager::UserImage> user_image) = 0;
// Creates new PendingWallpaper request (or updates currently pending).
virtual void ScheduleSetUserWallpaper(const AccountId& account_id,
@@ -511,22 +512,22 @@ class WALLPAPER_EXPORT WallpaperManagerBase {
virtual void SetCustomizedDefaultWallpaperAfterCheck(
const GURL& wallpaper_url,
const base::FilePath& downloaded_file,
- scoped_ptr<CustomizedWallpaperRescaledFiles> rescaled_files) = 0;
+ std::unique_ptr<CustomizedWallpaperRescaledFiles> rescaled_files) = 0;
// Starts rescaling of customized wallpaper.
virtual void OnCustomizedDefaultWallpaperDecoded(
const GURL& wallpaper_url,
- scoped_ptr<CustomizedWallpaperRescaledFiles> rescaled_files,
- scoped_ptr<user_manager::UserImage> user_image);
+ std::unique_ptr<CustomizedWallpaperRescaledFiles> rescaled_files,
+ std::unique_ptr<user_manager::UserImage> user_image);
// Check the result of ResizeCustomizedDefaultWallpaper and finally
// apply Customized Default Wallpaper.
virtual void OnCustomizedDefaultWallpaperResized(
const GURL& wallpaper_url,
- scoped_ptr<CustomizedWallpaperRescaledFiles> rescaled_files,
- scoped_ptr<bool> success,
- scoped_ptr<gfx::ImageSkia> small_wallpaper_image,
- scoped_ptr<gfx::ImageSkia> large_wallpaper_image) = 0;
+ std::unique_ptr<CustomizedWallpaperRescaledFiles> rescaled_files,
+ std::unique_ptr<bool> success,
+ std::unique_ptr<gfx::ImageSkia> small_wallpaper_image,
+ std::unique_ptr<gfx::ImageSkia> large_wallpaper_image) = 0;
// Init |*default_*_wallpaper_file_| from given command line and
// clear |default_wallpaper_image_|.
@@ -537,16 +538,16 @@ class WALLPAPER_EXPORT WallpaperManagerBase {
virtual void OnDefaultWallpaperDecoded(
const base::FilePath& path,
const WallpaperLayout layout,
- scoped_ptr<user_manager::UserImage>* result,
+ std::unique_ptr<user_manager::UserImage>* result,
MovableOnDestroyCallbackHolder on_finish,
- scoped_ptr<user_manager::UserImage> user_image) = 0;
+ std::unique_ptr<user_manager::UserImage> user_image) = 0;
// Start decoding given default wallpaper.
virtual void StartLoadAndSetDefaultWallpaper(
const base::FilePath& path,
const WallpaperLayout layout,
MovableOnDestroyCallbackHolder on_finish,
- scoped_ptr<user_manager::UserImage>* result_out) = 0;
+ std::unique_ptr<user_manager::UserImage>* result_out) = 0;
// Returns wallpaper subdirectory name for current resolution.
virtual const char* GetCustomWallpaperSubdirForCurrentResolution();
@@ -599,7 +600,7 @@ class WALLPAPER_EXPORT WallpaperManagerBase {
base::FilePath child_large_wallpaper_file_;
// Current decoded default image is stored in cache.
- scoped_ptr<user_manager::UserImage> default_wallpaper_image_;
+ std::unique_ptr<user_manager::UserImage> default_wallpaper_image_;
base::WeakPtrFactory<WallpaperManagerBase> weak_factory_;
« no previous file with comments | « components/visitedlink/test/visitedlink_unittest.cc ('k') | components/wallpaper/wallpaper_manager_base.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698