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

Unified Diff: chrome/browser/extensions/extensions_service.cc

Issue 306044: Refactor implementation of BrowserActions, and add support for (Closed)
Patch Set: Make it work on linux too Created 11 years, 2 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
« no previous file with comments | « chrome/browser/extensions/extensions_service.h ('k') | chrome/browser/gtk/browser_actions_toolbar_gtk.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/extensions/extensions_service.cc
diff --git a/chrome/browser/extensions/extensions_service.cc b/chrome/browser/extensions/extensions_service.cc
index 71d3a0807c1b01d0956c60353812da6a16993137..2567984985ca8176a8ac0bb1ab227c31ad56c35c 100644
--- a/chrome/browser/extensions/extensions_service.cc
+++ b/chrome/browser/extensions/extensions_service.cc
@@ -141,12 +141,16 @@ void ExtensionsService::Init() {
}
std::vector<ExtensionAction*> ExtensionsService::GetPageActions() const {
- return GetExtensionActions(ExtensionAction::PAGE_ACTION, true);
-}
+ std::vector<ExtensionAction*> result;
+
+ // TODO(finnur): Sort the icons in some meaningful way.
+ for (ExtensionList::const_iterator iter = extensions_.begin();
+ iter != extensions_.end(); ++iter) {
+ if ((*iter)->page_action())
+ result.push_back((*iter)->page_action());
+ }
-std::vector<ExtensionAction*> ExtensionsService::GetBrowserActions(
- bool include_popups) const {
- return GetExtensionActions(ExtensionAction::BROWSER_ACTION, include_popups);
+ return result;
}
void ExtensionsService::InstallExtension(const FilePath& extension_path) {
@@ -363,29 +367,6 @@ void ExtensionsService::NotifyExtensionUnloaded(Extension* extension) {
}
}
-std::vector<ExtensionAction*> ExtensionsService::GetExtensionActions(
- ExtensionAction::ExtensionActionType action_type,
- bool include_popups) const {
- std::vector<ExtensionAction*> result;
-
- // TODO(finnur): Sort the icons in some meaningful way.
- for (ExtensionList::const_iterator iter = extensions_.begin();
- iter != extensions_.end(); ++iter) {
- if (action_type == ExtensionAction::PAGE_ACTION) {
- ExtensionAction* page_action = (*iter)->page_action();
- if (page_action && (include_popups || !page_action->is_popup())) {
- result.push_back(page_action);
- }
- } else {
- ExtensionAction* browser_action = (*iter)->browser_action();
- if (browser_action && (include_popups || !browser_action->is_popup()))
- result.push_back(browser_action);
- }
- }
-
- return result;
-}
-
void ExtensionsService::UpdateExtensionBlacklist(
const std::vector<std::string>& blacklist) {
// Use this set to indicate if an extension in the blacklist has been used.
« no previous file with comments | « chrome/browser/extensions/extensions_service.h ('k') | chrome/browser/gtk/browser_actions_toolbar_gtk.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698