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 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
49 net::NetworkChangeNotifier::SetFactory( | 49 net::NetworkChangeNotifier::SetFactory( |
50 new net::NetworkChangeNotifierFactoryAndroid()); | 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::PreCreateThreadsBegin() { |
60 ui::SetLocalePaksStoredInApk(true); | 60 ui::SetLocalePaksStoredInApk(true); |
61 std::string locale = ui::ResourceBundle::InitSharedInstanceWithLocale( | 61 std::string locale = ui::ResourceBundle::InitSharedInstanceWithLocale( |
62 base::android::GetDefaultLocale(), | 62 base::android::GetDefaultLocale(), |
63 NULL, | 63 NULL, |
64 ui::ResourceBundle::DO_NOT_LOAD_COMMON_RESOURCES); | 64 ui::ResourceBundle::DO_NOT_LOAD_COMMON_RESOURCES); |
65 if (locale.empty()) { | 65 if (locale.empty()) { |
66 LOG(WARNING) << "Failed to load locale .pak from the apk. " | 66 LOG(WARNING) << "Failed to load locale .pak from the apk. " |
67 "Bringing up WebView without any locale"; | 67 "Bringing up WebView without any locale"; |
68 } | 68 } |
69 base::i18n::SetICUDefaultLocale(locale); | 69 base::i18n::SetICUDefaultLocale(locale); |
(...skipping 28 matching lines...) Expand all 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 |