| 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_EXTENSION_SHELF_GTK_H_ | 5 #ifndef CHROME_BROWSER_GTK_EXTENSION_SHELF_GTK_H_ |
| 6 #define CHROME_BROWSER_GTK_EXTENSION_SHELF_GTK_H_ | 6 #define CHROME_BROWSER_GTK_EXTENSION_SHELF_GTK_H_ |
| 7 | 7 |
| 8 #include <gtk/gtk.h> | 8 #include <gtk/gtk.h> |
| 9 | 9 |
| 10 #include <set> | 10 #include <set> |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 50 virtual void Observe(NotificationType type, | 50 virtual void Observe(NotificationType type, |
| 51 const NotificationSource& source, | 51 const NotificationSource& source, |
| 52 const NotificationDetails& details); | 52 const NotificationDetails& details); |
| 53 | 53 |
| 54 private: | 54 private: |
| 55 class Toolstrip; | 55 class Toolstrip; |
| 56 | 56 |
| 57 // Create the contents of the extension shelf. | 57 // Create the contents of the extension shelf. |
| 58 void Init(Profile* profile); | 58 void Init(Profile* profile); |
| 59 | 59 |
| 60 // Lazily initialize background bitmap. Can be called many times. |
| 61 void InitBackground(); |
| 62 |
| 60 // Determines what is our target height and sets it. | 63 // Determines what is our target height and sets it. |
| 61 void AdjustHeight(); | 64 void AdjustHeight(); |
| 62 | 65 |
| 63 void LoadFromModel(); | 66 void LoadFromModel(); |
| 64 | 67 |
| 65 Toolstrip* ToolstripAtIndex(int index); | 68 Toolstrip* ToolstripAtIndex(int index); |
| 66 | 69 |
| 67 // GtkHBox callbacks. | 70 // GtkHBox callbacks. |
| 68 static gboolean OnHBoxExpose(GtkWidget* widget, GdkEventExpose* event, | 71 static gboolean OnHBoxExpose(GtkWidget* widget, GdkEventExpose* event, |
| 69 ExtensionShelfGtk* window); | 72 ExtensionShelfGtk* window); |
| 70 | 73 |
| 71 Browser* browser_; | 74 Browser* browser_; |
| 72 | 75 |
| 73 // Top level event box which draws the one pixel border. | 76 // Top level event box which draws the one pixel border. |
| 74 GtkWidget* top_border_; | 77 GtkWidget* top_border_; |
| 75 | 78 |
| 76 // Contains |shelf_hbox_|. Event box exists to prevent leakage of | 79 // Contains |shelf_hbox_|. Event box exists to prevent leakage of |
| 77 // background color from the toplevel application window's GDK window. | 80 // background color from the toplevel application window's GDK window. |
| 78 OwnedWidgetGtk event_box_; | 81 OwnedWidgetGtk event_box_; |
| 79 | 82 |
| 80 // Used to position all children. | 83 // Used to position all children. |
| 81 GtkWidget* shelf_hbox_; | 84 GtkWidget* shelf_hbox_; |
| 82 | 85 |
| 86 // Lazily-initialized background for toolstrips. |
| 87 scoped_ptr<SkBitmap> background_; |
| 88 |
| 83 GtkThemeProvider* theme_provider_; | 89 GtkThemeProvider* theme_provider_; |
| 84 | 90 |
| 85 // The model representing the toolstrips on the shelf. | 91 // The model representing the toolstrips on the shelf. |
| 86 ExtensionShelfModel* model_; | 92 ExtensionShelfModel* model_; |
| 87 | 93 |
| 88 // Set of toolstrip views which are really on the shelf. | 94 // Set of toolstrip views which are really on the shelf. |
| 89 std::set<Toolstrip*> toolstrips_; | 95 std::set<Toolstrip*> toolstrips_; |
| 90 | 96 |
| 91 NotificationRegistrar registrar_; | 97 NotificationRegistrar registrar_; |
| 92 | 98 |
| 93 DISALLOW_COPY_AND_ASSIGN(ExtensionShelfGtk); | 99 DISALLOW_COPY_AND_ASSIGN(ExtensionShelfGtk); |
| 94 }; | 100 }; |
| 95 | 101 |
| 96 #endif // CHROME_BROWSER_EXTENSION_SHELF_GTK_H_ | 102 #endif // CHROME_BROWSER_EXTENSION_SHELF_GTK_H_ |
| OLD | NEW |