Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 <memory> | 7 #include <memory> |
| 8 | 8 |
| 9 #include "android_webview/browser/aw_content_browser_client.h" | 9 #include "android_webview/browser/aw_content_browser_client.h" |
| 10 #include "android_webview/browser/browser_view_renderer.h" | 10 #include "android_webview/browser/browser_view_renderer.h" |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 59 | 59 |
| 60 AwMainDelegate::~AwMainDelegate() { | 60 AwMainDelegate::~AwMainDelegate() { |
| 61 } | 61 } |
| 62 | 62 |
| 63 bool AwMainDelegate::BasicStartupComplete(int* exit_code) { | 63 bool AwMainDelegate::BasicStartupComplete(int* exit_code) { |
| 64 content::SetContentClient(&content_client_); | 64 content::SetContentClient(&content_client_); |
| 65 | 65 |
| 66 content::RegisterMediaUrlInterceptor(new AwMediaUrlInterceptor()); | 66 content::RegisterMediaUrlInterceptor(new AwMediaUrlInterceptor()); |
| 67 | 67 |
| 68 BrowserViewRenderer::CalculateTileMemoryPolicy(); | 68 BrowserViewRenderer::CalculateTileMemoryPolicy(); |
| 69 | 69 const base::CommandLine& command_line = |
| 70 // WebView apps can override WebView#computeScroll to achieve custom | 70 *base::CommandLine::ForCurrentProcess(); |
|
boliu
2016/08/25 02:45:52
don't create another instance, re-use cl* pointer
sgurun-gerrit only
2016/08/25 15:04:48
Done.
| |
| 71 // scroll/fling. As a result, fling animations may not be ticked, potentially | 71 std::string process_type = |
| 72 // confusing the tap suppression controller. Simply disable it for WebView. | 72 command_line.GetSwitchValueASCII(switches::kProcessType); |
| 73 ui::GestureConfiguration::GetInstance() | 73 if (process_type != switches::kRendererProcess) { |
|
boliu
2016/08/25 02:45:52
you can also exclude RegisterMediaUrlInterceptor a
sgurun-gerrit only
2016/08/25 15:04:48
Done.
| |
| 74 ->set_fling_touchscreen_tap_suppression_enabled(false); | 74 // WebView apps can override WebView#computeScroll to achieve custom |
| 75 | 75 // scroll/fling. As a result, fling animations may not be ticked, |
| 76 // potentially | |
| 77 // confusing the tap suppression controller. Simply disable it for WebView | |
| 78 ui::GestureConfiguration::GetInstance() | |
| 79 ->set_fling_touchscreen_tap_suppression_enabled(false); | |
| 80 } | |
| 76 base::CommandLine* cl = base::CommandLine::ForCurrentProcess(); | 81 base::CommandLine* cl = base::CommandLine::ForCurrentProcess(); |
| 77 cl->AppendSwitch(cc::switches::kEnableBeginFrameScheduling); | 82 cl->AppendSwitch(cc::switches::kEnableBeginFrameScheduling); |
| 78 | 83 |
| 79 // WebView uses the Android system's scrollbars and overscroll glow. | 84 // WebView uses the Android system's scrollbars and overscroll glow. |
| 80 cl->AppendSwitch(switches::kDisableOverscrollEdgeEffect); | 85 cl->AppendSwitch(switches::kDisableOverscrollEdgeEffect); |
| 81 | 86 |
| 82 // Pull-to-refresh should never be a default WebView action. | 87 // Pull-to-refresh should never be a default WebView action. |
| 83 cl->AppendSwitch(switches::kDisablePullToRefreshEffect); | 88 cl->AppendSwitch(switches::kDisablePullToRefreshEffect); |
| 84 | 89 |
| 85 // Not yet supported in single-process mode. | 90 // Not yet supported in single-process mode. |
| (...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 259 #if defined(VIDEO_HOLE) | 264 #if defined(VIDEO_HOLE) |
| 260 content::ExternalVideoSurfaceContainer* | 265 content::ExternalVideoSurfaceContainer* |
| 261 AwMainDelegate::CreateExternalVideoSurfaceContainer( | 266 AwMainDelegate::CreateExternalVideoSurfaceContainer( |
| 262 content::WebContents* web_contents) { | 267 content::WebContents* web_contents) { |
| 263 return external_video_surface::ExternalVideoSurfaceContainerImpl::Create( | 268 return external_video_surface::ExternalVideoSurfaceContainerImpl::Create( |
| 264 web_contents); | 269 web_contents); |
| 265 } | 270 } |
| 266 #endif | 271 #endif |
| 267 | 272 |
| 268 } // namespace android_webview | 273 } // namespace android_webview |
| OLD | NEW |