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 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
175 *error = ErrorUtils::FormatErrorMessageUTF16( | 175 *error = ErrorUtils::FormatErrorMessageUTF16( |
176 errors::kInvalidPageActionPopupPath, url_str); | 176 errors::kInvalidPageActionPopupPath, url_str); |
177 return scoped_ptr<ActionInfo>(); | 177 return scoped_ptr<ActionInfo>(); |
178 } | 178 } |
179 } else { | 179 } else { |
180 DCHECK(result->default_popup_url.is_empty()) | 180 DCHECK(result->default_popup_url.is_empty()) |
181 << "Shouldn't be possible for the popup to be set."; | 181 << "Shouldn't be possible for the popup to be set."; |
182 } | 182 } |
183 } | 183 } |
184 | 184 |
| 185 // Should open popup in sidebar? |
| 186 if (!dict->GetBoolean(keys::kPageActionOpenInSidebar, |
| 187 &result->open_in_sidebar)) |
| 188 result->open_in_sidebar = false; |
| 189 |
185 return result.Pass(); | 190 return result.Pass(); |
186 } | 191 } |
187 | 192 |
188 // static | 193 // static |
189 const ActionInfo* ActionInfo::GetBrowserActionInfo(const Extension* extension) { | 194 const ActionInfo* ActionInfo::GetBrowserActionInfo(const Extension* extension) { |
190 return GetActionInfo(extension, keys::kBrowserAction); | 195 return GetActionInfo(extension, keys::kBrowserAction); |
191 } | 196 } |
192 | 197 |
193 const ActionInfo* ActionInfo::GetPageActionInfo(const Extension* extension) { | 198 const ActionInfo* ActionInfo::GetPageActionInfo(const Extension* extension) { |
194 return GetActionInfo(extension, keys::kPageAction); | 199 return GetActionInfo(extension, keys::kPageAction); |
(...skipping 25 matching lines...) Expand all Loading... |
220 | 225 |
221 // static | 226 // static |
222 bool ActionInfo::IsVerboseInstallMessage(const Extension* extension) { | 227 bool ActionInfo::IsVerboseInstallMessage(const Extension* extension) { |
223 const ActionInfo* page_action_info = GetPageActionInfo(extension); | 228 const ActionInfo* page_action_info = GetPageActionInfo(extension); |
224 return page_action_info && | 229 return page_action_info && |
225 (CommandsInfo::GetPageActionCommand(extension) || | 230 (CommandsInfo::GetPageActionCommand(extension) || |
226 !page_action_info->default_icon.empty()); | 231 !page_action_info->default_icon.empty()); |
227 } | 232 } |
228 | 233 |
229 } // namespace extensions | 234 } // namespace extensions |
OLD | NEW |