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 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
63 | 63 |
64 // What kind of action is this? | 64 // What kind of action is this? |
65 extensions::ActionInfo::Type action_type() const { | 65 extensions::ActionInfo::Type action_type() const { |
66 return action_type_; | 66 return action_type_; |
67 } | 67 } |
68 | 68 |
69 // action id -- only used with legacy page actions API | 69 // action id -- only used with legacy page actions API |
70 std::string id() const { return id_; } | 70 std::string id() const { return id_; } |
71 void set_id(const std::string& id) { id_ = id; } | 71 void set_id(const std::string& id) { id_ = id; } |
72 | 72 |
| 73 // Should open Popup in sidebar? |
| 74 bool open_in_sidebar() { return open_in_sidebar_; } |
| 75 void set_open_in_sidebar(bool open_in_sidebar) { |
| 76 open_in_sidebar_ = open_in_sidebar; |
| 77 } |
| 78 |
73 // Set the url which the popup will load when the user clicks this action's | 79 // Set the url which the popup will load when the user clicks this action's |
74 // icon. Setting an empty URL will disable the popup for a given tab. | 80 // icon. Setting an empty URL will disable the popup for a given tab. |
75 void SetPopupUrl(int tab_id, const GURL& url); | 81 void SetPopupUrl(int tab_id, const GURL& url); |
76 | 82 |
77 // Use HasPopup() to see if a popup should be displayed. | 83 // Use HasPopup() to see if a popup should be displayed. |
78 bool HasPopup(int tab_id) const; | 84 bool HasPopup(int tab_id) const; |
79 | 85 |
80 // Get the URL to display in a popup. | 86 // Get the URL to display in a popup. |
81 GURL GetPopupUrl(int tab_id) const; | 87 GURL GetPopupUrl(int tab_id) const; |
82 | 88 |
(...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
292 scoped_ptr<ExtensionIconSet> default_icon_; | 298 scoped_ptr<ExtensionIconSet> default_icon_; |
293 | 299 |
294 // The default icon image, if |default_icon_| exists. | 300 // The default icon image, if |default_icon_| exists. |
295 // Lazily initialized via LoadDefaultIconImage(). | 301 // Lazily initialized via LoadDefaultIconImage(). |
296 scoped_ptr<extensions::IconImage> default_icon_image_; | 302 scoped_ptr<extensions::IconImage> default_icon_image_; |
297 | 303 |
298 // The id for the ExtensionAction, for example: "RssPageAction". This is | 304 // The id for the ExtensionAction, for example: "RssPageAction". This is |
299 // needed for compat with an older version of the page actions API. | 305 // needed for compat with an older version of the page actions API. |
300 std::string id_; | 306 std::string id_; |
301 | 307 |
| 308 // Popup should be open sidebar |
| 309 bool open_in_sidebar_; |
| 310 |
302 DISALLOW_COPY_AND_ASSIGN(ExtensionAction); | 311 DISALLOW_COPY_AND_ASSIGN(ExtensionAction); |
303 }; | 312 }; |
304 | 313 |
305 template<> | 314 template<> |
306 struct ExtensionAction::ValueTraits<int> { | 315 struct ExtensionAction::ValueTraits<int> { |
307 static int CreateEmpty() { | 316 static int CreateEmpty() { |
308 return -1; | 317 return -1; |
309 } | 318 } |
310 }; | 319 }; |
311 | 320 |
312 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_ACTION_H_ | 321 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_ACTION_H_ |
OLD | NEW |