| 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 "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" |
| 11 #include "android_webview/lib/aw_browser_dependency_factory_impl.h" | 11 #include "android_webview/lib/aw_browser_dependency_factory_impl.h" |
| 12 #include "android_webview/native/aw_media_url_interceptor.h" | 12 #include "android_webview/native/aw_media_url_interceptor.h" |
| 13 #include "android_webview/native/aw_message_port_service_impl.h" | 13 #include "android_webview/native/aw_message_port_service_impl.h" |
| 14 #include "android_webview/native/aw_quota_manager_bridge_impl.h" | 14 #include "android_webview/native/aw_quota_manager_bridge_impl.h" |
| 15 #include "android_webview/native/aw_web_contents_view_delegate.h" | 15 #include "android_webview/native/aw_web_contents_view_delegate.h" |
| 16 #include "android_webview/native/aw_web_preferences_populater_impl.h" | 16 #include "android_webview/native/aw_web_preferences_populater_impl.h" |
| 17 #include "android_webview/native/external_video_surface_container_impl.h" | 17 #include "android_webview/native/external_video_surface_container_impl.h" |
| 18 #include "android_webview/native/public/aw_assets.h" | 18 #include "android_webview/native/public/aw_assets.h" |
| 19 #include "android_webview/renderer/aw_content_renderer_client.h" | 19 #include "android_webview/renderer/aw_content_renderer_client.h" |
| 20 #include "base/command_line.h" | 20 #include "base/command_line.h" |
| 21 #include "base/cpu.h" | 21 #include "base/cpu.h" |
| 22 #include "base/i18n/icu_util.h" | 22 #include "base/i18n/icu_util.h" |
| 23 #include "base/lazy_instance.h" | 23 #include "base/lazy_instance.h" |
| 24 #include "base/logging.h" | 24 #include "base/logging.h" |
| 25 #include "base/memory/scoped_ptr.h" | 25 #include "base/memory/scoped_ptr.h" |
| 26 #include "base/threading/thread_restrictions.h" | 26 #include "base/threading/thread_restrictions.h" |
| 27 #include "cc/base/switches.h" | 27 #include "cc/base/switches.h" |
| 28 #include "content/browser/media/android/browser_media_player_manager.h" | 28 #include "content/public/browser/android/browser_media_player_manager.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 | 37 |
| 38 namespace android_webview { | 38 namespace android_webview { |
| 39 | 39 |
| 40 namespace { | 40 namespace { |
| 41 | 41 |
| 42 // TODO(boliu): Remove this global Allow once the underlying issues are | 42 // TODO(boliu): Remove this global Allow once the underlying issues are |
| 43 // resolved - http://crbug.com/240453. See AwMainDelegate::RunProcess below. | 43 // resolved - http://crbug.com/240453. See AwMainDelegate::RunProcess below. |
| 44 base::LazyInstance<scoped_ptr<ScopedAllowWaitForLegacyWebViewApi> > | 44 base::LazyInstance<scoped_ptr<ScopedAllowWaitForLegacyWebViewApi> > |
| 45 g_allow_wait_in_ui_thread = LAZY_INSTANCE_INITIALIZER; | 45 g_allow_wait_in_ui_thread = LAZY_INSTANCE_INITIALIZER; |
| 46 | 46 |
| 47 } | 47 } |
| 48 | 48 |
| 49 AwMainDelegate::AwMainDelegate() { | 49 AwMainDelegate::AwMainDelegate() { |
| 50 } | 50 } |
| 51 | 51 |
| 52 AwMainDelegate::~AwMainDelegate() { | 52 AwMainDelegate::~AwMainDelegate() { |
| 53 } | 53 } |
| 54 | 54 |
| 55 bool AwMainDelegate::BasicStartupComplete(int* exit_code) { | 55 bool AwMainDelegate::BasicStartupComplete(int* exit_code) { |
| 56 content::SetContentClient(&content_client_); | 56 content::SetContentClient(&content_client_); |
| 57 | 57 |
| 58 content::BrowserMediaPlayerManager::RegisterMediaUrlInterceptor( | 58 content::RegisterMediaUrlInterceptor(new AwMediaUrlInterceptor()); |
| 59 new AwMediaUrlInterceptor()); | |
| 60 | 59 |
| 61 BrowserViewRenderer::CalculateTileMemoryPolicy(); | 60 BrowserViewRenderer::CalculateTileMemoryPolicy(); |
| 62 | 61 |
| 63 base::CommandLine* cl = base::CommandLine::ForCurrentProcess(); | 62 base::CommandLine* cl = base::CommandLine::ForCurrentProcess(); |
| 64 cl->AppendSwitch(switches::kEnableBeginFrameScheduling); | 63 cl->AppendSwitch(switches::kEnableBeginFrameScheduling); |
| 65 | 64 |
| 66 // WebView uses the Android system's scrollbars and overscroll glow. | 65 // WebView uses the Android system's scrollbars and overscroll glow. |
| 67 cl->AppendSwitch(switches::kDisableOverscrollEdgeEffect); | 66 cl->AppendSwitch(switches::kDisableOverscrollEdgeEffect); |
| 68 | 67 |
| 69 // Pull-to-refresh should never be a default WebView action. | 68 // Pull-to-refresh should never be a default WebView action. |
| (...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 196 | 195 |
| 197 #if defined(VIDEO_HOLE) | 196 #if defined(VIDEO_HOLE) |
| 198 content::ExternalVideoSurfaceContainer* | 197 content::ExternalVideoSurfaceContainer* |
| 199 AwMainDelegate::CreateExternalVideoSurfaceContainer( | 198 AwMainDelegate::CreateExternalVideoSurfaceContainer( |
| 200 content::WebContents* web_contents) { | 199 content::WebContents* web_contents) { |
| 201 return new ExternalVideoSurfaceContainerImpl(web_contents); | 200 return new ExternalVideoSurfaceContainerImpl(web_contents); |
| 202 } | 201 } |
| 203 #endif | 202 #endif |
| 204 | 203 |
| 205 } // namespace android_webview | 204 } // namespace android_webview |
| OLD | NEW |