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

Side by Side Diff: chrome/common/extensions/api/extension_action/action_info.cc

Issue 508783002: Update old syntax for action default_icon to populate 19 and 38px icons (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Changes Created 6 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 unified diff | Download patch
« no previous file with comments | « no previous file | chrome/common/extensions/docs/templates/intros/browserAction.html » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/common/extensions/api/extension_action/action_info.h" 5 #include "chrome/common/extensions/api/extension_action/action_info.h"
6 6
7 #include "base/memory/scoped_ptr.h" 7 #include "base/memory/scoped_ptr.h"
8 #include "base/strings/utf_string_conversions.h" 8 #include "base/strings/utf_string_conversions.h"
9 #include "chrome/common/extensions/api/commands/commands_handler.h" 9 #include "chrome/common/extensions/api/commands/commands_handler.h"
10 #include "extensions/common/constants.h" 10 #include "extensions/common/constants.h"
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
95 icons_value, 95 icons_value,
96 extension_misc::kExtensionActionIconSizes, 96 extension_misc::kExtensionActionIconSizes,
97 extension_misc::kNumExtensionActionIconSizes, 97 extension_misc::kNumExtensionActionIconSizes,
98 &result->default_icon, 98 &result->default_icon,
99 error)) { 99 error)) {
100 return scoped_ptr<ActionInfo>(); 100 return scoped_ptr<ActionInfo>();
101 } 101 }
102 } else if (dict->GetString(keys::kPageActionDefaultIcon, &default_icon) && 102 } else if (dict->GetString(keys::kPageActionDefaultIcon, &default_icon) &&
103 manifest_handler_helpers::NormalizeAndValidatePath( 103 manifest_handler_helpers::NormalizeAndValidatePath(
104 &default_icon)) { 104 &default_icon)) {
105 result->default_icon.Add(extension_misc::EXTENSION_ICON_ACTION, 105 result->default_icon.Add(extension_misc::EXTENSION_ICON_ACTION * 2,
not at google - send to devlin 2014/08/27 01:11:35 Actually this should be multiplying by extension_m
106 default_icon); 106 default_icon);
107 } else { 107 } else {
108 *error = base::ASCIIToUTF16(errors::kInvalidPageActionIconPath); 108 *error = base::ASCIIToUTF16(errors::kInvalidPageActionIconPath);
109 return scoped_ptr<ActionInfo>(); 109 return scoped_ptr<ActionInfo>();
110 } 110 }
111 } 111 }
112 112
113 // Read the page action title from |default_title| if present, |name| if not 113 // Read the page action title from |default_title| if present, |name| if not
114 // (both optional). 114 // (both optional).
115 if (dict->HasKey(keys::kPageActionDefaultTitle)) { 115 if (dict->HasKey(keys::kPageActionDefaultTitle)) {
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
213 213
214 // static 214 // static
215 bool ActionInfo::IsVerboseInstallMessage(const Extension* extension) { 215 bool ActionInfo::IsVerboseInstallMessage(const Extension* extension) {
216 const ActionInfo* page_action_info = GetPageActionInfo(extension); 216 const ActionInfo* page_action_info = GetPageActionInfo(extension);
217 return page_action_info && 217 return page_action_info &&
218 (CommandsInfo::GetPageActionCommand(extension) || 218 (CommandsInfo::GetPageActionCommand(extension) ||
219 !page_action_info->default_icon.empty()); 219 !page_action_info->default_icon.empty());
220 } 220 }
221 221
222 } // namespace extensions 222 } // namespace extensions
OLDNEW
« no previous file with comments | « no previous file | chrome/common/extensions/docs/templates/intros/browserAction.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698