| 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_registrar.h" | 11 #include "chrome/common/notification_registrar.h" |
| 12 #include "chrome/common/owned_widget_gtk.h" | 12 #include "chrome/common/owned_widget_gtk.h" |
| 13 | 13 |
| 14 class RenderViewHost; | 14 class RenderViewHost; |
| 15 class StatusBubbleGtk; | 15 class StatusBubbleGtk; |
| 16 class TabContents; | 16 class TabContents; |
| 17 | 17 |
| 18 typedef struct _GtkFloatingContainer GtkFloatingContainer; | 18 typedef struct _GtkFloatingContainer GtkFloatingContainer; |
| 19 | 19 |
| 20 class TabContentsContainerGtk : public NotificationObserver { | 20 class TabContentsContainerGtk : public NotificationObserver { |
| 21 public: | 21 public: |
| 22 explicit TabContentsContainerGtk(StatusBubbleGtk* status_bubble); | 22 explicit TabContentsContainerGtk(StatusBubbleGtk* status_bubble); |
| 23 ~TabContentsContainerGtk(); | 23 ~TabContentsContainerGtk(); |
| 24 | 24 |
| 25 void Init(); | 25 void Init(); |
| 26 | 26 |
| 27 // Inserts our GtkWidget* hierarchy into a GtkBox managed by our owner. | |
| 28 void AddContainerToBox(GtkWidget* widget); | |
| 29 | |
| 30 // Make the specified tab visible. | 27 // Make the specified tab visible. |
| 31 void SetTabContents(TabContents* tab_contents); | 28 void SetTabContents(TabContents* tab_contents); |
| 32 TabContents* GetTabContents() const { return tab_contents_; } | 29 TabContents* GetTabContents() const { return tab_contents_; } |
| 33 | 30 |
| 34 // Remove the tab from the hierarchy. | 31 // Remove the tab from the hierarchy. |
| 35 void DetachTabContents(TabContents* tab_contents); | 32 void DetachTabContents(TabContents* tab_contents); |
| 36 | 33 |
| 37 // NotificationObserver implementation. | 34 // NotificationObserver implementation. |
| 38 virtual void Observe(NotificationType type, | 35 virtual void Observe(NotificationType type, |
| 39 const NotificationSource& source, | 36 const NotificationSource& source, |
| 40 const NotificationDetails& details); | 37 const NotificationDetails& details); |
| 41 | 38 |
| 39 GtkWidget* widget() { return floating_.get(); } |
| 40 |
| 42 private: | 41 private: |
| 43 // Add or remove observers for events that we care about. | 42 // Add or remove observers for events that we care about. |
| 44 void AddObservers(); | 43 void AddObservers(); |
| 45 void RemoveObservers(); | 44 void RemoveObservers(); |
| 46 | 45 |
| 47 // Called when the RenderViewHost of the hosted TabContents has changed, e.g. | 46 // Called when the RenderViewHost of the hosted TabContents has changed, e.g. |
| 48 // to show an interstitial page. | 47 // to show an interstitial page. |
| 49 void RenderViewHostChanged(RenderViewHost* old_host, | 48 void RenderViewHostChanged(RenderViewHost* old_host, |
| 50 RenderViewHost* new_host); | 49 RenderViewHost* new_host); |
| 51 | 50 |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 86 // We insert and remove TabContents GtkWidgets into this fixed_. This should | 85 // We insert and remove TabContents GtkWidgets into this fixed_. This should |
| 87 // not be a GtkVBox since there were errors with timing where the vbox was | 86 // not be a GtkVBox since there were errors with timing where the vbox was |
| 88 // horizontally split with the top half displaying the current TabContents | 87 // horizontally split with the top half displaying the current TabContents |
| 89 // and bottom half displaying the loading page. | 88 // and bottom half displaying the loading page. |
| 90 GtkWidget* fixed_; | 89 GtkWidget* fixed_; |
| 91 | 90 |
| 92 DISALLOW_COPY_AND_ASSIGN(TabContentsContainerGtk); | 91 DISALLOW_COPY_AND_ASSIGN(TabContentsContainerGtk); |
| 93 }; | 92 }; |
| 94 | 93 |
| 95 #endif // CHROME_BROWSER_GTK_TAB_CONTENTS_CONTAINER_GTK_H_ | 94 #endif // CHROME_BROWSER_GTK_TAB_CONTENTS_CONTAINER_GTK_H_ |
| OLD | NEW |