OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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_GTK_BROWSER_ACTIONS_TOOLBAR_GTK_H_ | 5 #ifndef CHROME_BROWSER_GTK_BROWSER_ACTIONS_TOOLBAR_GTK_H_ |
6 #define CHROME_BROWSER_GTK_BROWSER_ACTIONS_TOOLBAR_GTK_H_ | 6 #define CHROME_BROWSER_GTK_BROWSER_ACTIONS_TOOLBAR_GTK_H_ |
7 | 7 |
8 #include <gtk/gtk.h> | 8 #include <gtk/gtk.h> |
9 | 9 |
10 #include <map> | 10 #include <map> |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
62 // Delete resources associated with UI for a browser action. | 62 // Delete resources associated with UI for a browser action. |
63 void RemoveButtonForExtension(Extension* extension); | 63 void RemoveButtonForExtension(Extension* extension); |
64 | 64 |
65 // Change the visibility of widget() based on whether we have any buttons | 65 // Change the visibility of widget() based on whether we have any buttons |
66 // to show. | 66 // to show. |
67 void UpdateVisibility(); | 67 void UpdateVisibility(); |
68 | 68 |
69 // Hide the extension popup, if any. | 69 // Hide the extension popup, if any. |
70 void HidePopup(); | 70 void HidePopup(); |
71 | 71 |
| 72 // Returns true if this extension should be shown in this toolbar. This can |
| 73 // return false if we are in an incognito window and the extension is disabled |
| 74 // for incognito. |
| 75 bool ShouldDisplayBrowserAction(Extension* extension); |
| 76 |
72 // ExtensionToolbarModel::Observer implementation. | 77 // ExtensionToolbarModel::Observer implementation. |
73 virtual void BrowserActionAdded(Extension* extension, int index); | 78 virtual void BrowserActionAdded(Extension* extension, int index); |
74 virtual void BrowserActionRemoved(Extension* extension); | 79 virtual void BrowserActionRemoved(Extension* extension); |
75 virtual void BrowserActionMoved(Extension* extension, int index); | 80 virtual void BrowserActionMoved(Extension* extension, int index); |
76 | 81 |
77 // Called by the BrowserActionButton in response to drag-begin. | 82 // Called by the BrowserActionButton in response to drag-begin. |
78 void DragStarted(BrowserActionButton* button, GdkDragContext* drag_context); | 83 void DragStarted(BrowserActionButton* button, GdkDragContext* drag_context); |
79 | 84 |
80 static gboolean OnDragMotionThunk(GtkWidget* widget, | 85 static gboolean OnDragMotionThunk(GtkWidget* widget, |
81 GdkDragContext* drag_context, | 86 GdkDragContext* drag_context, |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
136 // a chrome button and related functionality. There should be one entry | 141 // a chrome button and related functionality. There should be one entry |
137 // for every extension that has a browser action. | 142 // for every extension that has a browser action. |
138 typedef std::map<std::string, linked_ptr<BrowserActionButton> > | 143 typedef std::map<std::string, linked_ptr<BrowserActionButton> > |
139 ExtensionButtonMap; | 144 ExtensionButtonMap; |
140 ExtensionButtonMap extension_button_map_; | 145 ExtensionButtonMap extension_button_map_; |
141 | 146 |
142 DISALLOW_COPY_AND_ASSIGN(BrowserActionsToolbarGtk); | 147 DISALLOW_COPY_AND_ASSIGN(BrowserActionsToolbarGtk); |
143 }; | 148 }; |
144 | 149 |
145 #endif // CHROME_BROWSER_GTK_BROWSER_ACTIONS_TOOLBAR_GTK_H_ | 150 #endif // CHROME_BROWSER_GTK_BROWSER_ACTIONS_TOOLBAR_GTK_H_ |
OLD | NEW |