diff options
author | jam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-06-25 20:10:52 +0000 |
---|---|---|
committer | jam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-06-25 20:10:52 +0000 |
commit | 5f1ba414001730f9260db24b16ea668f916b2be5 (patch) | |
tree | 03ecd67b5473339a158df40497f118b3f5017a6f /chrome/browser/extensions/extension_uninstall_dialog.h | |
parent | ad68630e2c7906b36d3f10389eb0e4b19149996b (diff) | |
download | chromium_src-5f1ba414001730f9260db24b16ea668f916b2be5.zip chromium_src-5f1ba414001730f9260db24b16ea668f916b2be5.tar.gz chromium_src-5f1ba414001730f9260db24b16ea668f916b2be5.tar.bz2 |
Get rid of browser::FindLastActiveWithProfile call in extensions uninstall dialog code. I plumbed through Browser* and observe it to make sure it doesn't go away while the icon is loading.
BUG=129187
Review URL: https://chromiumcodereview.appspot.com/10658019
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@143991 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/extensions/extension_uninstall_dialog.h')
-rw-r--r-- | chrome/browser/extensions/extension_uninstall_dialog.h | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/chrome/browser/extensions/extension_uninstall_dialog.h b/chrome/browser/extensions/extension_uninstall_dialog.h index 6d465c8..625557b 100644 --- a/chrome/browser/extensions/extension_uninstall_dialog.h +++ b/chrome/browser/extensions/extension_uninstall_dialog.h @@ -8,12 +8,13 @@ #include "base/basictypes.h" #include "base/compiler_specific.h" +#include "base/memory/scoped_ptr.h" #include "base/memory/weak_ptr.h" #include "chrome/browser/extensions/image_loading_tracker.h" +#include "chrome/browser/ui/browser_list.h" #include "ui/gfx/image/image_skia.h" class MessageLoop; -class Profile; namespace extensions { class Extension; @@ -21,6 +22,7 @@ class Extension; class ExtensionUninstallDialog : public ImageLoadingTracker::Observer, + public BrowserList::Observer, public base::SupportsWeakPtr<ExtensionUninstallDialog> { public: class Delegate { @@ -36,8 +38,9 @@ class ExtensionUninstallDialog }; // Creates a platform specific implementation of ExtensionUninstallDialog. - static ExtensionUninstallDialog* Create( - Profile* profile, Delegate* delegate); + // |browser| can be NULL only for Ash when this is used with the applist + // window. + static ExtensionUninstallDialog* Create(Browser* browser, Delegate* delegate); virtual ~ExtensionUninstallDialog(); @@ -49,9 +52,9 @@ class ExtensionUninstallDialog protected: // Constructor used by the derived classes. - explicit ExtensionUninstallDialog(Profile* profile, Delegate* delegate); + ExtensionUninstallDialog(Browser* browser, Delegate* delegate); - Profile* profile_; + Browser* browser_; // The delegate we will call Accepted/Canceled on after confirmation dialog. Delegate* delegate_; @@ -72,6 +75,9 @@ class ExtensionUninstallDialog const std::string& extension_id, int index) OVERRIDE; + // BrowserList::Observer + virtual void OnBrowserRemoved(Browser* browser) OVERRIDE; + // Displays the prompt. This should only be called after loading the icon. // The implementations of this method are platform-specific. virtual void Show() = 0; @@ -80,7 +86,7 @@ class ExtensionUninstallDialog // Keeps track of extension images being loaded on the File thread for the // purpose of showing the dialog. - ImageLoadingTracker tracker_; + scoped_ptr<ImageLoadingTracker> tracker_; DISALLOW_COPY_AND_ASSIGN(ExtensionUninstallDialog); }; |