OLD | NEW |
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 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
167 *error = ErrorUtils::FormatErrorMessageUTF16( | 167 *error = ErrorUtils::FormatErrorMessageUTF16( |
168 errors::kInvalidPageActionPopupPath, url_str); | 168 errors::kInvalidPageActionPopupPath, url_str); |
169 return scoped_ptr<ActionInfo>(); | 169 return scoped_ptr<ActionInfo>(); |
170 } | 170 } |
171 } else { | 171 } else { |
172 DCHECK(result->default_popup_url.is_empty()) | 172 DCHECK(result->default_popup_url.is_empty()) |
173 << "Shouldn't be possible for the popup to be set."; | 173 << "Shouldn't be possible for the popup to be set."; |
174 } | 174 } |
175 } | 175 } |
176 | 176 |
177 return result.Pass(); | 177 return result; |
178 } | 178 } |
179 | 179 |
180 // static | 180 // static |
181 const ActionInfo* ActionInfo::GetBrowserActionInfo(const Extension* extension) { | 181 const ActionInfo* ActionInfo::GetBrowserActionInfo(const Extension* extension) { |
182 return GetActionInfo(extension, keys::kBrowserAction); | 182 return GetActionInfo(extension, keys::kBrowserAction); |
183 } | 183 } |
184 | 184 |
185 const ActionInfo* ActionInfo::GetPageActionInfo(const Extension* extension) { | 185 const ActionInfo* ActionInfo::GetPageActionInfo(const Extension* extension) { |
186 return GetActionInfo(extension, keys::kPageAction); | 186 return GetActionInfo(extension, keys::kPageAction); |
187 } | 187 } |
(...skipping 24 matching lines...) Expand all Loading... |
212 | 212 |
213 // static | 213 // static |
214 bool ActionInfo::IsVerboseInstallMessage(const Extension* extension) { | 214 bool ActionInfo::IsVerboseInstallMessage(const Extension* extension) { |
215 const ActionInfo* page_action_info = GetPageActionInfo(extension); | 215 const ActionInfo* page_action_info = GetPageActionInfo(extension); |
216 return page_action_info && | 216 return page_action_info && |
217 (CommandsInfo::GetPageActionCommand(extension) || | 217 (CommandsInfo::GetPageActionCommand(extension) || |
218 !page_action_info->default_icon.empty()); | 218 !page_action_info->default_icon.empty()); |
219 } | 219 } |
220 | 220 |
221 } // namespace extensions | 221 } // namespace extensions |
OLD | NEW |