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" |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
51 // 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. |
52 // to show an interstitial page. | 52 // to show an interstitial page. |
53 void RenderViewHostChanged(RenderViewHost* old_host, | 53 void RenderViewHostChanged(RenderViewHost* old_host, |
54 RenderViewHost* new_host); | 54 RenderViewHost* new_host); |
55 | 55 |
56 // Called when a TabContents is destroyed. This gives us a chance to clean | 56 // Called when a TabContents is destroyed. This gives us a chance to clean |
57 // up our internal state if the TabContents is somehow destroyed before we | 57 // up our internal state if the TabContents is somehow destroyed before we |
58 // get notified. | 58 // get notified. |
59 void TabContentsDestroyed(TabContents* contents); | 59 void TabContentsDestroyed(TabContents* contents); |
60 | 60 |
| 61 // Implements our hack around a GtkFixed. The entire size of the GtkFixed is |
| 62 // allocated to normal tab contents views, while the status bubble is |
| 63 // informed of its parent and its parent's allocation (it makes a decision |
| 64 // about layout later.) |
| 65 static void OnFixedSizeAllocate( |
| 66 GtkWidget* fixed, |
| 67 GtkAllocation* allocation, |
| 68 TabContentsContainerGtk* container); |
| 69 |
61 // Handler for |floating_|'s "set-floating-position" signal. During this | 70 // Handler for |floating_|'s "set-floating-position" signal. During this |
62 // callback, we manually set the position of the status bubble. | 71 // callback, we manually set the position of the status bubble. |
63 static void OnSetFloatingPosition( | 72 static void OnSetFloatingPosition( |
64 GtkFloatingContainer* container, GtkAllocation* allocation, | 73 GtkFloatingContainer* container, GtkAllocation* allocation, |
65 TabContentsContainerGtk* tab_contents_container); | 74 TabContentsContainerGtk* tab_contents_container); |
66 | 75 |
67 NotificationRegistrar registrar_; | 76 NotificationRegistrar registrar_; |
68 | 77 |
69 // The currently visible TabContents. | 78 // The currently visible TabContents. |
70 TabContents* tab_contents_; | 79 TabContents* tab_contents_; |
71 | 80 |
72 // The status bubble manager. Always non-NULL. | 81 // The status bubble manager. Always non-NULL. |
73 StatusBubbleGtk* status_bubble_; | 82 StatusBubbleGtk* status_bubble_; |
74 | 83 |
75 // Top of the TabContentsContainerGtk widget hierarchy. A cross between a | 84 // Top of the TabContentsContainerGtk widget hierarchy. A cross between a |
76 // GtkBin and a GtkFixed, |floating_| has |fixed_| as its one "real" child, | 85 // GtkBin and a GtkFixed, |floating_| has |fixed_| as its one "real" child, |
77 // and the various things that hang off the bottom (status bubble, etc) have | 86 // and the various things that hang off the bottom (status bubble, etc) have |
78 // their positions manually set in OnSetFloatingPosition. | 87 // their positions manually set in OnSetFloatingPosition. |
79 OwnedWidgetGtk floating_; | 88 OwnedWidgetGtk floating_; |
80 | 89 |
81 // We insert TabContentsViewGtks into this container_. We only show one | 90 // We insert and remove TabContents GtkWidgets into this fixed_. This should |
82 // TabVontentsViewGtk at a time, so we can use a vbox or an hbox. | 91 // not be a GtkVBox since there were errors with timing where the vbox was |
83 GtkWidget* container_; | 92 // horizontally split with the top half displaying the current TabContents |
| 93 // and bottom half displaying the loading page. |
| 94 GtkWidget* fixed_; |
84 | 95 |
85 DISALLOW_COPY_AND_ASSIGN(TabContentsContainerGtk); | 96 DISALLOW_COPY_AND_ASSIGN(TabContentsContainerGtk); |
86 }; | 97 }; |
87 | 98 |
88 #endif // CHROME_BROWSER_GTK_TAB_CONTENTS_CONTAINER_GTK_H_ | 99 #endif // CHROME_BROWSER_GTK_TAB_CONTENTS_CONTAINER_GTK_H_ |
OLD | NEW |