| 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" |
| 11 #include "extensions/common/error_utils.h" | 11 #include "extensions/common/error_utils.h" |
| 12 #include "extensions/common/extension.h" | 12 #include "extensions/common/extension.h" |
| 13 #include "extensions/common/manifest_constants.h" | 13 #include "extensions/common/manifest_constants.h" |
| 14 #include "extensions/common/manifest_handler_helpers.h" | 14 #include "extensions/common/manifest_handler_helpers.h" |
| 15 | 15 |
| 16 namespace extensions { | 16 namespace extensions { |
| 17 | 17 |
| 18 namespace errors = manifest_errors; | 18 namespace errors = manifest_errors; |
| 19 namespace keys = manifest_keys; | 19 namespace keys = manifest_keys; |
| 20 | 20 |
| 21 namespace { | 21 namespace { |
| 22 | 22 |
| 23 // The manifest data container for the ActionInfos for BrowserActions, | 23 // The manifest data container for the ActionInfos for BrowserActions, |
| 24 // PageActions and SystemIndicators. | 24 // PageActions and SystemIndicators. |
| 25 struct ActionInfoData : public Extension::ManifestData { | 25 struct ActionInfoData : public Extension::ManifestData { |
| 26 explicit ActionInfoData(ActionInfo* action_info); | 26 explicit ActionInfoData(ActionInfo* action_info); |
| 27 virtual ~ActionInfoData(); | 27 ~ActionInfoData() override; |
| 28 | 28 |
| 29 // The action associated with the BrowserAction. | 29 // The action associated with the BrowserAction. |
| 30 scoped_ptr<ActionInfo> action_info; | 30 scoped_ptr<ActionInfo> action_info; |
| 31 }; | 31 }; |
| 32 | 32 |
| 33 ActionInfoData::ActionInfoData(ActionInfo* info) : action_info(info) { | 33 ActionInfoData::ActionInfoData(ActionInfo* info) : action_info(info) { |
| 34 } | 34 } |
| 35 | 35 |
| 36 ActionInfoData::~ActionInfoData() { | 36 ActionInfoData::~ActionInfoData() { |
| 37 } | 37 } |
| (...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 220 | 220 |
| 221 // static | 221 // static |
| 222 bool ActionInfo::IsVerboseInstallMessage(const Extension* extension) { | 222 bool ActionInfo::IsVerboseInstallMessage(const Extension* extension) { |
| 223 const ActionInfo* page_action_info = GetPageActionInfo(extension); | 223 const ActionInfo* page_action_info = GetPageActionInfo(extension); |
| 224 return page_action_info && | 224 return page_action_info && |
| 225 (CommandsInfo::GetPageActionCommand(extension) || | 225 (CommandsInfo::GetPageActionCommand(extension) || |
| 226 !page_action_info->default_icon.empty()); | 226 !page_action_info->default_icon.empty()); |
| 227 } | 227 } |
| 228 | 228 |
| 229 } // namespace extensions | 229 } // namespace extensions |
| OLD | NEW |