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

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

Issue 382133003: Refactored ExtensionUninstallDialog to take a NativeWindow instead of a Browser (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Removed the BrowserFinder method, and kept the dialog unconstructed until it's shown Created 6 years, 5 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_uninstall_dialog.h
diff --git a/chrome/browser/extensions/extension_uninstall_dialog.h b/chrome/browser/extensions/extension_uninstall_dialog.h
index 0d2f112a1ad781feb8fb145e165efd98af28205a..6ede0db39475317efbee53ea28ef348e86da77b7 100644
--- a/chrome/browser/extensions/extension_uninstall_dialog.h
+++ b/chrome/browser/extensions/extension_uninstall_dialog.h
@@ -9,9 +9,9 @@
#include "base/compiler_specific.h"
#include "base/memory/scoped_ptr.h"
#include "base/memory/weak_ptr.h"
-#include "content/public/browser/notification_observer.h"
#include "content/public/browser/notification_registrar.h"
#include "ui/gfx/image/image_skia.h"
+#include "ui/gfx/native_widget_types.h"
class Browser;
class Profile;
@@ -28,8 +28,7 @@ namespace extensions {
class Extension;
class ExtensionUninstallDialog
- : public content::NotificationObserver,
- public base::SupportsWeakPtr<ExtensionUninstallDialog> {
+ : public base::SupportsWeakPtr<ExtensionUninstallDialog> {
public:
class Delegate {
public:
@@ -44,11 +43,10 @@ class ExtensionUninstallDialog
};
// Creates a platform specific implementation of ExtensionUninstallDialog.
- // |profile| and |delegate| can never be NULL.
- // |browser| can be NULL only for Ash when this is used with the applist
- // window.
+ // |profile| and |delegate| can never be NULL. If |parent| is not NULL, makes
+ // the dialog modal to |parent|, otherwise creates a standalone dialog.
static ExtensionUninstallDialog* Create(Profile* profile,
- Browser* browser,
+ gfx::NativeWindow parent,
Delegate* delegate);
virtual ~ExtensionUninstallDialog();
@@ -69,12 +67,12 @@ class ExtensionUninstallDialog
protected:
// Constructor used by the derived classes.
ExtensionUninstallDialog(Profile* profile,
- Browser* browser,
+ gfx::NativeWindow parent,
Delegate* delegate);
Profile* const profile_;
tapted 2014/07/24 07:46:33 Hm - I just noticed these protected data members a
sashab 2014/07/25 02:44:32 Opened crbug.com/397395 to track this. Simple fix
- Browser* browser_;
+ gfx::NativeWindow parent_;
tapted 2014/07/24 07:46:33 it would be nice to get rid of this too (I think t
// The delegate we will call Accepted/Canceled on after confirmation dialog.
Delegate* delegate_;
@@ -96,24 +94,10 @@ class ExtensionUninstallDialog
void OnImageLoaded(const std::string& extension_id, const gfx::Image& image);
- // content::NotificationObserver implementation.
- virtual void Observe(int type,
- const content::NotificationSource& source,
- const content::NotificationDetails& details) 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;
- // Keeps track of whether we're still waiting for an image to load before
- // we show the dialog.
- enum State {
- kImageIsLoading, // Image is loading asynchronously.
- kDialogIsShowing, // Dialog is shown after image is loaded.
- kBrowserIsClosing // Browser is closed while image is still loading.
- };
- State state_;
-
base::MessageLoop* ui_loop_;
content::NotificationRegistrar registrar_;

Powered by Google App Engine
This is Rietveld 408576698