| 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_content_browser_client.h" | 8 #include "android_webview/browser/aw_content_browser_client.h" |
| 9 #include "android_webview/browser/aw_result_codes.h" | 9 #include "android_webview/browser/aw_result_codes.h" |
| 10 #include "android_webview/browser/deferred_gpu_command_service.h" | 10 #include "android_webview/browser/deferred_gpu_command_service.h" |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 89 // Android WebView does not use default MessageLoop. It has its own | 89 // Android WebView does not use default MessageLoop. It has its own |
| 90 // Android specific MessageLoop. Also see MainMessageLoopRun. | 90 // Android specific MessageLoop. Also see MainMessageLoopRun. |
| 91 DCHECK(!main_message_loop_.get()); | 91 DCHECK(!main_message_loop_.get()); |
| 92 main_message_loop_.reset(new base::MessageLoopForUI); | 92 main_message_loop_.reset(new base::MessageLoopForUI); |
| 93 base::MessageLoopForUI::current()->Start(); | 93 base::MessageLoopForUI::current()->Start(); |
| 94 } | 94 } |
| 95 | 95 |
| 96 int AwBrowserMainParts::PreCreateThreads() { | 96 int AwBrowserMainParts::PreCreateThreads() { |
| 97 ui::SetLocalePaksStoredInApk(true); | 97 ui::SetLocalePaksStoredInApk(true); |
| 98 std::string locale = ui::ResourceBundle::InitSharedInstanceWithLocale( | 98 std::string locale = ui::ResourceBundle::InitSharedInstanceWithLocale( |
| 99 base::android::GetDefaultLocale(), | 99 base::android::GetDefaultLocaleString(), NULL, |
| 100 NULL, | |
| 101 ui::ResourceBundle::LOAD_COMMON_RESOURCES); | 100 ui::ResourceBundle::LOAD_COMMON_RESOURCES); |
| 102 if (locale.empty()) { | 101 if (locale.empty()) { |
| 103 LOG(WARNING) << "Failed to load locale .pak from the apk. " | 102 LOG(WARNING) << "Failed to load locale .pak from the apk. " |
| 104 "Bringing up WebView without any locale"; | 103 "Bringing up WebView without any locale"; |
| 105 } | 104 } |
| 106 base::i18n::SetICUDefaultLocale(locale); | 105 base::i18n::SetICUDefaultLocale(locale); |
| 107 | 106 |
| 108 // Try to directly mmap the resources.pak from the apk. Fall back to load | 107 // Try to directly mmap the resources.pak from the apk. Fall back to load |
| 109 // from file, using PATH_SERVICE, otherwise. | 108 // from file, using PATH_SERVICE, otherwise. |
| 110 base::FilePath pak_file_path; | 109 base::FilePath pak_file_path; |
| (...skipping 22 matching lines...) Expand all Loading... |
| 133 content::RenderFrameHost::AllowInjectingJavaScriptForAndroidWebView(); | 132 content::RenderFrameHost::AllowInjectingJavaScriptForAndroidWebView(); |
| 134 } | 133 } |
| 135 | 134 |
| 136 bool AwBrowserMainParts::MainMessageLoopRun(int* result_code) { | 135 bool AwBrowserMainParts::MainMessageLoopRun(int* result_code) { |
| 137 // Android WebView does not use default MessageLoop. It has its own | 136 // Android WebView does not use default MessageLoop. It has its own |
| 138 // Android specific MessageLoop. | 137 // Android specific MessageLoop. |
| 139 return true; | 138 return true; |
| 140 } | 139 } |
| 141 | 140 |
| 142 } // namespace android_webview | 141 } // namespace android_webview |
| OLD | NEW |