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> |
11 | 11 |
12 #include "base/memory/scoped_ptr.h" | 12 #include "base/memory/scoped_ptr.h" |
13 #include "base/stl_util.h" | 13 #include "base/stl_util.h" |
14 #include "chrome/common/extensions/api/extension_action/action_info.h" | 14 #include "chrome/common/extensions/api/extension_action/action_info.h" |
| 15 #include "extensions/common/constants.h" |
15 #include "third_party/skia/include/core/SkColor.h" | 16 #include "third_party/skia/include/core/SkColor.h" |
16 #include "ui/gfx/image/image.h" | 17 #include "ui/gfx/image/image.h" |
17 | 18 |
18 class GURL; | 19 class GURL; |
19 | 20 |
20 namespace content { | 21 namespace content { |
21 class BrowserContext; | 22 class BrowserContext; |
22 } | 23 } |
23 | 24 |
24 namespace extensions { | 25 namespace extensions { |
(...skipping 15 matching lines...) Expand all Loading... |
40 class ExtensionAction { | 41 class ExtensionAction { |
41 public: | 42 public: |
42 // The action that the UI should take after the ExtensionAction is clicked. | 43 // The action that the UI should take after the ExtensionAction is clicked. |
43 enum ShowAction { | 44 enum ShowAction { |
44 ACTION_NONE, | 45 ACTION_NONE, |
45 ACTION_SHOW_POPUP, | 46 ACTION_SHOW_POPUP, |
46 // We don't need a SHOW_CONTEXT_MENU because that's handled separately in | 47 // We don't need a SHOW_CONTEXT_MENU because that's handled separately in |
47 // the UI. | 48 // the UI. |
48 }; | 49 }; |
49 | 50 |
| 51 static extension_misc::ExtensionIcons ActionIconSize(); |
| 52 |
50 // Use this ID to indicate the default state for properties that take a tab_id | 53 // Use this ID to indicate the default state for properties that take a tab_id |
51 // parameter. | 54 // parameter. |
52 static const int kDefaultTabId; | 55 static const int kDefaultTabId; |
53 | 56 |
54 // Max size (both dimensions) for page actions. | |
55 static const int kPageActionIconMaxSize; | |
56 | |
57 ExtensionAction(const extensions::Extension& extension, | 57 ExtensionAction(const extensions::Extension& extension, |
58 extensions::ActionInfo::Type action_type, | 58 extensions::ActionInfo::Type action_type, |
59 const extensions::ActionInfo& manifest_data); | 59 const extensions::ActionInfo& manifest_data); |
60 ~ExtensionAction(); | 60 ~ExtensionAction(); |
61 | 61 |
62 // extension id | 62 // extension id |
63 const std::string& extension_id() const { return extension_id_; } | 63 const std::string& extension_id() const { return extension_id_; } |
64 | 64 |
65 // What kind of action is this? | 65 // What kind of action is this? |
66 extensions::ActionInfo::Type action_type() const { | 66 extensions::ActionInfo::Type action_type() const { |
(...skipping 234 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
301 }; | 301 }; |
302 | 302 |
303 template<> | 303 template<> |
304 struct ExtensionAction::ValueTraits<int> { | 304 struct ExtensionAction::ValueTraits<int> { |
305 static int CreateEmpty() { | 305 static int CreateEmpty() { |
306 return -1; | 306 return -1; |
307 } | 307 } |
308 }; | 308 }; |
309 | 309 |
310 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_ACTION_H_ | 310 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_ACTION_H_ |
OLD | NEW |