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/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/common/aw_switches.h" |
10 #include "android_webview/lib/aw_browser_dependency_factory_impl.h" | 11 #include "android_webview/lib/aw_browser_dependency_factory_impl.h" |
11 #include "android_webview/native/aw_geolocation_permission_context.h" | 12 #include "android_webview/native/aw_geolocation_permission_context.h" |
12 #include "android_webview/native/aw_quota_manager_bridge_impl.h" | 13 #include "android_webview/native/aw_quota_manager_bridge_impl.h" |
13 #include "android_webview/native/aw_web_contents_view_delegate.h" | 14 #include "android_webview/native/aw_web_contents_view_delegate.h" |
14 #include "android_webview/renderer/aw_content_renderer_client.h" | 15 #include "android_webview/renderer/aw_content_renderer_client.h" |
15 #include "base/command_line.h" | 16 #include "base/command_line.h" |
16 #include "base/lazy_instance.h" | 17 #include "base/lazy_instance.h" |
17 #include "base/logging.h" | 18 #include "base/logging.h" |
18 #include "base/memory/scoped_ptr.h" | 19 #include "base/memory/scoped_ptr.h" |
19 #include "base/threading/thread_restrictions.h" | 20 #include "base/threading/thread_restrictions.h" |
20 #include "cc/base/switches.h" | 21 #include "cc/base/switches.h" |
21 #include "content/public/browser/browser_main_runner.h" | 22 #include "content/public/browser/browser_main_runner.h" |
22 #include "content/public/browser/browser_thread.h" | 23 #include "content/public/browser/browser_thread.h" |
23 #include "content/public/common/content_switches.h" | 24 #include "content/public/common/content_switches.h" |
24 #include "gpu/command_buffer/client/gl_in_process_context.h" | 25 #include "gpu/command_buffer/client/gl_in_process_context.h" |
25 #include "gpu/command_buffer/service/in_process_command_buffer.h" | 26 #include "gpu/command_buffer/service/in_process_command_buffer.h" |
| 27 #include "url/url_util.h" |
26 #include "webkit/common/gpu/webgraphicscontext3d_in_process_command_buffer_impl.
h" | 28 #include "webkit/common/gpu/webgraphicscontext3d_in_process_command_buffer_impl.
h" |
27 | 29 |
28 namespace android_webview { | 30 namespace android_webview { |
29 | 31 |
30 namespace { | 32 namespace { |
31 | 33 |
32 // TODO(boliu): Remove this global Allow once the underlying issues are | 34 // TODO(boliu): Remove this global Allow once the underlying issues are |
33 // resolved - http://crbug.com/240453. See AwMainDelegate::RunProcess below. | 35 // resolved - http://crbug.com/240453. See AwMainDelegate::RunProcess below. |
34 base::LazyInstance<scoped_ptr<ScopedAllowWaitForLegacyWebViewApi> > | 36 base::LazyInstance<scoped_ptr<ScopedAllowWaitForLegacyWebViewApi> > |
35 g_allow_wait_in_ui_thread = LAZY_INSTANCE_INITIALIZER; | 37 g_allow_wait_in_ui_thread = LAZY_INSTANCE_INITIALIZER; |
(...skipping 22 matching lines...) Expand all Loading... |
58 // WebView uses the Android system's scrollbars and overscroll glow. | 60 // WebView uses the Android system's scrollbars and overscroll glow. |
59 cl->AppendSwitch(switches::kHideScrollbars); | 61 cl->AppendSwitch(switches::kHideScrollbars); |
60 cl->AppendSwitch(switches::kDisableOverscrollEdgeEffect); | 62 cl->AppendSwitch(switches::kDisableOverscrollEdgeEffect); |
61 | 63 |
62 // Not yet secure in single-process mode. | 64 // Not yet secure in single-process mode. |
63 cl->AppendSwitch(switches::kDisableExperimentalWebGL); | 65 cl->AppendSwitch(switches::kDisableExperimentalWebGL); |
64 | 66 |
65 // Ganesh backed 2D-Canvas is not yet working and causes crashes. | 67 // Ganesh backed 2D-Canvas is not yet working and causes crashes. |
66 cl->AppendSwitch(switches::kDisableAccelerated2dCanvas); | 68 cl->AppendSwitch(switches::kDisableAccelerated2dCanvas); |
67 | 69 |
| 70 url_util::SetKURLCompatMode(cl->HasSwitch(switches::kKURLCompatMode)); |
| 71 |
68 return false; | 72 return false; |
69 } | 73 } |
70 | 74 |
71 void AwMainDelegate::PreSandboxStartup() { | 75 void AwMainDelegate::PreSandboxStartup() { |
72 // TODO(torne): When we have a separate renderer process, we need to handle | 76 // TODO(torne): When we have a separate renderer process, we need to handle |
73 // being passed open FDs for the resource paks here. | 77 // being passed open FDs for the resource paks here. |
74 } | 78 } |
75 | 79 |
76 void AwMainDelegate::SandboxInitialized(const std::string& process_type) { | 80 void AwMainDelegate::SandboxInitialized(const std::string& process_type) { |
77 // TODO(torne): Adjust linux OOM score here. | 81 // TODO(torne): Adjust linux OOM score here. |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
126 AwBrowserContext* browser_context) { | 130 AwBrowserContext* browser_context) { |
127 return AwGeolocationPermissionContext::Create(browser_context); | 131 return AwGeolocationPermissionContext::Create(browser_context); |
128 } | 132 } |
129 | 133 |
130 content::WebContentsViewDelegate* AwMainDelegate::CreateViewDelegate( | 134 content::WebContentsViewDelegate* AwMainDelegate::CreateViewDelegate( |
131 content::WebContents* web_contents) { | 135 content::WebContents* web_contents) { |
132 return AwWebContentsViewDelegate::Create(web_contents); | 136 return AwWebContentsViewDelegate::Create(web_contents); |
133 } | 137 } |
134 | 138 |
135 } // namespace android_webview | 139 } // namespace android_webview |
OLD | NEW |