Chromium Code Reviews| Index: chrome/browser/extensions/extension_install_prompt.cc |
| diff --git a/chrome/browser/extensions/extension_install_prompt.cc b/chrome/browser/extensions/extension_install_prompt.cc |
| index fe6ce493102bbbdce815ec9391a3ebbc3d5050af..1190ba05ff48eb0d033f874c14b2e3f46763fc65 100644 |
| --- a/chrome/browser/extensions/extension_install_prompt.cc |
| +++ b/chrome/browser/extensions/extension_install_prompt.cc |
| @@ -15,6 +15,8 @@ |
| #include "base/utf_string_conversions.h" |
| #include "chrome/browser/extensions/bundle_installer.h" |
| #include "chrome/browser/extensions/extension_install_ui.h" |
| +#include "chrome/browser/extensions/extension_system.h" |
| +#include "chrome/browser/extensions/image_loader.h" |
| #include "chrome/browser/prefs/pref_service.h" |
| #include "chrome/browser/profiles/profile.h" |
| #include "chrome/browser/signin/token_service.h" |
| @@ -376,9 +378,9 @@ ExtensionInstallPrompt::ExtensionInstallPrompt( |
| extension_(NULL), |
| install_ui_(ExtensionInstallUI::Create(ProfileForWebContents(contents))), |
| delegate_(NULL), |
| - prompt_(ProfileForWebContents(contents), UNSET_PROMPT_TYPE), |
| - prompt_type_(UNSET_PROMPT_TYPE), |
| - ALLOW_THIS_IN_INITIALIZER_LIST(tracker_(this)) { |
| + profile_(ProfileForWebContents(contents)), |
| + prompt_(profile_, UNSET_PROMPT_TYPE), |
| + prompt_type_(UNSET_PROMPT_TYPE) { |
| } |
| ExtensionInstallPrompt::~ExtensionInstallPrompt() { |
| @@ -529,9 +531,7 @@ void ExtensionInstallPrompt::SetIcon(const SkBitmap* image) { |
| } |
| } |
| -void ExtensionInstallPrompt::OnImageLoaded(const gfx::Image& image, |
| - const std::string& extension_id, |
| - int index) { |
| +void ExtensionInstallPrompt::OnImageLoaded(const gfx::Image& image) { |
| SetIcon(image.IsEmpty() ? NULL : image.ToSkBitmap()); |
| FetchOAuthIssueAdviceIfNeeded(); |
| } |
| @@ -552,9 +552,9 @@ void ExtensionInstallPrompt::LoadImageIfNeeded() { |
| // TODO(tbarzic): We should use IconImage here and load the required bitmap |
| // lazily. |
| int pixel_size = GetSizeForMaxScaleFactor(kIconSize); |
| - tracker_.LoadImage(extension_, image, |
| - gfx::Size(pixel_size, pixel_size), |
| - ImageLoadingTracker::DONT_CACHE); |
| + extensions::ExtensionSystem::Get(profile_)->image_loader()->LoadImageAsync( |
|
Aaron Boodman
2012/10/31 07:38:22
I think ImageLoader should be its own PKS, not own
Marijn Kruisselbrink
2012/10/31 21:22:59
Done.
|
| + extension_, image, gfx::Size(pixel_size, pixel_size), |
| + base::Bind(&ExtensionInstallPrompt::OnImageLoaded, AsWeakPtr())); |
| } |
| void ExtensionInstallPrompt::FetchOAuthIssueAdviceIfNeeded() { |