| 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 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 104 | 104 |
| 105 void TabContentsContainerGtk::RemovePreview() { | 105 void TabContentsContainerGtk::RemovePreview() { |
| 106 if (!preview_) | 106 if (!preview_) |
| 107 return; | 107 return; |
| 108 | 108 |
| 109 HideTab(preview_); | 109 HideTab(preview_); |
| 110 | 110 |
| 111 GtkWidget* preview_widget = preview_->web_contents()->GetNativeView(); | 111 GtkWidget* preview_widget = preview_->web_contents()->GetNativeView(); |
| 112 if (preview_widget) | 112 if (preview_widget) |
| 113 gtk_container_remove(GTK_CONTAINER(expanded_), preview_widget); | 113 gtk_container_remove(GTK_CONTAINER(expanded_), preview_widget); |
| 114 | |
| 115 registrar_.Remove(this, chrome::NOTIFICATION_TAB_CONTENTS_DESTROYED, | 114 registrar_.Remove(this, chrome::NOTIFICATION_TAB_CONTENTS_DESTROYED, |
| 116 content::Source<TabContents>(preview_)); | 115 content::Source<TabContents>(preview_)); |
| 117 preview_ = NULL; | 116 preview_ = NULL; |
| 118 } | 117 } |
| 119 | 118 |
| 120 void TabContentsContainerGtk::PopPreview() { | 119 void TabContentsContainerGtk::PopPreview() { |
| 121 if (!preview_) | 120 if (!preview_) |
| 122 return; | 121 return; |
| 123 | 122 |
| 124 RemovePreview(); | 123 RemovePreview(); |
| (...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 241 g_value_set_int(&value, allocation->width - requisition.width); | 240 g_value_set_int(&value, allocation->width - requisition.width); |
| 242 gtk_container_child_set_property(GTK_CONTAINER(floating_container), | 241 gtk_container_child_set_property(GTK_CONTAINER(floating_container), |
| 243 status->widget(), "x", &value); | 242 status->widget(), "x", &value); |
| 244 | 243 |
| 245 int child_y = std::max(allocation->height - requisition.height, 0); | 244 int child_y = std::max(allocation->height - requisition.height, 0); |
| 246 g_value_set_int(&value, child_y + status->y_offset()); | 245 g_value_set_int(&value, child_y + status->y_offset()); |
| 247 gtk_container_child_set_property(GTK_CONTAINER(floating_container), | 246 gtk_container_child_set_property(GTK_CONTAINER(floating_container), |
| 248 status->widget(), "y", &value); | 247 status->widget(), "y", &value); |
| 249 g_value_unset(&value); | 248 g_value_unset(&value); |
| 250 } | 249 } |
| OLD | NEW |