| 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/browser/net/aw_network_change_notifier_factory.h" | |
| 13 #include "android_webview/common/aw_resource.h" | 12 #include "android_webview/common/aw_resource.h" |
| 14 #include "android_webview/common/aw_switches.h" | 13 #include "android_webview/common/aw_switches.h" |
| 15 #include "base/android/apk_assets.h" | 14 #include "base/android/apk_assets.h" |
| 16 #include "base/android/build_info.h" | 15 #include "base/android/build_info.h" |
| 17 #include "base/android/locale_utils.h" | 16 #include "base/android/locale_utils.h" |
| 18 #include "base/android/memory_pressure_listener_android.h" | 17 #include "base/android/memory_pressure_listener_android.h" |
| 19 #include "base/command_line.h" | 18 #include "base/command_line.h" |
| 20 #include "base/files/file_path.h" | 19 #include "base/files/file_path.h" |
| 21 #include "base/i18n/rtl.h" | 20 #include "base/i18n/rtl.h" |
| 22 #include "base/path_service.h" | 21 #include "base/path_service.h" |
| (...skipping 17 matching lines...) Expand all Loading... |
| 40 namespace android_webview { | 39 namespace android_webview { |
| 41 | 40 |
| 42 AwBrowserMainParts::AwBrowserMainParts(AwBrowserContext* browser_context) | 41 AwBrowserMainParts::AwBrowserMainParts(AwBrowserContext* browser_context) |
| 43 : browser_context_(browser_context) { | 42 : browser_context_(browser_context) { |
| 44 } | 43 } |
| 45 | 44 |
| 46 AwBrowserMainParts::~AwBrowserMainParts() { | 45 AwBrowserMainParts::~AwBrowserMainParts() { |
| 47 } | 46 } |
| 48 | 47 |
| 49 void AwBrowserMainParts::PreEarlyInitialization() { | 48 void AwBrowserMainParts::PreEarlyInitialization() { |
| 50 net::NetworkChangeNotifier::SetFactory(new AwNetworkChangeNotifierFactory()); | 49 net::NetworkChangeNotifier::SetFactory( |
| 50 new net::NetworkChangeNotifierFactoryAndroid()); |
| 51 | 51 |
| 52 // Android WebView does not use default MessageLoop. It has its own | 52 // Android WebView does not use default MessageLoop. It has its own |
| 53 // Android specific MessageLoop. Also see MainMessageLoopRun. | 53 // Android specific MessageLoop. Also see MainMessageLoopRun. |
| 54 DCHECK(!main_message_loop_.get()); | 54 DCHECK(!main_message_loop_.get()); |
| 55 main_message_loop_.reset(new base::MessageLoopForUI); | 55 main_message_loop_.reset(new base::MessageLoopForUI); |
| 56 base::MessageLoopForUI::current()->Start(); | 56 base::MessageLoopForUI::current()->Start(); |
| 57 } | 57 } |
| 58 | 58 |
| 59 int AwBrowserMainParts::PreCreateThreads() { | 59 int AwBrowserMainParts::PreCreateThreads() { |
| 60 ui::SetLocalePaksStoredInApk(true); | 60 ui::SetLocalePaksStoredInApk(true); |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 98 content::RenderFrameHost::AllowInjectingJavaScriptForAndroidWebView(); | 98 content::RenderFrameHost::AllowInjectingJavaScriptForAndroidWebView(); |
| 99 } | 99 } |
| 100 | 100 |
| 101 bool AwBrowserMainParts::MainMessageLoopRun(int* result_code) { | 101 bool AwBrowserMainParts::MainMessageLoopRun(int* result_code) { |
| 102 // Android WebView does not use default MessageLoop. It has its own | 102 // Android WebView does not use default MessageLoop. It has its own |
| 103 // Android specific MessageLoop. | 103 // Android specific MessageLoop. |
| 104 return true; | 104 return true; |
| 105 } | 105 } |
| 106 | 106 |
| 107 } // namespace android_webview | 107 } // namespace android_webview |
| OLD | NEW |