| OLD | NEW |
| 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/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 236 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 247 } | 247 } |
| 248 | 248 |
| 249 void TabContentsViewGtk::RestoreFocus() { | 249 void TabContentsViewGtk::RestoreFocus() { |
| 250 if (focus_store_.widget()) | 250 if (focus_store_.widget()) |
| 251 gtk_widget_grab_focus(focus_store_.widget()); | 251 gtk_widget_grab_focus(focus_store_.widget()); |
| 252 else | 252 else |
| 253 SetInitialFocus(); | 253 SetInitialFocus(); |
| 254 } | 254 } |
| 255 | 255 |
| 256 void TabContentsViewGtk::UpdatePreferredSize(const gfx::Size& pref_size) { | 256 void TabContentsViewGtk::UpdatePreferredSize(const gfx::Size& pref_size) { |
| 257 if (tab_contents_->delegate()) |
| 258 tab_contents_->delegate()->UpdatePreferredSize(tab_contents_, pref_size); |
| 257 } | 259 } |
| 258 | 260 |
| 259 bool TabContentsViewGtk::IsDoingDrag() const { | 261 bool TabContentsViewGtk::IsDoingDrag() const { |
| 260 return false; | 262 return false; |
| 261 } | 263 } |
| 262 | 264 |
| 263 void TabContentsViewGtk::CancelDragAndCloseTab() { | 265 void TabContentsViewGtk::CancelDragAndCloseTab() { |
| 264 } | 266 } |
| 265 | 267 |
| 266 bool TabContentsViewGtk::IsEventTracking() const { | 268 bool TabContentsViewGtk::IsEventTracking() const { |
| (...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 504 g_value_set_int(&value, child_x); | 506 g_value_set_int(&value, child_x); |
| 505 gtk_container_child_set_property(GTK_CONTAINER(floating_container), | 507 gtk_container_child_set_property(GTK_CONTAINER(floating_container), |
| 506 widget, "x", &value); | 508 widget, "x", &value); |
| 507 | 509 |
| 508 int child_y = std::max((allocation->height - requisition.height) / 2, 0); | 510 int child_y = std::max((allocation->height - requisition.height) / 2, 0); |
| 509 g_value_set_int(&value, child_y); | 511 g_value_set_int(&value, child_y); |
| 510 gtk_container_child_set_property(GTK_CONTAINER(floating_container), | 512 gtk_container_child_set_property(GTK_CONTAINER(floating_container), |
| 511 widget, "y", &value); | 513 widget, "y", &value); |
| 512 g_value_unset(&value); | 514 g_value_unset(&value); |
| 513 } | 515 } |
| OLD | NEW |