| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 #include "chrome/browser/ui/gtk/tab_contents_container_gtk.h" | 5 #include "chrome/browser/ui/gtk/tab_contents_container_gtk.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "base/i18n/rtl.h" | 9 #include "base/i18n/rtl.h" |
| 10 #include "chrome/browser/ui/gtk/status_bubble_gtk.h" | 10 #include "chrome/browser/ui/gtk/status_bubble_gtk.h" |
| (...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 125 | 125 |
| 126 PackTab(tab_); | 126 PackTab(tab_); |
| 127 } | 127 } |
| 128 | 128 |
| 129 void TabContentsContainerGtk::PackTab(TabContentsWrapper* tab) { | 129 void TabContentsContainerGtk::PackTab(TabContentsWrapper* tab) { |
| 130 if (!tab) | 130 if (!tab) |
| 131 return; | 131 return; |
| 132 | 132 |
| 133 gfx::NativeView widget = tab->web_contents()->GetNativeView(); | 133 gfx::NativeView widget = tab->web_contents()->GetNativeView(); |
| 134 if (widget) { | 134 if (widget) { |
| 135 if (widget->parent != expanded_) | 135 if (gtk_widget_get_parent(widget) != expanded_) |
| 136 gtk_container_add(GTK_CONTAINER(expanded_), widget); | 136 gtk_container_add(GTK_CONTAINER(expanded_), widget); |
| 137 gtk_widget_show(widget); | 137 gtk_widget_show(widget); |
| 138 } | 138 } |
| 139 | 139 |
| 140 // We need to make sure that we are below the findbar. | 140 // We need to make sure that we are below the findbar. |
| 141 // Sometimes the content native view will be null. | 141 // Sometimes the content native view will be null. |
| 142 if (tab->web_contents()->GetContentNativeView()) { | 142 if (tab->web_contents()->GetContentNativeView()) { |
| 143 GdkWindow* content_gdk_window = | 143 GdkWindow* content_gdk_window = gtk_widget_get_window( |
| 144 tab->web_contents()->GetContentNativeView()->window; | 144 tab->web_contents()->GetContentNativeView()); |
| 145 if (content_gdk_window) | 145 if (content_gdk_window) |
| 146 gdk_window_lower(content_gdk_window); | 146 gdk_window_lower(content_gdk_window); |
| 147 } | 147 } |
| 148 | 148 |
| 149 tab->web_contents()->ShowContents(); | 149 tab->web_contents()->ShowContents(); |
| 150 } | 150 } |
| 151 | 151 |
| 152 void TabContentsContainerGtk::HideTab(TabContentsWrapper* tab) { | 152 void TabContentsContainerGtk::HideTab(TabContentsWrapper* tab) { |
| 153 if (!tab) | 153 if (!tab) |
| 154 return; | 154 return; |
| (...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 243 g_value_set_int(&value, allocation->width - requisition.width); | 243 g_value_set_int(&value, allocation->width - requisition.width); |
| 244 gtk_container_child_set_property(GTK_CONTAINER(floating_container), | 244 gtk_container_child_set_property(GTK_CONTAINER(floating_container), |
| 245 status->widget(), "x", &value); | 245 status->widget(), "x", &value); |
| 246 | 246 |
| 247 int child_y = std::max(allocation->height - requisition.height, 0); | 247 int child_y = std::max(allocation->height - requisition.height, 0); |
| 248 g_value_set_int(&value, child_y + status->y_offset()); | 248 g_value_set_int(&value, child_y + status->y_offset()); |
| 249 gtk_container_child_set_property(GTK_CONTAINER(floating_container), | 249 gtk_container_child_set_property(GTK_CONTAINER(floating_container), |
| 250 status->widget(), "y", &value); | 250 status->widget(), "y", &value); |
| 251 g_value_unset(&value); | 251 g_value_unset(&value); |
| 252 } | 252 } |
| OLD | NEW |