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

Unified Diff: chrome/browser/extensions/navigation_observer.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/navigation_observer.h
diff --git a/chrome/browser/extensions/navigation_observer.h b/chrome/browser/extensions/navigation_observer.h
index eae903c583e079061eaf12a240540648cabe0abe..fb2ca9860c4ffc7f38133c925069f00d8d78cb3b 100644
--- a/chrome/browser/extensions/navigation_observer.h
+++ b/chrome/browser/extensions/navigation_observer.h
@@ -10,6 +10,7 @@
#include "base/macros.h"
#include "base/memory/scoped_ptr.h"
+#include "base/memory/weak_ptr.h"
#include "chrome/browser/extensions/extension_install_prompt.h"
#include "content/public/browser/notification_observer.h"
#include "content/public/browser/notification_registrar.h"
@@ -26,8 +27,7 @@ namespace extensions {
// navigates into an extension that has been disabled due to a permission
// increase, it prompts the user to accept the new permissions and re-enables
// the extension.
-class NavigationObserver : public ExtensionInstallPrompt::Delegate,
- public content::NotificationObserver {
+class NavigationObserver : public content::NotificationObserver {
public:
explicit NavigationObserver(Profile* profile);
~NavigationObserver() override;
@@ -47,9 +47,7 @@ class NavigationObserver : public ExtensionInstallPrompt::Delegate,
void PromptToEnableExtensionIfNecessary(
content::NavigationController* nav_controller);
- // ExtensionInstallPrompt::Delegate callbacks used for the permissions prompt.
- void InstallUIProceed() override;
- void InstallUIAbort(bool user_initiated) override;
+ void OnInstallPromptDone(ExtensionInstallPrompt::Result result);
content::NotificationRegistrar registrar_;
@@ -65,6 +63,8 @@ class NavigationObserver : public ExtensionInstallPrompt::Delegate,
// The extension ids we've already prompted the user about.
std::set<std::string> prompted_extensions_;
+ base::WeakPtrFactory<NavigationObserver> weak_factory_;
+
DISALLOW_COPY_AND_ASSIGN(NavigationObserver);
};
« no previous file with comments | « chrome/browser/extensions/external_install_error.cc ('k') | chrome/browser/extensions/navigation_observer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698