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

Side by Side Diff: chrome/browser/extensions/chrome_app_icon_loader.h

Issue 2819413003: Refactor extension app icon. (Closed)
Patch Set: nit Created 3 years, 7 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 unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2016 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.
4
5 #ifndef CHROME_BROWSER_EXTENSIONS_CHROME_APP_ICON_LOADER_H_
6 #define CHROME_BROWSER_EXTENSIONS_CHROME_APP_ICON_LOADER_H_
7
8 #include <map>
9 #include <memory>
10 #include <string>
11
12 #include "base/macros.h"
13 #include "chrome/browser/extensions/chrome_app_icon_delegate.h"
14 #include "chrome/browser/ui/app_icon_loader.h"
15
16 class Profile;
17
18 namespace extensions {
19
20 // Implementation of AppIconLoader that uses ChromeAppIcon to load and update
21 // Chrome app images.
22 class ChromeAppIconLoader : public AppIconLoader, public ChromeAppIconDelegate {
23 public:
24 ChromeAppIconLoader(Profile* profile,
25 int icon_size_in_dips,
26 AppIconLoaderDelegate* delegate);
27 ~ChromeAppIconLoader() override;
28
29 // AppIconLoader overrides:
30 bool CanLoadImageForApp(const std::string& id) override;
31 void FetchImage(const std::string& id) override;
32 void ClearImage(const std::string& id) override;
33 void UpdateImage(const std::string& id) override;
34
35 private:
36 using ExtensionIDToChromeAppIconMap =
37 std::map<std::string, std::unique_ptr<ChromeAppIcon>>;
38
39 // ChromeAppIconDelegate:
40 void OnIconUpdated(ChromeAppIcon* icon) override;
41
42 // Maps from extension id to ChromeAppIcon.
43 ExtensionIDToChromeAppIconMap map_;
44
45 DISALLOW_COPY_AND_ASSIGN(ChromeAppIconLoader);
46 };
47
48 } // namespace extensions
49
50 #endif // CHROME_BROWSER_EXTENSIONS_CHROME_APP_ICON_LOADER_H_
OLDNEW
« no previous file with comments | « chrome/browser/extensions/chrome_app_icon_delegate.h ('k') | chrome/browser/extensions/chrome_app_icon_loader.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698