| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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_SEARCH_LAUNCHER_SEARCH_LAUNCHER_SEARCH_ICON_I
MAGE_LOADER_IMPL_H_ | 5 #ifndef CHROME_BROWSER_UI_APP_LIST_SEARCH_LAUNCHER_SEARCH_LAUNCHER_SEARCH_ICON_I
MAGE_LOADER_IMPL_H_ |
| 6 #define CHROME_BROWSER_UI_APP_LIST_SEARCH_LAUNCHER_SEARCH_LAUNCHER_SEARCH_ICON_I
MAGE_LOADER_IMPL_H_ | 6 #define CHROME_BROWSER_UI_APP_LIST_SEARCH_LAUNCHER_SEARCH_LAUNCHER_SEARCH_ICON_I
MAGE_LOADER_IMPL_H_ |
| 7 | 7 |
| 8 #include <memory> |
| 9 |
| 8 #include "base/macros.h" | 10 #include "base/macros.h" |
| 9 #include "base/memory/scoped_ptr.h" | |
| 10 #include "base/memory/weak_ptr.h" | 11 #include "base/memory/weak_ptr.h" |
| 11 #include "chrome/browser/ui/app_list/search/launcher_search/launcher_search_icon
_image_loader.h" | 12 #include "chrome/browser/ui/app_list/search/launcher_search/launcher_search_icon
_image_loader.h" |
| 12 #include "extensions/browser/extension_icon_image.h" | 13 #include "extensions/browser/extension_icon_image.h" |
| 13 | 14 |
| 14 namespace app_list { | 15 namespace app_list { |
| 15 | 16 |
| 16 // LauncherSearchIconImageLoaderImpl loads extension icon and icon resource from | 17 // LauncherSearchIconImageLoaderImpl loads extension icon and icon resource from |
| 17 // extension. | 18 // extension. |
| 18 class LauncherSearchIconImageLoaderImpl : public LauncherSearchIconImageLoader, | 19 class LauncherSearchIconImageLoaderImpl : public LauncherSearchIconImageLoader, |
| 19 extensions::IconImage::Observer { | 20 extensions::IconImage::Observer { |
| 20 public: | 21 public: |
| 21 LauncherSearchIconImageLoaderImpl( | 22 LauncherSearchIconImageLoaderImpl( |
| 22 const GURL& custom_icon_url, | 23 const GURL& custom_icon_url, |
| 23 Profile* profile, | 24 Profile* profile, |
| 24 const extensions::Extension* extension, | 25 const extensions::Extension* extension, |
| 25 const int icon_dimension, | 26 const int icon_dimension, |
| 26 scoped_ptr<chromeos::launcher_search_provider::ErrorReporter> | 27 std::unique_ptr<chromeos::launcher_search_provider::ErrorReporter> |
| 27 error_reporter); | 28 error_reporter); |
| 28 ~LauncherSearchIconImageLoaderImpl() override; | 29 ~LauncherSearchIconImageLoaderImpl() override; |
| 29 const gfx::ImageSkia& LoadExtensionIcon() override; | 30 const gfx::ImageSkia& LoadExtensionIcon() override; |
| 30 void LoadIconResourceFromExtension() override; | 31 void LoadIconResourceFromExtension() override; |
| 31 | 32 |
| 32 // extensions::IconImage::Observer override. | 33 // extensions::IconImage::Observer override. |
| 33 void OnExtensionIconImageChanged(extensions::IconImage* image) override; | 34 void OnExtensionIconImageChanged(extensions::IconImage* image) override; |
| 34 | 35 |
| 35 // ImageLoaderImageCallback. | 36 // ImageLoaderImageCallback. |
| 36 void OnCustomIconImageLoaded(const gfx::Image& image); | 37 void OnCustomIconImageLoaded(const gfx::Image& image); |
| 37 | 38 |
| 38 private: | 39 private: |
| 39 scoped_ptr<extensions::IconImage> extension_icon_image_; | 40 std::unique_ptr<extensions::IconImage> extension_icon_image_; |
| 40 | 41 |
| 41 base::WeakPtrFactory<LauncherSearchIconImageLoaderImpl> weak_ptr_factory_; | 42 base::WeakPtrFactory<LauncherSearchIconImageLoaderImpl> weak_ptr_factory_; |
| 42 | 43 |
| 43 DISALLOW_COPY_AND_ASSIGN(LauncherSearchIconImageLoaderImpl); | 44 DISALLOW_COPY_AND_ASSIGN(LauncherSearchIconImageLoaderImpl); |
| 44 }; | 45 }; |
| 45 | 46 |
| 46 } // namespace app_list | 47 } // namespace app_list |
| 47 | 48 |
| 48 #endif // CHROME_BROWSER_UI_APP_LIST_SEARCH_LAUNCHER_SEARCH_LAUNCHER_SEARCH_ICO
N_IMAGE_LOADER_IMPL_H_ | 49 #endif // CHROME_BROWSER_UI_APP_LIST_SEARCH_LAUNCHER_SEARCH_LAUNCHER_SEARCH_ICO
N_IMAGE_LOADER_IMPL_H_ |
| OLD | NEW |