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

Side by Side Diff: chrome/browser/tab_contents/tab_contents_view_gtk.cc

Issue 147202: Added support for Text only zoom... (Closed) Base URL: http://src.chromium.org/svn/trunk/src/
Patch Set: '' Created 11 years, 6 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 | Annotate | Revision Log
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/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
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
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 }
OLDNEW
« no previous file with comments | « chrome/browser/tab_contents/tab_contents_delegate.h ('k') | chrome/browser/views/tab_contents/tab_contents_view_gtk.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698