summaryrefslogtreecommitdiffstats
path: root/chrome/browser/extensions/action_box_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/action_box_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/action_box_controller.h')
-rw-r--r--chrome/browser/extensions/action_box_controller.h26
1 files changed, 8 insertions, 18 deletions
diff --git a/chrome/browser/extensions/action_box_controller.h b/chrome/browser/extensions/action_box_controller.h
index e3415c7..e85e37e3 100644
--- a/chrome/browser/extensions/action_box_controller.h
+++ b/chrome/browser/extensions/action_box_controller.h
@@ -6,6 +6,7 @@
#define CHROME_BROWSER_EXTENSIONS_ACTION_BOX_CONTROLLER_H_
#pragma once
+#include <set>
#include <string>
#include <vector>
@@ -18,22 +19,6 @@ namespace extensions {
// Controller of the "badges" (aka "page actions") in the UI.
class ActionBoxController {
public:
- // UI decoration on a page box item.
- enum Decoration {
- DECORATION_NONE,
- };
-
- // Data about a UI badge.
- struct Data {
- // The type of decoration that should be applied to the badge.
- Decoration decoration;
-
- // The ExtensionAction that corresponds to the badge.
- ExtensionAction* action;
- };
-
- typedef std::vector<Data> DataList;
-
// The reaction that the UI should take after executing |OnClicked|.
enum Action {
ACTION_NONE,
@@ -43,8 +28,13 @@ class ActionBoxController {
virtual ~ActionBoxController() {}
- // Gets the badge data for all extensions.
- virtual scoped_ptr<DataList> GetAllBadgeData() = 0;
+ // Utility to add any actions to |out| which aren't present in |actions|.
+ static void AddMissingActions(
+ const std::set<ExtensionAction*>& actions,
+ std::vector<ExtensionAction*>* out);
+
+ // Gets the action data for all extensions.
+ virtual scoped_ptr<std::vector<ExtensionAction*> > GetCurrentActions() = 0;
// Notifies this that the badge for an extension has been clicked with some
// mouse button (1 for left, 2 for middle, and 3 for right click), and