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

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

Issue 149046: PageActions can now specify multiple icons and switch between them... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 6 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 | « no previous file | chrome/browser/extensions/extension_page_actions_module_constants.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/extensions/extension_page_actions_module.cc
===================================================================
--- chrome/browser/extensions/extension_page_actions_module.cc (revision 19579)
+++ chrome/browser/extensions/extension_page_actions_module.cc (working copy)
@@ -31,6 +31,18 @@
std::string url;
EXTENSION_FUNCTION_VALIDATE(action->GetString(keys::kUrlKey, &url));
+ std::string title;
+ int icon_id = 0;
+ if (enable) {
+ // Both of those are optional.
+ if (action->HasKey(keys::kTitleKey))
+ EXTENSION_FUNCTION_VALIDATE(action->GetString(keys::kTitleKey, &title));
+ if (action->HasKey(keys::kIconIdKey)) {
+ EXTENSION_FUNCTION_VALIDATE(action->GetInteger(keys::kIconIdKey,
+ &icon_id));
+ }
+ }
+
// Find the TabContents that contains this tab id.
TabContents* contents = NULL;
ExtensionTabUtil::GetTabById(tab_id, profile(), NULL, NULL, &contents, NULL);
@@ -66,7 +78,7 @@
}
// Set visibility and broadcast notifications that the UI should be updated.
- contents->SetPageActionEnabled(page_action, enable);
+ contents->SetPageActionEnabled(page_action, enable, title, icon_id);
contents->NotifyNavigationStateChanged(TabContents::INVALIDATE_PAGE_ACTIONS);
return true;
« no previous file with comments | « no previous file | chrome/browser/extensions/extension_page_actions_module_constants.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698