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

Side by Side Diff: chrome/browser/views/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. Use of this 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. Use of this
2 // source code is governed by a BSD-style license that can be found in the 2 // source code is governed by a BSD-style license that can be found in the
3 // LICENSE file. 3 // LICENSE file.
4 4
5 #include "chrome/browser/views/tab_contents/tab_contents_view_gtk.h" 5 #include "chrome/browser/views/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"
11 #include "base/gfx/point.h" 11 #include "base/gfx/point.h"
12 #include "base/gfx/rect.h" 12 #include "base/gfx/rect.h"
13 #include "base/gfx/size.h" 13 #include "base/gfx/size.h"
14 #include "build/build_config.h" 14 #include "build/build_config.h"
15 #include "chrome/browser/blocked_popup_container.h" 15 #include "chrome/browser/blocked_popup_container.h"
16 #include "chrome/browser/download/download_shelf.h" 16 #include "chrome/browser/download/download_shelf.h"
17 #include "chrome/browser/renderer_host/render_view_host.h" 17 #include "chrome/browser/renderer_host/render_view_host.h"
18 #include "chrome/browser/renderer_host/render_view_host_factory.h" 18 #include "chrome/browser/renderer_host/render_view_host_factory.h"
19 #include "chrome/browser/renderer_host/render_widget_host_view_gtk.h" 19 #include "chrome/browser/renderer_host/render_widget_host_view_gtk.h"
20 #include "chrome/browser/tab_contents/interstitial_page.h" 20 #include "chrome/browser/tab_contents/interstitial_page.h"
21 #include "chrome/browser/tab_contents/tab_contents.h" 21 #include "chrome/browser/tab_contents/tab_contents.h"
22 #include "chrome/browser/tab_contents/tab_contents_delegate.h" 22 #include "chrome/browser/tab_contents/tab_contents_delegate.h"
23 #include "chrome/browser/views/sad_tab_view.h" 23 #include "chrome/browser/views/sad_tab_view.h"
24 #include "chrome/browser/views/tab_contents/render_view_context_menu_win.h" 24 #include "chrome/browser/views/tab_contents/render_view_context_menu_win.h"
25 #include "chrome/common/page_zoom.h"
25 #include "views/controls/native/native_view_host.h" 26 #include "views/controls/native/native_view_host.h"
26 #include "views/widget/root_view.h" 27 #include "views/widget/root_view.h"
27 28
28 using WebKit::WebInputEvent; 29 using WebKit::WebInputEvent;
29 30
30 31
31 namespace { 32 namespace {
32 33
33 // Called when the content view gtk widget is tabbed to, or after the call to 34 // Called when the content view gtk widget is tabbed to, or after the call to
34 // gtk_widget_child_focus() in TakeFocus(). We return true 35 // gtk_widget_child_focus() in TakeFocus(). We return true
(...skipping 29 matching lines...) Expand all
64 tab_contents->delegate()->ContentsMouseEvent(tab_contents, true); 65 tab_contents->delegate()->ContentsMouseEvent(tab_contents, true);
65 return FALSE; 66 return FALSE;
66 } 67 }
67 68
68 // See tab_contents_view_win.cc for discussion of mouse scroll zooming. 69 // See tab_contents_view_win.cc for discussion of mouse scroll zooming.
69 gboolean OnMouseScroll(GtkWidget* widget, GdkEventScroll* event, 70 gboolean OnMouseScroll(GtkWidget* widget, GdkEventScroll* event,
70 TabContents* tab_contents) { 71 TabContents* tab_contents) {
71 if ((event->state & gtk_accelerator_get_default_mod_mask()) == 72 if ((event->state & gtk_accelerator_get_default_mod_mask()) ==
72 GDK_CONTROL_MASK) { 73 GDK_CONTROL_MASK) {
73 if (event->direction == GDK_SCROLL_DOWN) { 74 if (event->direction == GDK_SCROLL_DOWN) {
74 tab_contents->delegate()->ContentsZoomChange(false); 75 tab_contents->delegate()->ContentsZoomChange(PageZoom::SMALLER);
75 return TRUE; 76 return TRUE;
76 } else if (event->direction == GDK_SCROLL_UP) { 77 } else if (event->direction == GDK_SCROLL_UP) {
77 tab_contents->delegate()->ContentsZoomChange(true); 78 tab_contents->delegate()->ContentsZoomChange(PageZoom::LARGER);
78 return TRUE; 79 return TRUE;
79 } 80 }
80 } 81 }
81 82
82 return FALSE; 83 return FALSE;
83 } 84 }
84 85
85 } // namespace 86 } // namespace
86 87
87 // static 88 // static
(...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after
316 317
317 private: 318 private:
318 DISALLOW_COPY_AND_ASSIGN(BlockedPopupContainerViewGtk); 319 DISALLOW_COPY_AND_ASSIGN(BlockedPopupContainerViewGtk);
319 }; 320 };
320 321
321 // static 322 // static
322 BlockedPopupContainerView* BlockedPopupContainerView::Create( 323 BlockedPopupContainerView* BlockedPopupContainerView::Create(
323 BlockedPopupContainer* container) { 324 BlockedPopupContainer* container) {
324 return new BlockedPopupContainerViewGtk; 325 return new BlockedPopupContainerViewGtk;
325 } 326 }
OLDNEW
« no previous file with comments | « chrome/browser/tab_contents/tab_contents_view_gtk.cc ('k') | chrome/browser/views/tab_contents/tab_contents_view_win.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698