| 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_EXTENSION_ACTION_H_ | 5 #ifndef CHROME_COMMON_EXTENSIONS_EXTENSION_ACTION_H_ |
| 6 #define CHROME_COMMON_EXTENSIONS_EXTENSION_ACTION_H_ | 6 #define CHROME_COMMON_EXTENSIONS_EXTENSION_ACTION_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <map> | 9 #include <map> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 23 matching lines...) Expand all Loading... |
| 34 enum Type { | 34 enum Type { |
| 35 TYPE_NONE, | 35 TYPE_NONE, |
| 36 TYPE_BROWSER, | 36 TYPE_BROWSER, |
| 37 TYPE_PAGE, | 37 TYPE_PAGE, |
| 38 }; | 38 }; |
| 39 | 39 |
| 40 explicit ExtensionAction(const std::string& extension_id); | 40 explicit ExtensionAction(const std::string& extension_id); |
| 41 ~ExtensionAction(); | 41 ~ExtensionAction(); |
| 42 | 42 |
| 43 // extension id | 43 // extension id |
| 44 std::string extension_id() const { return extension_id_; } | 44 const std::string& extension_id() const { return extension_id_; } |
| 45 | 45 |
| 46 // action id -- only used with legacy page actions API | 46 // action id -- only used with legacy page actions API |
| 47 std::string id() const { return id_; } | 47 std::string id() const { return id_; } |
| 48 void set_id(const std::string& id) { id_ = id; } | 48 void set_id(const std::string& id) { id_ = id; } |
| 49 | 49 |
| 50 // static icon paths from manifest -- only used with legacy page actions API. | 50 // static icon paths from manifest -- only used with legacy page actions API. |
| 51 std::vector<std::string>* icon_paths() { return &icon_paths_; } | 51 std::vector<std::string>* icon_paths() { return &icon_paths_; } |
| 52 | 52 |
| 53 // Set the url which the popup will load when the user clicks this action's | 53 // Set the url which the popup will load when the user clicks this action's |
| 54 // icon. Setting an empty URL will disable the popup for a given tab. | 54 // icon. Setting an empty URL will disable the popup for a given tab. |
| (...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 197 }; | 197 }; |
| 198 | 198 |
| 199 template<> | 199 template<> |
| 200 struct ExtensionAction::ValueTraits<int> { | 200 struct ExtensionAction::ValueTraits<int> { |
| 201 static int CreateEmpty() { | 201 static int CreateEmpty() { |
| 202 return -1; | 202 return -1; |
| 203 } | 203 } |
| 204 }; | 204 }; |
| 205 | 205 |
| 206 #endif // CHROME_COMMON_EXTENSIONS_EXTENSION_ACTION_H_ | 206 #endif // CHROME_COMMON_EXTENSIONS_EXTENSION_ACTION_H_ |
| OLD | NEW |