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 #include "chrome/browser/gtk/browser_actions_toolbar_gtk.h" | 5 #include "chrome/browser/gtk/browser_actions_toolbar_gtk.h" |
6 | 6 |
7 #include <gtk/gtk.h> | 7 #include <gtk/gtk.h> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "app/gfx/canvas_paint.h" | 10 #include "app/gfx/canvas_paint.h" |
(...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
189 // Loads the button's icons for us on the file thread. | 189 // Loads the button's icons for us on the file thread. |
190 ImageLoadingTracker* tracker_; | 190 ImageLoadingTracker* tracker_; |
191 | 191 |
192 // If we are displaying a tab-specific icon, it will be here. | 192 // If we are displaying a tab-specific icon, it will be here. |
193 GdkPixbuf* tab_specific_icon_; | 193 GdkPixbuf* tab_specific_icon_; |
194 | 194 |
195 // If the browser action has a default icon, it will be here. | 195 // If the browser action has a default icon, it will be here. |
196 GdkPixbuf* default_icon_; | 196 GdkPixbuf* default_icon_; |
197 | 197 |
198 NotificationRegistrar registrar_; | 198 NotificationRegistrar registrar_; |
| 199 |
| 200 friend class BrowserActionsToolbarGtk; |
199 }; | 201 }; |
200 | 202 |
201 BrowserActionsToolbarGtk::BrowserActionsToolbarGtk(Browser* browser) | 203 BrowserActionsToolbarGtk::BrowserActionsToolbarGtk(Browser* browser) |
202 : browser_(browser), | 204 : browser_(browser), |
203 profile_(browser->profile()), | 205 profile_(browser->profile()), |
204 hbox_(gtk_hbox_new(FALSE, kBrowserActionButtonPadding)) { | 206 hbox_(gtk_hbox_new(FALSE, kBrowserActionButtonPadding)) { |
205 registrar_.Add(this, NotificationType::EXTENSION_LOADED, | 207 registrar_.Add(this, NotificationType::EXTENSION_LOADED, |
206 Source<Profile>(profile_)); | 208 Source<Profile>(profile_)); |
207 registrar_.Add(this, NotificationType::EXTENSION_UNLOADED, | 209 registrar_.Add(this, NotificationType::EXTENSION_UNLOADED, |
208 Source<Profile>(profile_)); | 210 Source<Profile>(profile_)); |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
277 if (extension_button_map_.erase(extension->id())) | 279 if (extension_button_map_.erase(extension->id())) |
278 UpdateVisibility(); | 280 UpdateVisibility(); |
279 } | 281 } |
280 | 282 |
281 void BrowserActionsToolbarGtk::UpdateVisibility() { | 283 void BrowserActionsToolbarGtk::UpdateVisibility() { |
282 if (button_count() == 0) | 284 if (button_count() == 0) |
283 gtk_widget_hide(widget()); | 285 gtk_widget_hide(widget()); |
284 else | 286 else |
285 gtk_widget_show(widget()); | 287 gtk_widget_show(widget()); |
286 } | 288 } |
OLD | NEW |