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/browser/aw_browser_main_parts.h" | 5 #include "android_webview/browser/aw_browser_main_parts.h" |
6 | 6 |
7 #include "android_webview/browser/aw_browser_context.h" | 7 #include "android_webview/browser/aw_browser_context.h" |
8 #include "android_webview/browser/aw_dev_tools_discovery_provider.h" | 8 #include "android_webview/browser/aw_dev_tools_discovery_provider.h" |
9 #include "android_webview/browser/aw_media_client_android.h" | 9 #include "android_webview/browser/aw_media_client_android.h" |
10 #include "android_webview/browser/aw_result_codes.h" | 10 #include "android_webview/browser/aw_result_codes.h" |
11 #include "android_webview/browser/deferred_gpu_command_service.h" | 11 #include "android_webview/browser/deferred_gpu_command_service.h" |
12 #include "android_webview/common/aw_resource.h" | 12 #include "android_webview/common/aw_resource.h" |
13 #include "android_webview/common/aw_switches.h" | 13 #include "android_webview/common/aw_switches.h" |
14 #include "base/android/apk_assets.h" | 14 #include "base/android/apk_assets.h" |
15 #include "base/android/build_info.h" | 15 #include "base/android/build_info.h" |
16 #include "base/android/locale_utils.h" | 16 #include "base/android/locale_utils.h" |
17 #include "base/android/memory_pressure_listener_android.h" | 17 #include "base/android/memory_pressure_listener_android.h" |
18 #include "base/command_line.h" | 18 #include "base/command_line.h" |
19 #include "base/files/file_path.h" | 19 #include "base/files/file_path.h" |
20 #include "base/path_service.h" | 20 #include "base/path_service.h" |
21 #include "content/public/browser/android/synchronous_compositor.h" | 21 #include "content/public/browser/android/synchronous_compositor.h" |
22 #include "content/public/browser/render_frame_host.h" | |
23 #include "content/public/browser/render_process_host.h" | 22 #include "content/public/browser/render_process_host.h" |
24 #include "content/public/common/content_client.h" | 23 #include "content/public/common/content_client.h" |
25 #include "content/public/common/content_switches.h" | 24 #include "content/public/common/content_switches.h" |
26 #include "content/public/common/result_codes.h" | 25 #include "content/public/common/result_codes.h" |
27 #include "content/public/common/url_utils.h" | 26 #include "content/public/common/url_utils.h" |
28 #include "media/base/android/media_client_android.h" | 27 #include "media/base/android/media_client_android.h" |
29 #include "net/android/network_change_notifier_factory_android.h" | 28 #include "net/android/network_change_notifier_factory_android.h" |
30 #include "net/base/network_change_notifier.h" | 29 #include "net/base/network_change_notifier.h" |
31 #include "ui/base/l10n/l10n_util.h" | 30 #include "ui/base/l10n/l10n_util.h" |
32 #include "ui/base/layout.h" | 31 #include "ui/base/layout.h" |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
112 media::SetMediaClientAndroid( | 111 media::SetMediaClientAndroid( |
113 new AwMediaClientAndroid(AwResource::GetConfigKeySystemUuidMapping())); | 112 new AwMediaClientAndroid(AwResource::GetConfigKeySystemUuidMapping())); |
114 | 113 |
115 if (base::CommandLine::ForCurrentProcess()->HasSwitch( | 114 if (base::CommandLine::ForCurrentProcess()->HasSwitch( |
116 switches::kUseIpcCommandBuffer)) { | 115 switches::kUseIpcCommandBuffer)) { |
117 content::SynchronousCompositor::SetUseIpcCommandBuffer(); | 116 content::SynchronousCompositor::SetUseIpcCommandBuffer(); |
118 } else { | 117 } else { |
119 gfx::GLSurface::InitializeOneOff(); | 118 gfx::GLSurface::InitializeOneOff(); |
120 } | 119 } |
121 | 120 |
122 content::RenderFrameHost::AllowInjectingJavaScriptForAndroidWebView(); | |
123 | |
124 // This is needed for WebView Classic backwards compatibility | 121 // This is needed for WebView Classic backwards compatibility |
125 // See crbug.com/298495 | 122 // See crbug.com/298495 |
126 content::SetMaxURLChars(20 * 1024 * 1024); | 123 content::SetMaxURLChars(20 * 1024 * 1024); |
127 } | 124 } |
128 | 125 |
129 bool AwBrowserMainParts::MainMessageLoopRun(int* result_code) { | 126 bool AwBrowserMainParts::MainMessageLoopRun(int* result_code) { |
130 // Android WebView does not use default MessageLoop. It has its own | 127 // Android WebView does not use default MessageLoop. It has its own |
131 // Android specific MessageLoop. | 128 // Android specific MessageLoop. |
132 return true; | 129 return true; |
133 } | 130 } |
134 | 131 |
135 } // namespace android_webview | 132 } // namespace android_webview |
OLD | NEW |