Chromium Code Reviews| OLD | NEW |
|---|---|
| (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 interacts with the ExtensionService and | |
| 21 // ImageLoader to load images. | |
|
msw
2017/05/03 01:17:39
What is ImageLoader? I don't see that referenced h
khmel
2017/05/03 02:15:22
Good catch, left from previous impl.
| |
| 22 class ChromeAppIconLoader : public AppIconLoader, public ChromeAppIconDelegate { | |
| 23 public: | |
| 24 ChromeAppIconLoader(Profile* profile, | |
| 25 int icon_size, | |
|
msw
2017/05/03 01:17:39
nit: icon_size_in_dips?
khmel
2017/05/03 02:15:22
Done.
| |
| 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 ExtensionIDToImageMap = | |
|
msw
2017/05/03 01:17:39
nit: s/Image/ChromeAppIcon/? Let's avoid mixing th
khmel
2017/05/03 02:15:22
Done
| |
| 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 IconImage pointer. | |
|
msw
2017/05/03 01:17:39
nit: s/IconImage pointer/ChromeAppIcon/?
khmel
2017/05/03 02:15:22
Done.
| |
| 43 ExtensionIDToImageMap map_; | |
| 44 | |
| 45 DISALLOW_COPY_AND_ASSIGN(ChromeAppIconLoader); | |
| 46 }; | |
| 47 | |
| 48 } // namespace extensions | |
| 49 | |
| 50 #endif // CHROME_BROWSER_EXTENSIONS_CHROME_APP_ICON_LOADER_H_ | |
| OLD | NEW |