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