Chromium Code Reviews| 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 #ifndef CHROME_COMMON_EXTENSIONS_API_EXTENSION_ACTION_ACTION_INFO_H_ | 5 #ifndef CHROME_COMMON_EXTENSIONS_API_EXTENSION_ACTION_ACTION_INFO_H_ |
| 6 #define CHROME_COMMON_EXTENSIONS_API_EXTENSION_ACTION_ACTION_INFO_H_ | 6 #define CHROME_COMMON_EXTENSIONS_API_EXTENSION_ACTION_ACTION_INFO_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "chrome/common/extensions/extension.h" | |
| 10 #include "chrome/common/extensions/extension_icon_set.h" | 11 #include "chrome/common/extensions/extension_icon_set.h" |
| 11 #include "googleurl/src/gurl.h" | 12 #include "googleurl/src/gurl.h" |
| 12 | 13 |
| 13 namespace extensions { | 14 namespace extensions { |
| 14 | 15 |
| 15 struct ActionInfo { | 16 struct ActionInfo { |
| 16 ActionInfo(); | 17 ActionInfo(); |
| 17 ~ActionInfo(); | 18 ~ActionInfo(); |
| 18 | 19 |
| 19 // The types of extension actions. | 20 // The types of extension actions. |
| 20 enum Type { | 21 enum Type { |
| 21 TYPE_BROWSER, | 22 TYPE_BROWSER, |
| 22 TYPE_PAGE, | 23 TYPE_PAGE, |
| 23 TYPE_SCRIPT_BADGE, | 24 TYPE_SCRIPT_BADGE, |
| 24 TYPE_SYSTEM_INDICATOR, | 25 TYPE_SYSTEM_INDICATOR, |
| 25 }; | 26 }; |
| 26 | 27 |
| 27 // Empty implies the key wasn't present. | 28 // Empty implies the key wasn't present. |
| 28 ExtensionIconSet default_icon; | 29 ExtensionIconSet default_icon; |
| 29 std::string default_title; | 30 std::string default_title; |
| 30 GURL default_popup_url; | 31 GURL default_popup_url; |
| 31 // action id -- only used with legacy page actions API. | 32 // action id -- only used with legacy page actions API. |
| 32 std::string id; | 33 std::string id; |
| 33 }; | 34 }; |
| 34 | 35 |
| 36 // The manifest data container for the ActionInfos for BrowserActions and | |
| 37 // ScriptBadges. | |
| 38 struct ActionInfoData : public Extension::ManifestData { | |
|
Yoyo Zhou
2012/12/28 05:19:59
Can you hide this in the anonymous namespace in th
Devlin
2012/12/28 20:25:36
Possible, as long as we also put in Set|BrowserAct
| |
| 39 explicit ActionInfoData(ActionInfo* action_info); | |
| 40 virtual ~ActionInfoData(); | |
| 41 | |
| 42 // The action associated with the BrowserAction or ScriptBadge. | |
| 43 // This is never NULL for ScriptBadge. | |
| 44 scoped_ptr<ActionInfo> action_info; | |
| 45 | |
| 46 // Returns the appropriate ActionInfo for the extension. | |
| 47 static const ActionInfo* GetBrowserActionInfo(const Extension* extension); | |
|
Yoyo Zhou
2012/12/28 05:19:59
Can you put these in ActionInfo? It reads better t
Devlin
2012/12/28 20:25:36
Agreed, and done.
| |
| 48 static const ActionInfo* GetScriptBadgeInfo(const Extension* extension); | |
| 49 }; | |
| 50 | |
| 35 } // namespace extensions | 51 } // namespace extensions |
| 36 | 52 |
| 37 #endif // CHROME_COMMON_EXTENSIONS_API_EXTENSION_ACTION_ACTION_INFO_H_ | 53 #endif // CHROME_COMMON_EXTENSIONS_API_EXTENSION_ACTION_ACTION_INFO_H_ |
| OLD | NEW |