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

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

Issue 527963003: Uncouple ActiveScriptController from LocationBarController (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 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/location_bar_controller.h
diff --git a/chrome/browser/extensions/location_bar_controller.h b/chrome/browser/extensions/location_bar_controller.h
index 166835250e8de1f56e33d0ba5d8409fac22db083..730b3b35a2fa0cbdeee268f3b50429aaa6fe78f8 100644
--- a/chrome/browser/extensions/location_bar_controller.h
+++ b/chrome/browser/extensions/location_bar_controller.h
@@ -5,10 +5,11 @@
#ifndef CHROME_BROWSER_EXTENSIONS_LOCATION_BAR_CONTROLLER_H_
#define CHROME_BROWSER_EXTENSIONS_LOCATION_BAR_CONTROLLER_H_
+#include <map>
#include <vector>
#include "base/macros.h"
-#include "base/memory/scoped_ptr.h"
+#include "base/memory/linked_ptr.h"
#include "base/scoped_observer.h"
#include "extensions/browser/extension_registry_observer.h"
@@ -20,8 +21,6 @@ class BrowserContext;
}
namespace extensions {
-
-class ActiveScriptController;
class Extension;
class ExtensionActionManager;
class ExtensionRegistry;
@@ -36,15 +35,11 @@ class LocationBarController : public ExtensionRegistryObserver {
// Returns the actions which should be displayed in the location bar.
std::vector<ExtensionAction*> GetCurrentActions();
- ActiveScriptController* active_script_controller() {
- return active_script_controller_.get();
- }
-
private:
// ExtensionRegistryObserver implementation.
virtual void OnExtensionLoaded(
content::BrowserContext* browser_context,
- const Extension* extnesion) OVERRIDE;
+ const Extension* extension) OVERRIDE;
Finnur 2014/09/03 09:30:05 What? You don't like exnesions now? Is that it? :)
virtual void OnExtensionUnloaded(
content::BrowserContext* browser_context,
const Extension* extension,
@@ -63,9 +58,11 @@ class LocationBarController : public ExtensionRegistryObserver {
// false with the toolbar redesign enabled.)
bool should_show_page_actions_;
- // The ActiveScriptController, which could also add actions for extensions if
- // they have a pending script.
- scoped_ptr<ActiveScriptController> active_script_controller_;
+ // Manufactured page actions that have been generated for extensions that want
+ // to run a script, but were blocked.
+ typedef std::map<std::string, linked_ptr<ExtensionAction> >
+ ExtensionActionMap;
+ ExtensionActionMap active_script_actions_;
ScopedObserver<ExtensionRegistry, ExtensionRegistryObserver>
extension_registry_observer_;
« no previous file with comments | « chrome/browser/extensions/extension_context_menu_model.cc ('k') | chrome/browser/extensions/location_bar_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698