Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1695)

Side by Side Diff: chrome/browser/extensions/extension_action.h

Issue 1168383002: Implement sidebar support for extension action popups Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix assertion failure at extension_view_host.cc Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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 201 matching lines...) Expand 10 before | Expand all | Expand 10 after
284 scoped_ptr<ExtensionIconSet> default_icon_; 290 scoped_ptr<ExtensionIconSet> default_icon_;
285 291
286 // The default icon image, if |default_icon_| exists. 292 // The default icon image, if |default_icon_| exists.
287 // Lazily initialized via LoadDefaultIconImage(). 293 // Lazily initialized via LoadDefaultIconImage().
288 scoped_ptr<extensions::IconImage> default_icon_image_; 294 scoped_ptr<extensions::IconImage> default_icon_image_;
289 295
290 // The id for the ExtensionAction, for example: "RssPageAction". This is 296 // The id for the ExtensionAction, for example: "RssPageAction". This is
291 // needed for compat with an older version of the page actions API. 297 // needed for compat with an older version of the page actions API.
292 std::string id_; 298 std::string id_;
293 299
300 // Popup should be open sidebar
301 bool open_in_sidebar_;
302
294 DISALLOW_COPY_AND_ASSIGN(ExtensionAction); 303 DISALLOW_COPY_AND_ASSIGN(ExtensionAction);
295 }; 304 };
296 305
297 template<> 306 template<>
298 struct ExtensionAction::ValueTraits<int> { 307 struct ExtensionAction::ValueTraits<int> {
299 static int CreateEmpty() { 308 static int CreateEmpty() {
300 return -1; 309 return -1;
301 } 310 }
302 }; 311 };
303 312
304 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_ACTION_H_ 313 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_ACTION_H_
OLDNEW
« no previous file with comments | « chrome/browser/extensions/chrome_extensions_browser_client.cc ('k') | chrome/browser/extensions/extension_action.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698