| 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 <gtk/gtk.h> | 8 #include <gtk/gtk.h> |
| 9 | 9 |
| 10 #include "base/string_util.h" | 10 #include "base/string_util.h" |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 69 tab_contents->delegate()->ContentsMouseEvent(tab_contents, true); | 69 tab_contents->delegate()->ContentsMouseEvent(tab_contents, true); |
| 70 return FALSE; | 70 return FALSE; |
| 71 } | 71 } |
| 72 | 72 |
| 73 // See tab_contents_view_win.cc for discussion of mouse scroll zooming. | 73 // See tab_contents_view_win.cc for discussion of mouse scroll zooming. |
| 74 gboolean OnMouseScroll(GtkWidget* widget, GdkEventScroll* event, | 74 gboolean OnMouseScroll(GtkWidget* widget, GdkEventScroll* event, |
| 75 TabContents* tab_contents) { | 75 TabContents* tab_contents) { |
| 76 if ((event->state & gtk_accelerator_get_default_mod_mask()) == | 76 if ((event->state & gtk_accelerator_get_default_mod_mask()) == |
| 77 GDK_CONTROL_MASK) { | 77 GDK_CONTROL_MASK) { |
| 78 if (event->direction == GDK_SCROLL_DOWN) { | 78 if (event->direction == GDK_SCROLL_DOWN) { |
| 79 tab_contents->delegate()->ContentsZoomChange(false); | 79 tab_contents->delegate()->ContentsZoomChange(PageZoom::SMALLER); |
| 80 return TRUE; | 80 return TRUE; |
| 81 } else if (event->direction == GDK_SCROLL_UP) { | 81 } else if (event->direction == GDK_SCROLL_UP) { |
| 82 tab_contents->delegate()->ContentsZoomChange(true); | 82 tab_contents->delegate()->ContentsZoomChange(PageZoom::LARGER); |
| 83 return TRUE; | 83 return TRUE; |
| 84 } | 84 } |
| 85 } | 85 } |
| 86 | 86 |
| 87 return FALSE; | 87 return FALSE; |
| 88 } | 88 } |
| 89 | 89 |
| 90 // Used with gtk_container_foreach to change the sizes of the children of | 90 // Used with gtk_container_foreach to change the sizes of the children of |
| 91 // |fixed_|. | 91 // |fixed_|. |
| 92 void SetSizeRequest(GtkWidget* widget, gpointer userdata) { | 92 void SetSizeRequest(GtkWidget* widget, gpointer userdata) { |
| (...skipping 333 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 426 gtk_container_child_set_property(GTK_CONTAINER(floating_container), | 426 gtk_container_child_set_property(GTK_CONTAINER(floating_container), |
| 427 widget, "x", &value); | 427 widget, "x", &value); |
| 428 | 428 |
| 429 int child_y = std::max(half_view_height - (requisition.height / 2), 0); | 429 int child_y = std::max(half_view_height - (requisition.height / 2), 0); |
| 430 g_value_set_int(&value, child_y); | 430 g_value_set_int(&value, child_y); |
| 431 gtk_container_child_set_property(GTK_CONTAINER(floating_container), | 431 gtk_container_child_set_property(GTK_CONTAINER(floating_container), |
| 432 widget, "y", &value); | 432 widget, "y", &value); |
| 433 g_value_unset(&value); | 433 g_value_unset(&value); |
| 434 } | 434 } |
| 435 } | 435 } |
| OLD | NEW |