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

Unified Diff: chrome/browser/ui/extensions/extension_enable_flow.h

Issue 1534123002: [Extensions] Migrate ExtensionInstallPrompt::Delegate to be a callback (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 11 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/ui/extensions/extension_enable_flow.h
diff --git a/chrome/browser/ui/extensions/extension_enable_flow.h b/chrome/browser/ui/extensions/extension_enable_flow.h
index b84c2c02b300c343a980c906251a04de7df42567..02060f8271e34c7bb9ef8c5e6220fcd24d38cf7d 100644
--- a/chrome/browser/ui/extensions/extension_enable_flow.h
+++ b/chrome/browser/ui/extensions/extension_enable_flow.h
@@ -10,6 +10,7 @@
#include "base/callback.h"
#include "base/compiler_specific.h"
#include "base/macros.h"
+#include "base/memory/weak_ptr.h"
#include "base/scoped_observer.h"
#include "chrome/browser/extensions/extension_install_prompt.h"
#include "content/public/browser/notification_observer.h"
@@ -33,8 +34,7 @@ class ExtensionRegistry;
// extension is enabled already). Otherwise, a re-enable install prompt is
// shown to user. The extension is enabled when user acknowledges it or the
// flow is aborted when user declines it.
-class ExtensionEnableFlow : public ExtensionInstallPrompt::Delegate,
- public content::NotificationObserver,
+class ExtensionEnableFlow : public content::NotificationObserver,
public extensions::ExtensionRegistryObserver {
public:
ExtensionEnableFlow(Profile* profile,
@@ -88,9 +88,7 @@ class ExtensionEnableFlow : public ExtensionInstallPrompt::Delegate,
const extensions::Extension* extension,
extensions::UninstallReason reason) override;
- // ExtensionInstallPrompt::Delegate overrides:
- void InstallUIProceed() override;
- void InstallUIAbort(bool user_initiated) override;
+ void InstallPromptDone(ExtensionInstallPrompt::Result result);
Profile* const profile_;
const std::string extension_id_;
@@ -116,6 +114,8 @@ class ExtensionEnableFlow : public ExtensionInstallPrompt::Delegate,
extensions::ExtensionRegistryObserver>
extension_registry_observer_;
+ base::WeakPtrFactory<ExtensionEnableFlow> weak_ptr_factory_;
+
DISALLOW_COPY_AND_ASSIGN(ExtensionEnableFlow);
};

Powered by Google App Engine
This is Rietveld 408576698