Disable view source for Developer Tools.
[chromium-blink-merge.git] / chrome / browser / ui / webui / chromeos / login / screenlock_icon_provider.h
blobc69713c26e4c9150bf0eae818a46a4a8885b5add
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_
8 #include <map>
10 #include "base/memory/weak_ptr.h"
11 #include "ui/gfx/image/image.h"
13 namespace chromeos {
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> {
19 public:
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 // Returns the icon image set for |username|. If no icon is found, then
27 // this function returns an empty image.
28 gfx::Image GetIcon(const std::string& username);
30 // Removes all stored icon images.
31 void Clear();
33 private:
34 // Map of icons for the user pod buttons set by screenlockPrivate.showButton.
35 std::map<std::string, gfx::Image> user_icon_map_;
37 DISALLOW_COPY_AND_ASSIGN(ScreenlockIconProvider);
40 } // namespace chromeos
42 #endif // CHROME_BROWSER_UI_WEBUI_CHROMEOS_LOGIN_SCREENLOCK_ICON_PROVIDER_H_