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

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: 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..af7903723660f353b460a88c0f8f19aadf496e2e 100644
--- a/chrome/browser/extensions/page_action_controller.h
+++ b/chrome/browser/extensions/page_action_controller.h
@@ -7,40 +7,37 @@
#include <string>
-#include "base/observer_list.h"
#include "chrome/browser/extensions/location_bar_controller.h"
-#include "content/public/browser/web_contents_observer.h"
class Profile;
namespace extensions {
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 {
+// A LocationBarControllerProvider which populates the location bar with icons
+// based on the page_action extension API.
+// TODO(rdevlin.cronin): This isn't really a controller.
+class PageActionController : public LocationBarController::ActionProvider {
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);
};
« no previous file with comments | « chrome/browser/extensions/location_bar_controller.cc ('k') | chrome/browser/extensions/page_action_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698