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

Unified Diff: chrome/browser/extensions/api/extension_action/extension_page_actions_api.cc

Issue 10914244: Remove support for page_action.icons, and the legacy code surrounding it. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: constants removed Created 8 years, 3 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
Index: chrome/browser/extensions/api/extension_action/extension_page_actions_api.cc
diff --git a/chrome/browser/extensions/api/extension_action/extension_page_actions_api.cc b/chrome/browser/extensions/api/extension_action/extension_page_actions_api.cc
index 55cba75e22ff0eaa9b3c682757d7ee83617e4495..231ab707236f46757f718b3d2a9f890e00f9f572 100644
--- a/chrome/browser/extensions/api/extension_action/extension_page_actions_api.cc
+++ b/chrome/browser/extensions/api/extension_action/extension_page_actions_api.cc
@@ -31,8 +31,6 @@ const char kNoTabError[] = "No tab with id: *.";
const char kNoPageActionError[] =
"This extension has no page action specified.";
const char kUrlNotActiveError[] = "This url is no longer active: *.";
-const char kIconIndexOutOfBounds[] = "Page action icon index out of bounds.";
-const char kNoIconSpecified[] = "Page action has no icons to show.";
}
PageActionsFunction::PageActionsFunction() {
@@ -53,15 +51,9 @@ bool PageActionsFunction::SetPageActionEnabled(bool enable) {
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));
- }
}
ExtensionAction* page_action = GetExtension()->page_action();
@@ -70,12 +62,6 @@ bool PageActionsFunction::SetPageActionEnabled(bool enable) {
return false;
}
- if (icon_id < 0 ||
- static_cast<size_t>(icon_id) >= page_action->icon_paths()->size()) {
- error_ = (icon_id == 0) ? kNoIconSpecified : kIconIndexOutOfBounds;
- return false;
- }
-
// Find the TabContents that contains this tab id.
TabContents* contents = NULL;
bool result = ExtensionTabUtil::GetTabById(
@@ -98,7 +84,6 @@ bool PageActionsFunction::SetPageActionEnabled(bool enable) {
page_action->SetAppearance(
tab_id, enable ? ExtensionAction::ACTIVE : ExtensionAction::INVISIBLE);
page_action->SetTitle(tab_id, title);
- page_action->SetIconIndex(tab_id, icon_id);
extensions::TabHelper::FromWebContents(contents->web_contents())->
location_bar_controller()->NotifyChange();

Powered by Google App Engine
This is Rietveld 408576698