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

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

Issue 246012: Fix a bug where we get an extra resize event for background tabs. (Closed)
Patch Set: Created 11 years, 2 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 | « no previous file | 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) 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 #include "chrome/browser/gtk/tab_contents_container_gtk.h" 5 #include "chrome/browser/gtk/tab_contents_container_gtk.h"
6 6
7 #include "app/l10n_util.h" 7 #include "app/l10n_util.h"
8 #include "base/gfx/native_widget_types.h" 8 #include "base/gfx/native_widget_types.h"
9 #include "chrome/browser/gtk/gtk_floating_container.h" 9 #include "chrome/browser/gtk/gtk_floating_container.h"
10 #include "chrome/browser/gtk/status_bubble_gtk.h" 10 #include "chrome/browser/gtk/status_bubble_gtk.h"
11 #include "chrome/browser/tab_contents/tab_contents.h" 11 #include "chrome/browser/tab_contents/tab_contents.h"
12 #include "chrome/browser/renderer_host/render_widget_host_view_gtk.h" 12 #include "chrome/browser/renderer_host/render_widget_host_view_gtk.h"
13 #include "chrome/common/notification_service.h" 13 #include "chrome/common/notification_service.h"
14 14
15 namespace { 15 namespace {
16 16
17 // Allocates all normal tab contents views to the size of the passed in 17 // Allocates all normal tab contents views to the size of the passed in
18 // |allocation|. 18 // |allocation|.
19 void ResizeChildren(GtkWidget* widget, void* param) { 19 void ResizeChildren(GtkWidget* widget, void* param) {
20 GtkAllocation* allocation = reinterpret_cast<GtkAllocation*>(param); 20 GtkAllocation* allocation = reinterpret_cast<GtkAllocation*>(param);
21 if (!GTK_WIDGET_VISIBLE(widget))
22 return;
21 23
22 if (widget->allocation.width != allocation->width || 24 if (widget->allocation.width != allocation->width ||
23 widget->allocation.height != allocation->height) { 25 widget->allocation.height != allocation->height) {
24 gtk_widget_set_size_request(widget, allocation->width, 26 gtk_widget_set_size_request(widget, allocation->width,
25 allocation->height); 27 allocation->height);
26 } 28 }
27 } 29 }
28 30
29 } // namespace 31 } // namespace
30 32
(...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after
202 gtk_container_child_set_property(GTK_CONTAINER(floating_container), 204 gtk_container_child_set_property(GTK_CONTAINER(floating_container),
203 status, "x", &value); 205 status, "x", &value);
204 206
205 int child_y = std::max( 207 int child_y = std::max(
206 allocation->y + allocation->height - requisition.height, 0); 208 allocation->y + allocation->height - requisition.height, 0);
207 g_value_set_int(&value, child_y); 209 g_value_set_int(&value, child_y);
208 gtk_container_child_set_property(GTK_CONTAINER(floating_container), 210 gtk_container_child_set_property(GTK_CONTAINER(floating_container),
209 status, "y", &value); 211 status, "y", &value);
210 g_value_unset(&value); 212 g_value_unset(&value);
211 } 213 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698