| OLD | NEW |
| 1 // Copyright (c) 2016 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef CHROME_BROWSER_UI_APP_LIST_ARC_ARC_APP_ICON_LOADER_H_ | 5 #ifndef CHROME_BROWSER_UI_APP_LIST_ARC_ARC_APP_ICON_LOADER_H_ |
| 6 #define CHROME_BROWSER_UI_APP_LIST_ARC_ARC_APP_ICON_LOADER_H_ | 6 #define CHROME_BROWSER_UI_APP_LIST_ARC_ARC_APP_ICON_LOADER_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <memory> |
| 9 #include <string> | 10 #include <string> |
| 10 | 11 |
| 11 #include "base/macros.h" | 12 #include "base/macros.h" |
| 12 #include "base/memory/scoped_ptr.h" | |
| 13 #include "chrome/browser/ui/app_icon_loader.h" | 13 #include "chrome/browser/ui/app_icon_loader.h" |
| 14 #include "chrome/browser/ui/app_list/arc/arc_app_icon.h" | 14 #include "chrome/browser/ui/app_list/arc/arc_app_icon.h" |
| 15 #include "chrome/browser/ui/app_list/arc/arc_app_list_prefs.h" | 15 #include "chrome/browser/ui/app_list/arc/arc_app_list_prefs.h" |
| 16 | 16 |
| 17 class Profile; | 17 class Profile; |
| 18 | 18 |
| 19 class ArcAppIconLoader : public AppIconLoader, | 19 class ArcAppIconLoader : public AppIconLoader, |
| 20 public ArcAppListPrefs::Observer, | 20 public ArcAppListPrefs::Observer, |
| 21 public ArcAppIcon::Observer { | 21 public ArcAppIcon::Observer { |
| 22 public: | 22 public: |
| (...skipping 10 matching lines...) Expand all Loading... |
| 33 | 33 |
| 34 // Overrides ArcAppListPrefs::Observer: | 34 // Overrides ArcAppListPrefs::Observer: |
| 35 void OnAppReadyChanged(const std::string& id, bool ready) override; | 35 void OnAppReadyChanged(const std::string& id, bool ready) override; |
| 36 void OnAppIconUpdated(const std::string& id, | 36 void OnAppIconUpdated(const std::string& id, |
| 37 ui::ScaleFactor scale_factor) override; | 37 ui::ScaleFactor scale_factor) override; |
| 38 | 38 |
| 39 // Overrides ArcAppIcon::Observer: | 39 // Overrides ArcAppIcon::Observer: |
| 40 void OnIconUpdated(ArcAppIcon* icon) override; | 40 void OnIconUpdated(ArcAppIcon* icon) override; |
| 41 | 41 |
| 42 private: | 42 private: |
| 43 using AppIDToIconMap = std::map<std::string, scoped_ptr<ArcAppIcon>>; | 43 using AppIDToIconMap = std::map<std::string, std::unique_ptr<ArcAppIcon>>; |
| 44 | 44 |
| 45 // Unowned pointer. | 45 // Unowned pointer. |
| 46 ArcAppListPrefs* arc_prefs_; | 46 ArcAppListPrefs* arc_prefs_; |
| 47 | 47 |
| 48 AppIDToIconMap icon_map_; | 48 AppIDToIconMap icon_map_; |
| 49 | 49 |
| 50 DISALLOW_COPY_AND_ASSIGN(ArcAppIconLoader); | 50 DISALLOW_COPY_AND_ASSIGN(ArcAppIconLoader); |
| 51 }; | 51 }; |
| 52 | 52 |
| 53 #endif // CHROME_BROWSER_UI_APP_LIST_ARC_ARC_APP_ICON_LOADER_H_ | 53 #endif // CHROME_BROWSER_UI_APP_LIST_ARC_ARC_APP_ICON_LOADER_H_ |
| OLD | NEW |