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

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: remove unused code 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 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() {
« no previous file with comments | « chrome/browser/extensions/extension_install_prompt.h ('k') | chrome/browser/extensions/extension_protocols.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698