| 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_BROWSER_EXTENSIONS_EXTENSION_ACTION_H_ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_EXTENSION_ACTION_H_ |
| 6 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_ACTION_H_ | 6 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_ACTION_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 24 matching lines...) Expand all Loading... |
| 35 | 35 |
| 36 // ExtensionAction encapsulates the state of a browser action or page action. | 36 // ExtensionAction encapsulates the state of a browser action or page action. |
| 37 // Instances can have both global and per-tab state. If a property does not have | 37 // Instances can have both global and per-tab state. If a property does not have |
| 38 // a per-tab value, the global value is used instead. | 38 // a per-tab value, the global value is used instead. |
| 39 class ExtensionAction { | 39 class ExtensionAction { |
| 40 public: | 40 public: |
| 41 // Use this ID to indicate the default state for properties that take a tab_id | 41 // Use this ID to indicate the default state for properties that take a tab_id |
| 42 // parameter. | 42 // parameter. |
| 43 static const int kDefaultTabId; | 43 static const int kDefaultTabId; |
| 44 | 44 |
| 45 // Max size (both dimensions) for page actions. |
| 46 static const int kPageActionIconMaxSize; |
| 47 |
| 45 ExtensionAction(const std::string& extension_id, | 48 ExtensionAction(const std::string& extension_id, |
| 46 extensions::ActionInfo::Type action_type, | 49 extensions::ActionInfo::Type action_type, |
| 47 const extensions::ActionInfo& manifest_data); | 50 const extensions::ActionInfo& manifest_data); |
| 48 ~ExtensionAction(); | 51 ~ExtensionAction(); |
| 49 | 52 |
| 50 // Gets a copy of this, ownership passed to caller. | 53 // Gets a copy of this, ownership passed to caller. |
| 51 // It doesn't make sense to copy of an ExtensionAction except in tests. | 54 // It doesn't make sense to copy of an ExtensionAction except in tests. |
| 52 scoped_ptr<ExtensionAction> CopyForTest() const; | 55 scoped_ptr<ExtensionAction> CopyForTest() const; |
| 53 | 56 |
| 54 // Given the extension action type, returns the size the extension action icon | 57 // Given the extension action type, returns the size the extension action icon |
| (...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 267 }; | 270 }; |
| 268 | 271 |
| 269 template<> | 272 template<> |
| 270 struct ExtensionAction::ValueTraits<int> { | 273 struct ExtensionAction::ValueTraits<int> { |
| 271 static int CreateEmpty() { | 274 static int CreateEmpty() { |
| 272 return -1; | 275 return -1; |
| 273 } | 276 } |
| 274 }; | 277 }; |
| 275 | 278 |
| 276 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_ACTION_H_ | 279 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_ACTION_H_ |
| OLD | NEW |