| 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 20 matching lines...) Expand all Loading... |
| 31 class ImageSkia; | 31 class ImageSkia; |
| 32 class Rect; | 32 class Rect; |
| 33 class Size; | 33 class Size; |
| 34 } | 34 } |
| 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 // The action that the UI should take after the ExtensionAction is clicked. |
| 42 enum ShowAction { |
| 43 ACTION_NONE, |
| 44 ACTION_SHOW_POPUP, |
| 45 // We don't need a SHOW_CONTEXT_MENU because that's handled separately in |
| 46 // the UI. |
| 47 }; |
| 48 |
| 41 // Use this ID to indicate the default state for properties that take a tab_id | 49 // Use this ID to indicate the default state for properties that take a tab_id |
| 42 // parameter. | 50 // parameter. |
| 43 static const int kDefaultTabId; | 51 static const int kDefaultTabId; |
| 44 | 52 |
| 45 // Max size (both dimensions) for page actions. | 53 // Max size (both dimensions) for page actions. |
| 46 static const int kPageActionIconMaxSize; | 54 static const int kPageActionIconMaxSize; |
| 47 | 55 |
| 48 ExtensionAction(const std::string& extension_id, | 56 ExtensionAction(const std::string& extension_id, |
| 49 extensions::ActionInfo::Type action_type, | 57 extensions::ActionInfo::Type action_type, |
| 50 const extensions::ActionInfo& manifest_data); | 58 const extensions::ActionInfo& manifest_data); |
| (...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 270 }; | 278 }; |
| 271 | 279 |
| 272 template<> | 280 template<> |
| 273 struct ExtensionAction::ValueTraits<int> { | 281 struct ExtensionAction::ValueTraits<int> { |
| 274 static int CreateEmpty() { | 282 static int CreateEmpty() { |
| 275 return -1; | 283 return -1; |
| 276 } | 284 } |
| 277 }; | 285 }; |
| 278 | 286 |
| 279 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_ACTION_H_ | 287 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_ACTION_H_ |
| OLD | NEW |