OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef CHROME_COMMON_EXTENSIONS_API_EXTENSION_ACTION_ACTION_INFO_H_ |
| 6 #define CHROME_COMMON_EXTENSIONS_API_EXTENSION_ACTION_ACTION_INFO_H_ |
| 7 |
| 8 #include <string> |
| 9 |
| 10 #include "chrome/common/extensions/extension_icon_set.h" |
| 11 #include "googleurl/src/gurl.h" |
| 12 |
| 13 namespace extensions { |
| 14 |
| 15 class Extension; |
| 16 |
| 17 struct ActionInfo { |
| 18 ActionInfo(); |
| 19 ~ActionInfo(); |
| 20 |
| 21 // The types of extension actions. |
| 22 enum Type { |
| 23 TYPE_BROWSER, |
| 24 TYPE_PAGE, |
| 25 TYPE_SCRIPT_BADGE, |
| 26 TYPE_SYSTEM_INDICATOR, |
| 27 }; |
| 28 |
| 29 // Returns the appropriate ActionInfo for the given |extension|. |
| 30 static const ActionInfo* GetScriptBadgeInfo(const Extension* extension); |
| 31 |
| 32 // Sets the appropriate ActionInfo as ManifestData for the given |extension|. |
| 33 // This is static since |extension| takes ownership of |info|. |
| 34 static void SetScriptBadgeInfo(Extension* extension, ActionInfo* info); |
| 35 |
| 36 // Empty implies the key wasn't present. |
| 37 ExtensionIconSet default_icon; |
| 38 std::string default_title; |
| 39 GURL default_popup_url; |
| 40 // action id -- only used with legacy page actions API. |
| 41 std::string id; |
| 42 }; |
| 43 |
| 44 } // namespace extensions |
| 45 |
| 46 #endif // CHROME_COMMON_EXTENSIONS_API_EXTENSION_ACTION_ACTION_INFO_H_ |
OLD | NEW |