| Index: components/wallpaper/pref_based_wallpaper_color_cache.h
|
| diff --git a/components/wallpaper/pref_based_wallpaper_color_cache.h b/components/wallpaper/pref_based_wallpaper_color_cache.h
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..23ed9b8ba177bd13ac7087ce9e68dfde3bbdf808
|
| --- /dev/null
|
| +++ b/components/wallpaper/pref_based_wallpaper_color_cache.h
|
| @@ -0,0 +1,42 @@
|
| +// Copyright 2017 The Chromium Authors. All rights reserved.
|
| +// Use of this source code is governed by a BSD-style license that can be
|
| +// found in the LICENSE file.
|
| +
|
| +#ifndef COMPONENTS_WALLPAPER_PREF_BASED_WALLPAPER_COLOR_CACHE_H_
|
| +#define COMPONENTS_WALLPAPER_PREF_BASED_WALLPAPER_COLOR_CACHE_H_
|
| +
|
| +#include "base/macros.h"
|
| +#include "components/wallpaper/wallpaper_color_cache.h"
|
| +#include "components/wallpaper/wallpaper_export.h"
|
| +
|
| +class PrefRegistrySimple;
|
| +class PrefService;
|
| +
|
| +namespace wallpaper {
|
| +
|
| +// A dictionary that maps wallpaper image ids to extracted color.
|
| +WALLPAPER_EXPORT extern const char kWallpaperColorInfo[];
|
| +
|
| +class WALLPAPER_EXPORT PrefBasedWallpaperColorCache
|
| + : public WallpaperColorCache {
|
| + public:
|
| + static void RegisterPrefs(PrefRegistrySimple* registry);
|
| +
|
| + explicit PrefBasedWallpaperColorCache(PrefService* pref_service);
|
| + ~PrefBasedWallpaperColorCache() override;
|
| +
|
| + // WallpaperColorCache:
|
| + bool GetColor(uint32_t image_id, SkColor* color) const override;
|
| + void SetColor(uint32_t image_id, SkColor color) override;
|
| +
|
| + private:
|
| + void PurgeOldRecords();
|
| +
|
| + PrefService* pref_service_;
|
| +
|
| + DISALLOW_COPY_AND_ASSIGN(PrefBasedWallpaperColorCache);
|
| +};
|
| +
|
| +} // namespace wallpaper
|
| +
|
| +#endif // COMPONENTS_WALLPAPER_PREF_BASED_WALLPAPER_COLOR_CACHE_H_
|
|
|