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

Side by Side Diff: android_webview/lib/main/aw_main_delegate.cc

Issue 1281553004: Disable tap suppression logic for WebView (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2454
Patch Set: Created 5 years, 4 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
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "android_webview/lib/main/aw_main_delegate.h" 5 #include "android_webview/lib/main/aw_main_delegate.h"
6 6
7 #include "android_webview/browser/aw_content_browser_client.h" 7 #include "android_webview/browser/aw_content_browser_client.h"
8 #include "android_webview/browser/browser_view_renderer.h" 8 #include "android_webview/browser/browser_view_renderer.h"
9 #include "android_webview/browser/scoped_allow_wait_for_legacy_web_view_api.h" 9 #include "android_webview/browser/scoped_allow_wait_for_legacy_web_view_api.h"
10 #include "android_webview/crash_reporter/aw_microdump_crash_reporter.h" 10 #include "android_webview/crash_reporter/aw_microdump_crash_reporter.h"
(...skipping 16 matching lines...) Expand all
27 #include "components/external_video_surface/browser/android/external_video_surfa ce_container_impl.h" 27 #include "components/external_video_surface/browser/android/external_video_surfa ce_container_impl.h"
28 #include "content/public/browser/android/browser_media_player_manager_register.h " 28 #include "content/public/browser/android/browser_media_player_manager_register.h "
29 #include "content/public/browser/browser_main_runner.h" 29 #include "content/public/browser/browser_main_runner.h"
30 #include "content/public/browser/browser_thread.h" 30 #include "content/public/browser/browser_thread.h"
31 #include "content/public/common/content_descriptors.h" 31 #include "content/public/common/content_descriptors.h"
32 #include "content/public/common/content_switches.h" 32 #include "content/public/common/content_switches.h"
33 #include "gin/public/isolate_holder.h" 33 #include "gin/public/isolate_holder.h"
34 #include "gpu/command_buffer/client/gl_in_process_context.h" 34 #include "gpu/command_buffer/client/gl_in_process_context.h"
35 #include "gpu/command_buffer/service/gpu_switches.h" 35 #include "gpu/command_buffer/service/gpu_switches.h"
36 #include "media/base/media_switches.h" 36 #include "media/base/media_switches.h"
37 #include "ui/events/gesture_detection/gesture_configuration.h"
37 38
38 namespace android_webview { 39 namespace android_webview {
39 40
40 namespace { 41 namespace {
41 42
42 // TODO(boliu): Remove this global Allow once the underlying issues are 43 // TODO(boliu): Remove this global Allow once the underlying issues are
43 // resolved - http://crbug.com/240453. See AwMainDelegate::RunProcess below. 44 // resolved - http://crbug.com/240453. See AwMainDelegate::RunProcess below.
44 base::LazyInstance<scoped_ptr<ScopedAllowWaitForLegacyWebViewApi> > 45 base::LazyInstance<scoped_ptr<ScopedAllowWaitForLegacyWebViewApi> >
45 g_allow_wait_in_ui_thread = LAZY_INSTANCE_INITIALIZER; 46 g_allow_wait_in_ui_thread = LAZY_INSTANCE_INITIALIZER;
46 47
47 } 48 }
48 49
49 AwMainDelegate::AwMainDelegate() { 50 AwMainDelegate::AwMainDelegate() {
50 } 51 }
51 52
52 AwMainDelegate::~AwMainDelegate() { 53 AwMainDelegate::~AwMainDelegate() {
53 } 54 }
54 55
55 bool AwMainDelegate::BasicStartupComplete(int* exit_code) { 56 bool AwMainDelegate::BasicStartupComplete(int* exit_code) {
56 content::SetContentClient(&content_client_); 57 content::SetContentClient(&content_client_);
57 58
58 content::RegisterMediaUrlInterceptor(new AwMediaUrlInterceptor()); 59 content::RegisterMediaUrlInterceptor(new AwMediaUrlInterceptor());
59 60
60 BrowserViewRenderer::CalculateTileMemoryPolicy(); 61 BrowserViewRenderer::CalculateTileMemoryPolicy();
61 62
63 // WebView apps can override WebView#computeScroll to achieve custom
64 // scroll/fling. As a result, fling animations may not be ticked, potentially
65 // confusing the tap suppression controller. Simply disable it for WebView.
66 ui::GestureConfiguration::GetInstance()
67 ->set_fling_touchscreen_tap_suppression_enabled(false);
68
62 base::CommandLine* cl = base::CommandLine::ForCurrentProcess(); 69 base::CommandLine* cl = base::CommandLine::ForCurrentProcess();
63 cl->AppendSwitch(cc::switches::kEnableBeginFrameScheduling); 70 cl->AppendSwitch(cc::switches::kEnableBeginFrameScheduling);
64 71
65 // WebView uses the Android system's scrollbars and overscroll glow. 72 // WebView uses the Android system's scrollbars and overscroll glow.
66 cl->AppendSwitch(switches::kDisableOverscrollEdgeEffect); 73 cl->AppendSwitch(switches::kDisableOverscrollEdgeEffect);
67 74
68 // Pull-to-refresh should never be a default WebView action. 75 // Pull-to-refresh should never be a default WebView action.
69 cl->AppendSwitch(switches::kDisablePullToRefreshEffect); 76 cl->AppendSwitch(switches::kDisablePullToRefreshEffect);
70 77
71 // Not yet supported in single-process mode. 78 // Not yet supported in single-process mode.
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after
200 #if defined(VIDEO_HOLE) 207 #if defined(VIDEO_HOLE)
201 content::ExternalVideoSurfaceContainer* 208 content::ExternalVideoSurfaceContainer*
202 AwMainDelegate::CreateExternalVideoSurfaceContainer( 209 AwMainDelegate::CreateExternalVideoSurfaceContainer(
203 content::WebContents* web_contents) { 210 content::WebContents* web_contents) {
204 return external_video_surface::ExternalVideoSurfaceContainerImpl::Create( 211 return external_video_surface::ExternalVideoSurfaceContainerImpl::Create(
205 web_contents); 212 web_contents);
206 } 213 }
207 #endif 214 #endif
208 215
209 } // namespace android_webview 216 } // namespace android_webview
OLDNEW
« no previous file with comments | « android_webview/lib/DEPS ('k') | content/browser/renderer_host/input/input_router_config_helper.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698