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_TAB_CONTENTS_CONTAINER_GTK_H_ | 5 #ifndef CHROME_BROWSER_GTK_TAB_CONTENTS_CONTAINER_GTK_H_ |
6 #define CHROME_BROWSER_GTK_TAB_CONTENTS_CONTAINER_GTK_H_ | 6 #define CHROME_BROWSER_GTK_TAB_CONTENTS_CONTAINER_GTK_H_ |
7 | 7 |
8 #include <gtk/gtk.h> | 8 #include <gtk/gtk.h> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
11 #include "chrome/common/notification_observer.h" | 11 #include "chrome/common/notification_observer.h" |
12 | 12 |
13 class RenderViewHost; | 13 class RenderViewHost; |
14 class TabContents; | 14 class TabContents; |
15 | 15 |
16 class TabContentsContainerGtk : public NotificationObserver { | 16 class TabContentsContainerGtk : public NotificationObserver { |
17 public: | 17 public: |
18 TabContentsContainerGtk(); | 18 TabContentsContainerGtk(); |
19 ~TabContentsContainerGtk(); | 19 ~TabContentsContainerGtk(); |
20 | 20 |
21 // Inserts our GtkWidget* hierarchy into a GtkBox managed by our owner. | 21 // Inserts our GtkWidget* hierarchy into a GtkBox managed by our owner. |
22 void AddContainerToBox(GtkWidget* widget); | 22 void AddContainerToBox(GtkWidget* widget); |
23 | 23 |
24 // Make the specified tab visible. | 24 // Make the specified tab visible. |
25 void SetTabContents(TabContents* tab_contents); | 25 void SetTabContents(TabContents* tab_contents); |
26 TabContents* GetTabContents() const { return tab_contents_; } | 26 TabContents* GetTabContents() const { return tab_contents_; } |
27 | 27 |
| 28 // Remove the tab from the hierarchy. |
| 29 void DetachTabContents(TabContents* tab_contents); |
| 30 |
28 // NotificationObserver implementation. | 31 // NotificationObserver implementation. |
29 virtual void Observe(NotificationType type, | 32 virtual void Observe(NotificationType type, |
30 const NotificationSource& source, | 33 const NotificationSource& source, |
31 const NotificationDetails& details); | 34 const NotificationDetails& details); |
32 | 35 |
33 private: | 36 private: |
34 // Add or remove observers for events that we care about. | 37 // Add or remove observers for events that we care about. |
35 void AddObservers(); | 38 void AddObservers(); |
36 void RemoveObservers(); | 39 void RemoveObservers(); |
37 | 40 |
(...skipping 12 matching lines...) Expand all Loading... |
50 | 53 |
51 // We keep a GtkVBox which is inserted into this object's owner's GtkWidget | 54 // We keep a GtkVBox which is inserted into this object's owner's GtkWidget |
52 // hierarchy. We then insert and remove TabContents GtkWidgets into this | 55 // hierarchy. We then insert and remove TabContents GtkWidgets into this |
53 // vbox_. | 56 // vbox_. |
54 GtkWidget* vbox_; | 57 GtkWidget* vbox_; |
55 | 58 |
56 DISALLOW_COPY_AND_ASSIGN(TabContentsContainerGtk); | 59 DISALLOW_COPY_AND_ASSIGN(TabContentsContainerGtk); |
57 }; | 60 }; |
58 | 61 |
59 #endif // CHROME_BROWSER_GTK_TAB_CONTENTS_CONTAINER_GTK_H_ | 62 #endif // CHROME_BROWSER_GTK_TAB_CONTENTS_CONTAINER_GTK_H_ |
OLD | NEW |