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

Unified Diff: chrome/browser/extensions/extension_reenabler.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/extensions/extension_reenabler.h
diff --git a/chrome/browser/extensions/extension_reenabler.h b/chrome/browser/extensions/extension_reenabler.h
index a87cbaf953550a99e61ada7f0dd46a528536c419..7acd0682fbf39fa30e1fe20a8c76e2757e455230 100644
--- a/chrome/browser/extensions/extension_reenabler.h
+++ b/chrome/browser/extensions/extension_reenabler.h
@@ -9,6 +9,7 @@
#include "base/macros.h"
#include "base/memory/ref_counted.h"
#include "base/memory/scoped_ptr.h"
+#include "base/memory/weak_ptr.h"
#include "base/scoped_observer.h"
#include "chrome/browser/extensions/extension_install_prompt.h"
#include "chrome/browser/extensions/webstore_data_fetcher_delegate.h"
@@ -28,8 +29,7 @@ class WebstoreDataFetcher;
// increase.
// TODO(devlin): Once we get the UI figured out, we should also have this handle
// other disable reasons.
-class ExtensionReenabler : public ExtensionInstallPrompt::Delegate,
- public ExtensionRegistryObserver,
+class ExtensionReenabler : public ExtensionRegistryObserver,
public WebstoreDataFetcherDelegate {
public:
enum ReenableResult {
@@ -72,9 +72,7 @@ class ExtensionReenabler : public ExtensionInstallPrompt::Delegate,
content::WebContents* web_contents,
const ExtensionInstallPrompt::ShowDialogCallback& show_callback);
- // ExtensionInstallPrompt::Delegate:
- void InstallUIProceed() override;
- void InstallUIAbort(bool user_initiated) override;
+ void OnInstallPromptDone(ExtensionInstallPrompt::Result result);
// ExtensionRegistryObserver:
void OnExtensionLoaded(content::BrowserContext* browser_context,
@@ -120,6 +118,8 @@ class ExtensionReenabler : public ExtensionInstallPrompt::Delegate,
ScopedObserver<ExtensionRegistry, ExtensionRegistryObserver>
registry_observer_;
+ base::WeakPtrFactory<ExtensionReenabler> weak_factory_;
+
DISALLOW_COPY_AND_ASSIGN(ExtensionReenabler);
};
« no previous file with comments | « chrome/browser/extensions/extension_install_prompt_unittest.cc ('k') | chrome/browser/extensions/extension_reenabler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698