| Index: chrome/browser/tab_contents/tab_contents_view_gtk.cc
|
| ===================================================================
|
| --- chrome/browser/tab_contents/tab_contents_view_gtk.cc (revision 114056)
|
| +++ chrome/browser/tab_contents/tab_contents_view_gtk.cc (working copy)
|
| @@ -54,18 +54,22 @@
|
| // See tab_contents_view_views.cc for discussion of mouse scroll zooming.
|
| gboolean OnMouseScroll(GtkWidget* widget, GdkEventScroll* event,
|
| TabContents* tab_contents) {
|
| - if ((event->state & gtk_accelerator_get_default_mod_mask()) ==
|
| + if ((event->state & gtk_accelerator_get_default_mod_mask()) !=
|
| GDK_CONTROL_MASK) {
|
| - if (event->direction == GDK_SCROLL_DOWN) {
|
| - tab_contents->delegate()->ContentsZoomChange(false);
|
| - return TRUE;
|
| - } else if (event->direction == GDK_SCROLL_UP) {
|
| - tab_contents->delegate()->ContentsZoomChange(true);
|
| - return TRUE;
|
| - }
|
| + return FALSE;
|
| }
|
|
|
| - return FALSE;
|
| + TabContentsDelegate* delegate = tab_contents->delegate();
|
| + if (!delegate)
|
| + return FALSE;
|
| +
|
| + if (!(event->direction == GDK_SCROLL_DOWN ||
|
| + event->direction == GDK_SCROLL_UP)) {
|
| + return FALSE;
|
| + }
|
| +
|
| + delegate->ContentsZoomChange(event->direction == GDK_SCROLL_UP);
|
| + return TRUE;
|
| }
|
|
|
| } // namespace
|
|
|