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/gpu_memory_buffer_factory_impl.h" | 8 #include "android_webview/browser/gpu_memory_buffer_factory_impl.h" |
9 #include "android_webview/browser/in_process_view_renderer.h" | 9 #include "android_webview/browser/in_process_view_renderer.h" |
10 #include "android_webview/browser/scoped_allow_wait_for_legacy_web_view_api.h" | 10 #include "android_webview/browser/scoped_allow_wait_for_legacy_web_view_api.h" |
11 #include "android_webview/common/aw_switches.h" | 11 #include "android_webview/common/aw_switches.h" |
12 #include "android_webview/lib/aw_browser_dependency_factory_impl.h" | 12 #include "android_webview/lib/aw_browser_dependency_factory_impl.h" |
13 #include "android_webview/native/aw_geolocation_permission_context.h" | 13 #include "android_webview/native/aw_geolocation_permission_context.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/renderer/aw_content_renderer_client.h" | 17 #include "android_webview/renderer/aw_content_renderer_client.h" |
18 #include "base/command_line.h" | 18 #include "base/command_line.h" |
19 #include "base/lazy_instance.h" | 19 #include "base/lazy_instance.h" |
20 #include "base/logging.h" | 20 #include "base/logging.h" |
21 #include "base/memory/scoped_ptr.h" | 21 #include "base/memory/scoped_ptr.h" |
22 #include "base/threading/thread_restrictions.h" | 22 #include "base/threading/thread_restrictions.h" |
23 #include "cc/base/switches.h" | 23 #include "cc/base/switches.h" |
24 #include "content/public/browser/browser_main_runner.h" | 24 #include "content/public/browser/browser_main_runner.h" |
25 #include "content/public/browser/browser_thread.h" | 25 #include "content/public/browser/browser_thread.h" |
26 #include "content/public/common/content_switches.h" | 26 #include "content/public/common/content_switches.h" |
27 #include "gpu/command_buffer/client/gl_in_process_context.h" | 27 #include "gpu/command_buffer/client/gl_in_process_context.h" |
28 #include "gpu/command_buffer/service/in_process_command_buffer.h" | 28 #include "gpu/command_buffer/service/in_process_command_buffer.h" |
| 29 #include "media/base/media_switches.h" |
29 #include "webkit/common/gpu/webgraphicscontext3d_in_process_command_buffer_impl.
h" | 30 #include "webkit/common/gpu/webgraphicscontext3d_in_process_command_buffer_impl.
h" |
30 | 31 |
31 namespace android_webview { | 32 namespace android_webview { |
32 | 33 |
33 namespace { | 34 namespace { |
34 | 35 |
35 // TODO(boliu): Remove this global Allow once the underlying issues are | 36 // TODO(boliu): Remove this global Allow once the underlying issues are |
36 // resolved - http://crbug.com/240453. See AwMainDelegate::RunProcess below. | 37 // resolved - http://crbug.com/240453. See AwMainDelegate::RunProcess below. |
37 base::LazyInstance<scoped_ptr<ScopedAllowWaitForLegacyWebViewApi> > | 38 base::LazyInstance<scoped_ptr<ScopedAllowWaitForLegacyWebViewApi> > |
38 g_allow_wait_in_ui_thread = LAZY_INSTANCE_INITIALIZER; | 39 g_allow_wait_in_ui_thread = LAZY_INSTANCE_INITIALIZER; |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
73 | 74 |
74 // File system API not supported (requires some new API; internal bug 6930981) | 75 // File system API not supported (requires some new API; internal bug 6930981) |
75 cl->AppendSwitch(switches::kDisableFileSystem); | 76 cl->AppendSwitch(switches::kDisableFileSystem); |
76 | 77 |
77 // Disable compositor touch hit testing for now to mitigate risk of bugs. | 78 // Disable compositor touch hit testing for now to mitigate risk of bugs. |
78 cl->AppendSwitch(cc::switches::kDisableCompositorTouchHitTesting); | 79 cl->AppendSwitch(cc::switches::kDisableCompositorTouchHitTesting); |
79 | 80 |
80 // Disable WebRTC. | 81 // Disable WebRTC. |
81 cl->AppendSwitch(switches::kDisableWebRTC); | 82 cl->AppendSwitch(switches::kDisableWebRTC); |
82 | 83 |
| 84 #if defined(VIDEO_HOLE) |
| 85 // Support EME/L1 with hole-punching. |
| 86 cl->AppendSwitch(switches::kMediaDrmEnableNonCompositing); |
| 87 #endif |
| 88 |
83 return false; | 89 return false; |
84 } | 90 } |
85 | 91 |
86 void AwMainDelegate::PreSandboxStartup() { | 92 void AwMainDelegate::PreSandboxStartup() { |
87 // TODO(torne): When we have a separate renderer process, we need to handle | 93 // TODO(torne): When we have a separate renderer process, we need to handle |
88 // being passed open FDs for the resource paks here. | 94 // being passed open FDs for the resource paks here. |
89 } | 95 } |
90 | 96 |
91 void AwMainDelegate::SandboxInitialized(const std::string& process_type) { | 97 void AwMainDelegate::SandboxInitialized(const std::string& process_type) { |
92 // TODO(torne): Adjust linux OOM score here. | 98 // TODO(torne): Adjust linux OOM score here. |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
145 content::WebContentsViewDelegate* AwMainDelegate::CreateViewDelegate( | 151 content::WebContentsViewDelegate* AwMainDelegate::CreateViewDelegate( |
146 content::WebContents* web_contents) { | 152 content::WebContents* web_contents) { |
147 return AwWebContentsViewDelegate::Create(web_contents); | 153 return AwWebContentsViewDelegate::Create(web_contents); |
148 } | 154 } |
149 | 155 |
150 AwWebPreferencesPopulater* AwMainDelegate::CreateWebPreferencesPopulater() { | 156 AwWebPreferencesPopulater* AwMainDelegate::CreateWebPreferencesPopulater() { |
151 return new AwWebPreferencesPopulaterImpl(); | 157 return new AwWebPreferencesPopulaterImpl(); |
152 } | 158 } |
153 | 159 |
154 } // namespace android_webview | 160 } // namespace android_webview |
OLD | NEW |