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

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: SkBitmap* -> SkBitmap 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.h
diff --git a/chrome/browser/extensions/extension_install_prompt.h b/chrome/browser/extensions/extension_install_prompt.h
index 1b65fa66e69dde2441baf2f9a487630102c3a587..155960ab7cae815c04d169d42e0f460f32b45eb1 100644
--- a/chrome/browser/extensions/extension_install_prompt.h
+++ b/chrome/browser/extensions/extension_install_prompt.h
@@ -12,7 +12,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 "chrome/common/extensions/url_pattern.h"
#include "google_apis/gaia/oauth2_mint_token_flow.h"
#include "third_party/skia/include/core/SkBitmap.h"
@@ -42,8 +41,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,
@@ -240,11 +240,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 WebstoreInlineInstallUnpackFailureTest;
@@ -260,6 +255,9 @@ class ExtensionInstallPrompt : public ImageLoadingTracker::Observer,
// an empty bitmap, then a default icon will be used instead.
void SetIcon(const SkBitmap* icon);
+ // extension_image_utils 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).
@@ -307,10 +305,6 @@ class ExtensionInstallPrompt : public ImageLoadingTracker::Observer,
PromptType prompt_type_;
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_;
};
namespace chrome {

Powered by Google App Engine
This is Rietveld 408576698