Commit 54b7fdb5 authored by thestig@chromium.org's avatar thestig@chromium.org

Print preview: Prevent a crash when zooming with the scroll wheel.

BUG=107222
TEST=see bug

Review URL: http://codereview.chromium.org/8918022

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@114550 0039d316-1c4b-4281-b951-d872f2087c98
parent 358d8e8b
......@@ -54,18 +54,22 @@ gboolean OnMouseMove(GtkWidget* widget, GdkEventMotion* event,
// 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
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment