1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef CHROME_BROWSER_UI_WEBUI_CHROMEOS_LOGIN_SCREENLOCK_ICON_PROVIDER_H_
6 #define CHROME_BROWSER_UI_WEBUI_CHROMEOS_LOGIN_SCREENLOCK_ICON_PROVIDER_H_
10 #include "base/memory/weak_ptr.h"
11 #include "ui/gfx/image/image.h"
15 // Stores icon images used by the screenlockPrivate API. This class is
16 // separate from ScreenlockIconSource for finer memory management.
17 class ScreenlockIconProvider
18 : public base::SupportsWeakPtr
<ScreenlockIconProvider
> {
20 ScreenlockIconProvider();
21 ~ScreenlockIconProvider();
23 // Adds an icon image for |username| to be stored.
24 void AddIcon(const std::string
& username
, const gfx::Image
& icon
);
26 // Removes icon image for |username|.
27 void RemoveIcon(const std::string
& username
);
29 // Returns the icon image set for |username|. If no icon is found, then
30 // this function returns an empty image.
31 gfx::Image
GetIcon(const std::string
& username
);
33 // Removes all stored icon images.
37 // Map of icons for the user pod buttons set by screenlockPrivate.showButton.
38 std::map
<std::string
, gfx::Image
> user_icon_map_
;
40 DISALLOW_COPY_AND_ASSIGN(ScreenlockIconProvider
);
43 } // namespace chromeos
45 #endif // CHROME_BROWSER_UI_WEBUI_CHROMEOS_LOGIN_SCREENLOCK_ICON_PROVIDER_H_