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

Side by Side Diff: content/browser/frame_host/render_widget_host_view_guest.cc

Issue 148083009: Enable pinch-to-zoom on Windows 8 by default (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 10 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
« no previous file with comments | « chrome/browser/chrome_content_browser_client.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "base/bind_helpers.h" 5 #include "base/bind_helpers.h"
6 #include "base/command_line.h" 6 #include "base/command_line.h"
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/message_loop/message_loop.h" 8 #include "base/message_loop/message_loop.h"
9 #include "content/browser/browser_plugin/browser_plugin_guest.h" 9 #include "content/browser/browser_plugin/browser_plugin_guest.h"
10 #include "content/browser/frame_host/render_widget_host_view_guest.h" 10 #include "content/browser/frame_host/render_widget_host_view_guest.h"
11 #include "content/browser/renderer_host/render_view_host_impl.h" 11 #include "content/browser/renderer_host/render_view_host_impl.h"
12 #include "content/common/browser_plugin/browser_plugin_messages.h" 12 #include "content/common/browser_plugin/browser_plugin_messages.h"
13 #include "content/common/frame_messages.h" 13 #include "content/common/frame_messages.h"
14 #include "content/common/gpu/gpu_messages.h" 14 #include "content/common/gpu/gpu_messages.h"
15 #include "content/common/view_messages.h" 15 #include "content/common/view_messages.h"
16 #include "content/common/webplugin_geometry.h" 16 #include "content/common/webplugin_geometry.h"
17 #include "content/public/common/content_switches.h" 17 #include "content/public/common/content_switches.h"
18 #include "skia/ext/platform_canvas.h" 18 #include "skia/ext/platform_canvas.h"
19 #include "third_party/WebKit/public/platform/WebScreenInfo.h" 19 #include "third_party/WebKit/public/platform/WebScreenInfo.h"
20 20
21 #if defined(OS_MACOSX) 21 #if defined(OS_MACOSX)
22 #import "content/browser/renderer_host/render_widget_host_view_mac_dictionary_he lper.h" 22 #import "content/browser/renderer_host/render_widget_host_view_mac_dictionary_he lper.h"
23 #endif 23 #endif
24 24
25 #if defined(OS_WIN)
26 #include "base/win/windows_version.h"
27 #endif
28
25 #if defined(OS_WIN) || defined(USE_AURA) 29 #if defined(OS_WIN) || defined(USE_AURA)
26 #include "content/browser/renderer_host/ui_events_helper.h" 30 #include "content/browser/renderer_host/ui_events_helper.h"
27 #endif 31 #endif
28 32
29 namespace content { 33 namespace content {
30 34
31 namespace { 35 namespace {
32 36
33 #if defined(OS_WIN) || defined(USE_AURA) 37 #if defined(OS_WIN) || defined(USE_AURA)
34 bool ShouldSendPinchGesture() { 38 bool ShouldSendPinchGesture() {
39 #if defined(OS_WIN)
40 if (base::win::GetVersion() >= base::win::VERSION_WIN8)
41 return true;
42 #endif
35 static bool pinch_allowed = 43 static bool pinch_allowed =
44 CommandLine::ForCurrentProcess()->HasSwitch(switches::kEnableViewport) ||
36 CommandLine::ForCurrentProcess()->HasSwitch(switches::kEnablePinch); 45 CommandLine::ForCurrentProcess()->HasSwitch(switches::kEnablePinch);
37 return pinch_allowed; 46 return pinch_allowed;
38 } 47 }
39 48
40 blink::WebGestureEvent CreateFlingCancelEvent(double time_stamp) { 49 blink::WebGestureEvent CreateFlingCancelEvent(double time_stamp) {
41 blink::WebGestureEvent gesture_event; 50 blink::WebGestureEvent gesture_event;
42 gesture_event.timeStampSeconds = time_stamp; 51 gesture_event.timeStampSeconds = time_stamp;
43 gesture_event.type = blink::WebGestureEvent::GestureFlingCancel; 52 gesture_event.type = blink::WebGestureEvent::GestureFlingCancel;
44 gesture_event.sourceDevice = blink::WebGestureEvent::Touchscreen; 53 gesture_event.sourceDevice = blink::WebGestureEvent::Touchscreen;
45 return gesture_event; 54 return gesture_event;
(...skipping 500 matching lines...) Expand 10 before | Expand all | Expand 10 after
546 return; 555 return;
547 for (ui::GestureRecognizer::Gestures::iterator g_it = gestures->begin(); 556 for (ui::GestureRecognizer::Gestures::iterator g_it = gestures->begin();
548 g_it != gestures->end(); 557 g_it != gestures->end();
549 ++g_it) { 558 ++g_it) {
550 ForwardGestureEventToRenderer(*g_it); 559 ForwardGestureEventToRenderer(*g_it);
551 } 560 }
552 } 561 }
553 562
554 563
555 } // namespace content 564 } // namespace content
OLDNEW
« no previous file with comments | « chrome/browser/chrome_content_browser_client.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698