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

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

Issue 270153004: Introduce ActiveScriptController; track active extension scripts (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Kalman's Created 6 years, 7 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/page_action_controller.h
diff --git a/chrome/browser/extensions/page_action_controller.h b/chrome/browser/extensions/page_action_controller.h
index 88320d3ca1a118f4d4750091244b69a8c8987ed6..632b56f8534b9942848facd895233d3e05458999 100644
--- a/chrome/browser/extensions/page_action_controller.h
+++ b/chrome/browser/extensions/page_action_controller.h
@@ -7,9 +7,7 @@
#include <string>
-#include "base/observer_list.h"
-#include "chrome/browser/extensions/location_bar_controller.h"
-#include "content/public/browser/web_contents_observer.h"
+#include "chrome/browser/extensions/location_bar_controller_provider.h"
class Profile;
@@ -18,29 +16,27 @@ class ExtensionRegistry;
// A LocationBarController which populates the location bar with icons based
// on the page_action extension API.
-class PageActionController : public LocationBarController,
- public content::WebContentsObserver {
+class PageActionController : public LocationBarControllerProvider {
public:
explicit PageActionController(content::WebContents* web_contents);
virtual ~PageActionController();
- // LocationBarController implementation.
- virtual std::vector<ExtensionAction*> GetCurrentActions() const OVERRIDE;
- virtual Action OnClicked(const std::string& extension_id,
- int mouse_button) OVERRIDE;
- virtual void NotifyChange() OVERRIDE;
-
- // content::WebContentsObserver implementation.
- virtual void DidNavigateMainFrame(
- const content::LoadCommittedDetails& details,
- const content::FrameNavigateParams& params) OVERRIDE;
+ // LocationBarController::Provider implementation.
+ virtual ExtensionAction* GetActionForExtension(const Extension* extension)
+ OVERRIDE;
+ virtual LocationBarController::Action OnClicked(
+ const Extension* extension) OVERRIDE;
+ virtual void OnNavigated() OVERRIDE;
private:
- // Gets the Profile for the web contents.
- Profile* GetProfile() const;
+ // Returns the associated Profile.
+ Profile* GetProfile();
+
+ // The current page actions for the associated WebContents.
+ std::vector<ExtensionAction*> current_actions_;
- // Gets the ExtensionRegistry for the web contents.
- ExtensionRegistry* GetExtensionRegistry() const;
+ // The associated WebContents.
+ content::WebContents* web_contents_;
DISALLOW_COPY_AND_ASSIGN(PageActionController);
};

Powered by Google App Engine
This is Rietveld 408576698