summaryrefslogtreecommitdiffstats
path: root/chrome/browser/extensions/page_action_controller.h
diff options
context:
space:
mode:
authorkalman@chromium.org <kalman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-05-17 04:47:42 +0000
committerkalman@chromium.org <kalman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-05-17 04:47:42 +0000
commit3012d7fc86d0bd218469817167f0b8d706092de7 (patch)
treeb156a3247b7a4ba74a6496b3d426aeafac3c075e /chrome/browser/extensions/page_action_controller.h
parente7293fa923c53d7e5ea3d38a0b94d6cbc0fb8486 (diff)
downloadchromium_src-3012d7fc86d0bd218469817167f0b8d706092de7.zip
chromium_src-3012d7fc86d0bd218469817167f0b8d706092de7.tar.gz
chromium_src-3012d7fc86d0bd218469817167f0b8d706092de7.tar.bz2
Only return the visible page actions from PageActionController.
This is a bit of a yak shave to support having the "action box" show active extensions on the current page rather than page actions. Previously, PageActionController was creating widgets for everything then LocationBarViewGtk was hiding them as necessary. This is assumes too much; we need to push the visibility logic into the Controller for the future. BUG=127988 Review URL: https://chromiumcodereview.appspot.com/10388160 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@137630 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/extensions/page_action_controller.h')
-rw-r--r--chrome/browser/extensions/page_action_controller.h21
1 files changed, 17 insertions, 4 deletions
diff --git a/chrome/browser/extensions/page_action_controller.h b/chrome/browser/extensions/page_action_controller.h
index 22f9fc6..cdb43a3 100644
--- a/chrome/browser/extensions/page_action_controller.h
+++ b/chrome/browser/extensions/page_action_controller.h
@@ -6,7 +6,12 @@
#define CHROME_BROWSER_EXTENSIONS_PAGE_ACTION_CONTROLLER_H_
#pragma once
+#include <set>
+#include <string>
+
+#include "base/observer_list.h"
#include "chrome/browser/extensions/action_box_controller.h"
+#include "chrome/browser/extensions/extension_tab_helper.h"
class ExtensionService;
class TabContentsWrapper;
@@ -14,22 +19,30 @@ class TabContentsWrapper;
namespace extensions {
// An ActionBoxController which corresponds to the page actions of an extension.
-class PageActionController : public ActionBoxController {
+class PageActionController : public ActionBoxController,
+ public ExtensionTabHelper::Observer {
public:
- explicit PageActionController(TabContentsWrapper* tab_contents);
+ PageActionController(TabContentsWrapper* tab_contents,
+ ExtensionTabHelper* tab_helper);
virtual ~PageActionController();
- virtual scoped_ptr<DataList> GetAllBadgeData() OVERRIDE;
-
+ // ActionBoxController implementation.
+ virtual scoped_ptr<std::vector<ExtensionAction*> > GetCurrentActions()
+ OVERRIDE;
virtual Action OnClicked(const std::string& extension_id,
int mouse_button) OVERRIDE;
+ // ExtensionTabHelper::Observer implementation.
+ virtual void OnPageActionStateChanged() OVERRIDE;
+
private:
// Gets the ExtensionService for |tab_contents_|.
ExtensionService* GetExtensionService();
TabContentsWrapper* tab_contents_;
+ ExtensionTabHelper* tab_helper_;
+
DISALLOW_COPY_AND_ASSIGN(PageActionController);
};