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

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

Issue 11027044: Add a class to replace ImageLoadingTracker with a nicer API. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix include order Created 8 years, 1 month 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.h
diff --git a/chrome/browser/extensions/extension_install_prompt.h b/chrome/browser/extensions/extension_install_prompt.h
index 2d3914a07ae14a6117bd40a8ec6f771f612ef3e9..ad89799b7b260983ab5011354f413ff642fc2beb 100644
--- a/chrome/browser/extensions/extension_install_prompt.h
+++ b/chrome/browser/extensions/extension_install_prompt.h
@@ -13,7 +13,6 @@
#include "base/memory/scoped_ptr.h"
#include "base/string16.h"
#include "chrome/browser/extensions/crx_installer_error.h"
-#include "chrome/browser/extensions/image_loading_tracker.h"
#include "extensions/common/url_pattern.h"
#include "google_apis/gaia/oauth2_mint_token_flow.h"
#include "third_party/skia/include/core/SkBitmap.h"
@@ -43,8 +42,9 @@ class PermissionSet;
} // namespace extensions
// Displays all the UI around extension installation.
-class ExtensionInstallPrompt : public ImageLoadingTracker::Observer,
- public OAuth2MintTokenFlow::Delegate {
+class ExtensionInstallPrompt
+ : public OAuth2MintTokenFlow::Delegate,
+ public base::SupportsWeakPtr<ExtensionInstallPrompt> {
public:
enum PromptType {
UNSET_PROMPT_TYPE = -1,
@@ -260,11 +260,6 @@ class ExtensionInstallPrompt : public ImageLoadingTracker::Observer,
// Installation failed. This is declared virtual for testing.
virtual void OnInstallFailure(const extensions::CrxInstallerError& error);
- // ImageLoadingTracker::Observer:
- virtual void OnImageLoaded(const gfx::Image& image,
- const std::string& extension_id,
- int index) OVERRIDE;
-
protected:
friend class extensions::ExtensionWebstorePrivateApiTest;
friend class WebstoreStandaloneInstallUnpackFailureTest;
@@ -280,6 +275,9 @@ class ExtensionInstallPrompt : public ImageLoadingTracker::Observer,
// an empty bitmap, then a default icon will be used instead.
void SetIcon(const SkBitmap* icon);
+ // ImageLoader callback.
+ void OnImageLoaded(const gfx::Image& image);
+
// Starts the process of showing a confirmation UI, which is split into two.
// 1) Set off a 'load icon' task.
// 2) Handle the load icon response and show the UI (OnImageLoaded).
@@ -319,6 +317,8 @@ class ExtensionInstallPrompt : public ImageLoadingTracker::Observer,
// The delegate we will call Proceed/Abort on after confirmation UI.
Delegate* delegate_;
+ Profile* profile_;
+
// A pre-filled prompt.
Prompt prompt_;
@@ -327,10 +327,6 @@ class ExtensionInstallPrompt : public ImageLoadingTracker::Observer,
scoped_ptr<OAuth2MintTokenFlow> token_flow_;
- // Keeps track of extension images being loaded on the File thread for the
- // purpose of showing the install UI.
- ImageLoadingTracker tracker_;
-
// Used to show the confirm dialog.
ShowDialogCallback show_dialog_callback_;
};

Powered by Google App Engine
This is Rietveld 408576698