| 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" |
| (...skipping 11 matching lines...) Expand all Loading... |
| 22 #include "components/crash/content/browser/crash_micro_dump_manager_android.h" | 22 #include "components/crash/content/browser/crash_micro_dump_manager_android.h" |
| 23 #include "content/public/browser/android/synchronous_compositor.h" | 23 #include "content/public/browser/android/synchronous_compositor.h" |
| 24 #include "content/public/browser/render_frame_host.h" | 24 #include "content/public/browser/render_frame_host.h" |
| 25 #include "content/public/browser/render_process_host.h" | 25 #include "content/public/browser/render_process_host.h" |
| 26 #include "content/public/common/content_client.h" | 26 #include "content/public/common/content_client.h" |
| 27 #include "content/public/common/content_switches.h" | 27 #include "content/public/common/content_switches.h" |
| 28 #include "content/public/common/result_codes.h" | 28 #include "content/public/common/result_codes.h" |
| 29 #include "media/base/android/media_client_android.h" | 29 #include "media/base/android/media_client_android.h" |
| 30 #include "net/android/network_change_notifier_factory_android.h" | 30 #include "net/android/network_change_notifier_factory_android.h" |
| 31 #include "net/base/network_change_notifier.h" | 31 #include "net/base/network_change_notifier.h" |
| 32 #include "ui/android/screen_android.h" |
| 32 #include "ui/base/l10n/l10n_util.h" | 33 #include "ui/base/l10n/l10n_util.h" |
| 33 #include "ui/base/layout.h" | 34 #include "ui/base/layout.h" |
| 34 #include "ui/base/resource/resource_bundle.h" | 35 #include "ui/base/resource/resource_bundle.h" |
| 35 #include "ui/base/resource/resource_bundle_android.h" | 36 #include "ui/base/resource/resource_bundle_android.h" |
| 36 #include "ui/base/ui_base_paths.h" | 37 #include "ui/base/ui_base_paths.h" |
| 38 #include "ui/gfx/screen.h" |
| 37 #include "ui/gl/gl_surface.h" | 39 #include "ui/gl/gl_surface.h" |
| 38 | 40 |
| 39 namespace android_webview { | 41 namespace android_webview { |
| 40 | 42 |
| 41 AwBrowserMainParts::AwBrowserMainParts(AwBrowserContext* browser_context) | 43 AwBrowserMainParts::AwBrowserMainParts(AwBrowserContext* browser_context) |
| 42 : browser_context_(browser_context) { | 44 : browser_context_(browser_context) { |
| 43 } | 45 } |
| 44 | 46 |
| 45 AwBrowserMainParts::~AwBrowserMainParts() { | 47 AwBrowserMainParts::~AwBrowserMainParts() { |
| 46 } | 48 } |
| (...skipping 30 matching lines...) Expand all Loading... |
| 77 | 79 |
| 78 base::android::MemoryPressureListenerAndroid::RegisterSystemCallback( | 80 base::android::MemoryPressureListenerAndroid::RegisterSystemCallback( |
| 79 base::android::AttachCurrentThread()); | 81 base::android::AttachCurrentThread()); |
| 80 DeferredGpuCommandService::SetInstance(); | 82 DeferredGpuCommandService::SetInstance(); |
| 81 if (!base::CommandLine::ForCurrentProcess()->HasSwitch( | 83 if (!base::CommandLine::ForCurrentProcess()->HasSwitch( |
| 82 switches::kSingleProcess)) { | 84 switches::kSingleProcess)) { |
| 83 // Create the renderers crash manager on the UI thread. | 85 // Create the renderers crash manager on the UI thread. |
| 84 breakpad::CrashMicroDumpManager::GetInstance(); | 86 breakpad::CrashMicroDumpManager::GetInstance(); |
| 85 } | 87 } |
| 86 | 88 |
| 89 gfx::Screen::SetScreenInstance(ui::CreateScreenAndroid()); |
| 90 |
| 87 return content::RESULT_CODE_NORMAL_EXIT; | 91 return content::RESULT_CODE_NORMAL_EXIT; |
| 88 } | 92 } |
| 89 | 93 |
| 90 void AwBrowserMainParts::PreMainMessageLoopRun() { | 94 void AwBrowserMainParts::PreMainMessageLoopRun() { |
| 91 browser_context_->PreMainMessageLoopRun(); | 95 browser_context_->PreMainMessageLoopRun(); |
| 92 | 96 |
| 93 AwDevToolsDiscoveryProvider::Install(); | 97 AwDevToolsDiscoveryProvider::Install(); |
| 94 | 98 |
| 95 media::SetMediaClientAndroid( | 99 media::SetMediaClientAndroid( |
| 96 new AwMediaClientAndroid(AwResource::GetConfigKeySystemUuidMapping())); | 100 new AwMediaClientAndroid(AwResource::GetConfigKeySystemUuidMapping())); |
| 97 | 101 |
| 98 content::RenderFrameHost::AllowInjectingJavaScriptForAndroidWebView(); | 102 content::RenderFrameHost::AllowInjectingJavaScriptForAndroidWebView(); |
| 99 } | 103 } |
| 100 | 104 |
| 101 bool AwBrowserMainParts::MainMessageLoopRun(int* result_code) { | 105 bool AwBrowserMainParts::MainMessageLoopRun(int* result_code) { |
| 102 // Android WebView does not use default MessageLoop. It has its own | 106 // Android WebView does not use default MessageLoop. It has its own |
| 103 // Android specific MessageLoop. | 107 // Android specific MessageLoop. |
| 104 return true; | 108 return true; |
| 105 } | 109 } |
| 106 | 110 |
| 107 } // namespace android_webview | 111 } // namespace android_webview |
| OLD | NEW |