Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(223)

Side by Side Diff: chrome/browser/ui/gtk/tab_contents_container_gtk.cc

Issue 9109028: GTK: Another GTK deprecation patch. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: evanm fix Created 8 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « chrome/browser/ui/gtk/rounded_window.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 147 matching lines...) Expand 10 before | Expand all | Expand 10 after
158 gtk_widget_hide(widget); 158 gtk_widget_hide(widget);
159 159
160 tab->web_contents()->WasHidden(); 160 tab->web_contents()->WasHidden();
161 } 161 }
162 162
163 void TabContentsContainerGtk::DetachTab(TabContentsWrapper* tab) { 163 void TabContentsContainerGtk::DetachTab(TabContentsWrapper* tab) {
164 gfx::NativeView widget = tab->web_contents()->GetNativeView(); 164 gfx::NativeView widget = tab->web_contents()->GetNativeView();
165 165
166 // It is possible to detach an unrealized, unparented TabContents if you 166 // It is possible to detach an unrealized, unparented TabContents if you
167 // slow things down enough in valgrind. Might happen in the real world, too. 167 // slow things down enough in valgrind. Might happen in the real world, too.
168 if (widget && widget->parent) { 168 if (widget) {
169 DCHECK_EQ(widget->parent, expanded_); 169 GtkWidget* parent = gtk_widget_get_parent(widget);
170 gtk_container_remove(GTK_CONTAINER(expanded_), widget); 170 if (parent) {
171 DCHECK_EQ(parent, expanded_);
172 gtk_container_remove(GTK_CONTAINER(expanded_), widget);
173 }
171 } 174 }
172 } 175 }
173 176
174 void TabContentsContainerGtk::Observe( 177 void TabContentsContainerGtk::Observe(
175 int type, 178 int type,
176 const content::NotificationSource& source, 179 const content::NotificationSource& source,
177 const content::NotificationDetails& details) { 180 const content::NotificationDetails& details) {
178 DCHECK(type == content::NOTIFICATION_WEB_CONTENTS_DESTROYED); 181 DCHECK(type == content::NOTIFICATION_WEB_CONTENTS_DESTROYED);
179 182
180 WebContentsDestroyed(content::Source<WebContents>(source).ptr()); 183 WebContentsDestroyed(content::Source<WebContents>(source).ptr());
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
240 g_value_set_int(&value, allocation->width - requisition.width); 243 g_value_set_int(&value, allocation->width - requisition.width);
241 gtk_container_child_set_property(GTK_CONTAINER(floating_container), 244 gtk_container_child_set_property(GTK_CONTAINER(floating_container),
242 status->widget(), "x", &value); 245 status->widget(), "x", &value);
243 246
244 int child_y = std::max(allocation->height - requisition.height, 0); 247 int child_y = std::max(allocation->height - requisition.height, 0);
245 g_value_set_int(&value, child_y + status->y_offset()); 248 g_value_set_int(&value, child_y + status->y_offset());
246 gtk_container_child_set_property(GTK_CONTAINER(floating_container), 249 gtk_container_child_set_property(GTK_CONTAINER(floating_container),
247 status->widget(), "y", &value); 250 status->widget(), "y", &value);
248 g_value_unset(&value); 251 g_value_unset(&value);
249 } 252 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/gtk/rounded_window.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698