summaryrefslogtreecommitdiffstats
path: root/chrome/browser/extensions/page_action_controller.cc
diff options
context:
space:
mode:
authoraa@chromium.org <aa@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-10-04 06:40:09 +0000
committeraa@chromium.org <aa@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-10-04 06:40:09 +0000
commit773c2c9e77f71ce6be52b70fba5b84186d0b9c77 (patch)
treefff8704881fa922ce7619a3cb9f6a6a7358be2d4 /chrome/browser/extensions/page_action_controller.cc
parentdc324d8abe25e71ba3f279a143b9115f6d2e1ae0 (diff)
downloadchromium_src-773c2c9e77f71ce6be52b70fba5b84186d0b9c77.zip
chromium_src-773c2c9e77f71ce6be52b70fba5b84186d0b9c77.tar.gz
chromium_src-773c2c9e77f71ce6be52b70fba5b84186d0b9c77.tar.bz2
Paint page action badges on views. Also, make the script
bubble always last in omnibox if present. BUG=153137,153683,153687 Review URL: https://codereview.chromium.org/11026030 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@160091 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/extensions/page_action_controller.cc')
-rw-r--r--chrome/browser/extensions/page_action_controller.cc13
1 files changed, 13 insertions, 0 deletions
diff --git a/chrome/browser/extensions/page_action_controller.cc b/chrome/browser/extensions/page_action_controller.cc
index bcb7701..631a3f4 100644
--- a/chrome/browser/extensions/page_action_controller.cc
+++ b/chrome/browser/extensions/page_action_controller.cc
@@ -5,6 +5,7 @@
#include "chrome/browser/extensions/page_action_controller.h"
#include "chrome/browser/extensions/browser_event_router.h"
+#include "chrome/browser/extensions/component_loader.h"
#include "chrome/browser/extensions/extension_service.h"
#include "chrome/browser/extensions/extension_system.h"
#include "chrome/browser/extensions/tab_helper.h"
@@ -30,14 +31,26 @@ std::vector<ExtensionAction*> PageActionController::GetCurrentActions() const {
if (!service)
return std::vector<ExtensionAction*>();
+ // Accumulate the list of all page actions to display.
std::vector<ExtensionAction*> current_actions;
+ // The script bubble, if present, is always first. This will make it show up
+ // last in the omnibox.
+ const Extension* script_bubble =
+ service->component_loader()->GetScriptBubble();
+ if (script_bubble)
+ current_actions.push_back(script_bubble->page_action());
+
for (ExtensionSet::const_iterator i = service->extensions()->begin();
i != service->extensions()->end(); ++i) {
+ if (script_bubble && *i == script_bubble)
+ continue;
+
ExtensionAction* action = (*i)->page_action();
if (action)
current_actions.push_back(action);
}
+
return current_actions;
}