OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_VIEWS_AURA_LAUNCHER_LAUNCHER_ICON_LOADER_H_ | 5 #ifndef CHROME_BROWSER_UI_VIEWS_AURA_LAUNCHER_LAUNCHER_ICON_LOADER_H_ |
6 #define CHROME_BROWSER_UI_VIEWS_AURA_LAUNCHER_LAUNCHER_ICON_LOADER_H_ | 6 #define CHROME_BROWSER_UI_VIEWS_AURA_LAUNCHER_LAUNCHER_ICON_LOADER_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <map> | 9 #include <map> |
10 #include <string> | 10 #include <string> |
(...skipping 12 matching lines...) Expand all Loading... |
23 public: | 23 public: |
24 LauncherIconLoader(Profile* profile, LauncherUpdater* icon_updater); | 24 LauncherIconLoader(Profile* profile, LauncherUpdater* icon_updater); |
25 virtual ~LauncherIconLoader(); | 25 virtual ~LauncherIconLoader(); |
26 | 26 |
27 // AppIconLoader: | 27 // AppIconLoader: |
28 virtual std::string GetAppID(TabContentsWrapper* tab) OVERRIDE; | 28 virtual std::string GetAppID(TabContentsWrapper* tab) OVERRIDE; |
29 virtual void Remove(TabContentsWrapper* tab) OVERRIDE; | 29 virtual void Remove(TabContentsWrapper* tab) OVERRIDE; |
30 virtual void FetchImage(TabContentsWrapper* tab) OVERRIDE; | 30 virtual void FetchImage(TabContentsWrapper* tab) OVERRIDE; |
31 | 31 |
32 // ImageLoadingTracker::Observer: | 32 // ImageLoadingTracker::Observer: |
33 virtual void OnImageLoaded(SkBitmap* image, | 33 virtual void OnImageLoaded(const gfx::Image* image, |
34 const ExtensionResource& resource, | 34 const std::string& extension_id, |
35 int index) OVERRIDE; | 35 int index) OVERRIDE; |
36 | 36 |
37 private: | 37 private: |
38 typedef std::map<int, TabContentsWrapper*> ImageLoaderIDToTabMap; | 38 typedef std::map<int, TabContentsWrapper*> ImageLoaderIDToTabMap; |
39 | 39 |
40 // Removes |tab| from the |image_loader_id_to_tab_map_| map. | 40 // Removes |tab| from the |image_loader_id_to_tab_map_| map. |
41 void RemoveFromImageLoaderMap(TabContentsWrapper* tab); | 41 void RemoveFromImageLoaderMap(TabContentsWrapper* tab); |
42 | 42 |
43 // Returns the extension for the specified tab. | 43 // Returns the extension for the specified tab. |
44 const Extension* GetExtensionForTab(TabContentsWrapper* tab); | 44 const Extension* GetExtensionForTab(TabContentsWrapper* tab); |
45 | 45 |
46 Profile* profile_; | 46 Profile* profile_; |
47 | 47 |
48 // LauncherUpdater we're associated with (and owned by). | 48 // LauncherUpdater we're associated with (and owned by). |
49 LauncherUpdater* icon_updater_; | 49 LauncherUpdater* icon_updater_; |
50 | 50 |
51 // Used to load images. | 51 // Used to load images. |
52 scoped_ptr<ImageLoadingTracker> image_loader_; | 52 scoped_ptr<ImageLoadingTracker> image_loader_; |
53 | 53 |
54 // Maps from id from the ImageLoadingTracker to the TabContentsWrapper. | 54 // Maps from id from the ImageLoadingTracker to the TabContentsWrapper. |
55 ImageLoaderIDToTabMap image_loader_id_to_tab_map_; | 55 ImageLoaderIDToTabMap image_loader_id_to_tab_map_; |
56 | 56 |
57 DISALLOW_COPY_AND_ASSIGN(LauncherIconLoader); | 57 DISALLOW_COPY_AND_ASSIGN(LauncherIconLoader); |
58 }; | 58 }; |
59 | 59 |
60 #endif // CHROME_BROWSER_UI_VIEWS_AURA_LAUNCHER_LAUNCHER_ICON_LOADER_H_ | 60 #endif // CHROME_BROWSER_UI_VIEWS_AURA_LAUNCHER_LAUNCHER_ICON_LOADER_H_ |
OLD | NEW |