| 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 "base/android/apk_assets.h" | 14 #include "base/android/apk_assets.h" |
| 14 #include "base/android/build_info.h" | 15 #include "base/android/build_info.h" |
| 15 #include "base/android/locale_utils.h" | 16 #include "base/android/locale_utils.h" |
| 16 #include "base/android/memory_pressure_listener_android.h" | 17 #include "base/android/memory_pressure_listener_android.h" |
| 18 #include "base/command_line.h" |
| 17 #include "base/files/file_path.h" | 19 #include "base/files/file_path.h" |
| 18 #include "base/path_service.h" | 20 #include "base/path_service.h" |
| 21 #include "content/public/browser/android/synchronous_compositor.h" |
| 19 #include "content/public/browser/render_process_host.h" | 22 #include "content/public/browser/render_process_host.h" |
| 20 #include "content/public/common/content_client.h" | 23 #include "content/public/common/content_client.h" |
| 21 #include "content/public/common/content_switches.h" | 24 #include "content/public/common/content_switches.h" |
| 22 #include "content/public/common/result_codes.h" | 25 #include "content/public/common/result_codes.h" |
| 23 #include "content/public/common/url_utils.h" | 26 #include "content/public/common/url_utils.h" |
| 24 #include "media/base/android/media_client_android.h" | 27 #include "media/base/android/media_client_android.h" |
| 25 #include "net/android/network_change_notifier_factory_android.h" | 28 #include "net/android/network_change_notifier_factory_android.h" |
| 26 #include "net/base/network_change_notifier.h" | 29 #include "net/base/network_change_notifier.h" |
| 27 #include "ui/base/l10n/l10n_util.h" | 30 #include "ui/base/l10n/l10n_util.h" |
| 28 #include "ui/base/layout.h" | 31 #include "ui/base/layout.h" |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 101 } | 104 } |
| 102 | 105 |
| 103 void AwBrowserMainParts::PreMainMessageLoopRun() { | 106 void AwBrowserMainParts::PreMainMessageLoopRun() { |
| 104 browser_context_->PreMainMessageLoopRun(); | 107 browser_context_->PreMainMessageLoopRun(); |
| 105 | 108 |
| 106 AwDevToolsDiscoveryProvider::Install(); | 109 AwDevToolsDiscoveryProvider::Install(); |
| 107 | 110 |
| 108 media::SetMediaClientAndroid( | 111 media::SetMediaClientAndroid( |
| 109 new AwMediaClientAndroid(AwResource::GetConfigKeySystemUuidMapping())); | 112 new AwMediaClientAndroid(AwResource::GetConfigKeySystemUuidMapping())); |
| 110 | 113 |
| 111 gfx::GLSurface::InitializeOneOff(); | 114 if (base::CommandLine::ForCurrentProcess()->HasSwitch( |
| 115 switches::kUseIpcCommandBuffer)) { |
| 116 content::SynchronousCompositor::SetUseIpcCommandBuffer(); |
| 117 } else { |
| 118 gfx::GLSurface::InitializeOneOff(); |
| 119 } |
| 112 | 120 |
| 113 // This is needed for WebView Classic backwards compatibility | 121 // This is needed for WebView Classic backwards compatibility |
| 114 // See crbug.com/298495 | 122 // See crbug.com/298495 |
| 115 content::SetMaxURLChars(20 * 1024 * 1024); | 123 content::SetMaxURLChars(20 * 1024 * 1024); |
| 116 } | 124 } |
| 117 | 125 |
| 118 bool AwBrowserMainParts::MainMessageLoopRun(int* result_code) { | 126 bool AwBrowserMainParts::MainMessageLoopRun(int* result_code) { |
| 119 // Android WebView does not use default MessageLoop. It has its own | 127 // Android WebView does not use default MessageLoop. It has its own |
| 120 // Android specific MessageLoop. | 128 // Android specific MessageLoop. |
| 121 return true; | 129 return true; |
| 122 } | 130 } |
| 123 | 131 |
| 124 } // namespace android_webview | 132 } // namespace android_webview |
| OLD | NEW |