Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1022)

Unified Diff: chrome/browser/extensions/extension_install_prompt.cc

Issue 11027044: Add a class to replace ImageLoadingTracker with a nicer API. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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 2113b174e8bc2b98e19a8e778bfe4adee3d5044c..5444fdd76723f1bbbd7094627f43eb37086f8e85 100644
--- a/chrome/browser/extensions/extension_install_prompt.cc
+++ b/chrome/browser/extensions/extension_install_prompt.cc
@@ -16,6 +16,7 @@
#include "chrome/browser/extensions/bundle_installer.h"
#include "chrome/browser/extensions/extension_install_dialog.h"
#include "chrome/browser/extensions/extension_install_ui.h"
+#include "chrome/browser/extensions/image_utils.h"
#include "chrome/browser/prefs/pref_service.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/signin/token_service.h"
@@ -313,8 +314,7 @@ ExtensionInstallPrompt::ExtensionInstallPrompt(
install_ui_(ExtensionInstallUI::Create(profile)),
delegate_(NULL),
prompt_(profile, UNSET_PROMPT_TYPE),
- prompt_type_(UNSET_PROMPT_TYPE),
- ALLOW_THIS_IN_INITIALIZER_LIST(tracker_(this)) {
+ prompt_type_(UNSET_PROMPT_TYPE) {
}
ExtensionInstallPrompt::~ExtensionInstallPrompt() {
@@ -449,9 +449,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();
}
@@ -472,9 +470,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);
+ extension_image_utils::LoadImageAsync(
+ extension_, image, gfx::Size(pixel_size, pixel_size),
+ base::Bind(&ExtensionInstallPrompt::OnImageLoaded, AsWeakPtr()));
}
void ExtensionInstallPrompt::FetchOAuthIssueAdviceIfNeeded() {

Powered by Google App Engine
This is Rietveld 408576698