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 #include "chrome/browser/tab_contents/tab_contents_view_gtk.h" | 5 #include "chrome/browser/tab_contents/tab_contents_view_gtk.h" |
6 | 6 |
7 #include <gdk/gdk.h> | 7 #include <gdk/gdk.h> |
8 #include <gdk/gdkkeysyms.h> | 8 #include <gdk/gdkkeysyms.h> |
9 #include <gtk/gtk.h> | 9 #include <gtk/gtk.h> |
10 | 10 |
(...skipping 380 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
391 GdkEventButton* event, TabContentsViewGtk* view) { | 391 GdkEventButton* event, TabContentsViewGtk* view) { |
392 view->last_mouse_down_ = *event; | 392 view->last_mouse_down_ = *event; |
393 return FALSE; | 393 return FALSE; |
394 } | 394 } |
395 | 395 |
396 gboolean TabContentsViewGtk::OnSizeAllocate(GtkWidget* widget, | 396 gboolean TabContentsViewGtk::OnSizeAllocate(GtkWidget* widget, |
397 GtkAllocation* allocation, | 397 GtkAllocation* allocation, |
398 TabContentsViewGtk* view) { | 398 TabContentsViewGtk* view) { |
399 int width = allocation->width; | 399 int width = allocation->width; |
400 int height = allocation->height; | 400 int height = allocation->height; |
401 view->requested_size_.set_width(width); | |
402 view->requested_size_.set_height(height); | |
403 // |delegate()| can be NULL here during browser teardown. | 401 // |delegate()| can be NULL here during browser teardown. |
404 if (view->tab_contents()->delegate()) | 402 if (view->tab_contents()->delegate()) |
405 height += view->tab_contents()->delegate()->GetExtraRenderViewHeight(); | 403 height += view->tab_contents()->delegate()->GetExtraRenderViewHeight(); |
406 gfx::Size size(width, height); | 404 gfx::Size size(width, height); |
407 view->requested_size_ = size; | 405 view->requested_size_ = size; |
408 gtk_container_foreach(GTK_CONTAINER(widget), SetSizeRequest, &size); | 406 gtk_container_foreach(GTK_CONTAINER(widget), SetSizeRequest, &size); |
409 | 407 |
410 return FALSE; | 408 return FALSE; |
411 } | 409 } |
412 | 410 |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
462 gtk_container_child_set_property(GTK_CONTAINER(floating_container), | 460 gtk_container_child_set_property(GTK_CONTAINER(floating_container), |
463 widget, "x", &value); | 461 widget, "x", &value); |
464 | 462 |
465 int child_y = std::max(half_view_height - (requisition.height / 2), 0); | 463 int child_y = std::max(half_view_height - (requisition.height / 2), 0); |
466 g_value_set_int(&value, child_y); | 464 g_value_set_int(&value, child_y); |
467 gtk_container_child_set_property(GTK_CONTAINER(floating_container), | 465 gtk_container_child_set_property(GTK_CONTAINER(floating_container), |
468 widget, "y", &value); | 466 widget, "y", &value); |
469 g_value_unset(&value); | 467 g_value_unset(&value); |
470 } | 468 } |
471 } | 469 } |
OLD | NEW |