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

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

Issue 2621953003: [Extensions] Remove the prompt to re-enable app when visiting its site (Closed)
Patch Set: Created 3 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
deleted file mode 100644
index 44b2a2f5c1e0502aa55c706e68080b7db967007e..0000000000000000000000000000000000000000
--- a/chrome/browser/extensions/navigation_observer.h
+++ /dev/null
@@ -1,84 +0,0 @@
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef CHROME_BROWSER_EXTENSIONS_NAVIGATION_OBSERVER_H_
-#define CHROME_BROWSER_EXTENSIONS_NAVIGATION_OBSERVER_H_
-
-#include <memory>
-#include <set>
-#include <string>
-
-#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"
-#include "content/public/browser/notification_registrar.h"
-#include "extensions/browser/extension_registry_observer.h"
-
-class Profile;
-
-namespace content {
-class NavigationController;
-}
-
-namespace extensions {
-
-// The NavigationObserver listens to navigation notifications. If the user
-// 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 content::NotificationObserver,
- public ExtensionRegistryObserver {
- public:
- explicit NavigationObserver(Profile* profile);
- ~NavigationObserver() override;
-
- // content::NotificationObserver
- void Observe(int type,
- const content::NotificationSource& source,
- const content::NotificationDetails& details) override;
-
- private:
- // Registers for the NOTIFICATION_NAV_ENTRY_COMMITTED notification.
- void RegisterForNotifications();
-
- // Checks if |nav_controller| has entered an extension's web extent. If it
- // has and the extension is disabled due to a permissions increase, this
- // prompts the user to accept the new permissions and enables the extension.
- void PromptToEnableExtensionIfNecessary(
- content::NavigationController* nav_controller);
-
- void OnInstallPromptDone(ExtensionInstallPrompt::Result result);
-
- // extensions::ExtensionRegistryObserver:
- void OnExtensionUninstalled(content::BrowserContext* browser_context,
- const Extension* extension,
- UninstallReason reason) override;
-
- content::NotificationRegistrar registrar_;
-
- Profile* profile_;
-
- // The UI used to confirm enabling extensions.
- std::unique_ptr<ExtensionInstallPrompt> extension_install_prompt_;
-
- // The data we keep track of when prompting to enable extensions.
- std::string in_progress_prompt_extension_id_;
- content::NavigationController* in_progress_prompt_navigation_controller_;
-
- // The extension ids we've already prompted the user about.
- std::set<std::string> prompted_extensions_;
-
- ScopedObserver<ExtensionRegistry, ExtensionRegistryObserver>
- extension_registry_observer_;
-
- base::WeakPtrFactory<NavigationObserver> weak_factory_;
-
- DISALLOW_COPY_AND_ASSIGN(NavigationObserver);
-};
-
-} // namespace extensions
-
-#endif // CHROME_BROWSER_EXTENSIONS_NAVIGATION_OBSERVER_H_

Powered by Google App Engine
This is Rietveld 408576698