OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 package com.android.webview.chromium; | 5 package com.android.webview.chromium; |
6 | 6 |
7 import android.app.ActivityManager; | 7 import android.app.ActivityManager; |
8 import android.content.ComponentCallbacks2; | 8 import android.content.ComponentCallbacks2; |
9 import android.content.Context; | 9 import android.content.Context; |
10 import android.content.Intent; | 10 import android.content.Intent; |
(...skipping 19 matching lines...) Expand all Loading... |
30 import org.chromium.android_webview.AwBrowserProcess; | 30 import org.chromium.android_webview.AwBrowserProcess; |
31 import org.chromium.android_webview.AwContents; | 31 import org.chromium.android_webview.AwContents; |
32 import org.chromium.android_webview.AwContentsClient; | 32 import org.chromium.android_webview.AwContentsClient; |
33 import org.chromium.android_webview.AwContentsStatics; | 33 import org.chromium.android_webview.AwContentsStatics; |
34 import org.chromium.android_webview.AwCookieManager; | 34 import org.chromium.android_webview.AwCookieManager; |
35 import org.chromium.android_webview.AwDataReductionProxyManager; | 35 import org.chromium.android_webview.AwDataReductionProxyManager; |
36 import org.chromium.android_webview.AwDevToolsServer; | 36 import org.chromium.android_webview.AwDevToolsServer; |
37 import org.chromium.android_webview.AwQuotaManagerBridge; | 37 import org.chromium.android_webview.AwQuotaManagerBridge; |
38 import org.chromium.android_webview.AwResource; | 38 import org.chromium.android_webview.AwResource; |
39 import org.chromium.android_webview.AwSettings; | 39 import org.chromium.android_webview.AwSettings; |
| 40 import org.chromium.android_webview.R; |
40 import org.chromium.base.CommandLine; | 41 import org.chromium.base.CommandLine; |
41 import org.chromium.base.MemoryPressureListener; | 42 import org.chromium.base.MemoryPressureListener; |
42 import org.chromium.base.PathService; | 43 import org.chromium.base.PathService; |
43 import org.chromium.base.PathUtils; | 44 import org.chromium.base.PathUtils; |
44 import org.chromium.base.ThreadUtils; | 45 import org.chromium.base.ThreadUtils; |
45 import org.chromium.base.TraceEvent; | 46 import org.chromium.base.TraceEvent; |
46 import org.chromium.base.library_loader.LibraryLoader; | 47 import org.chromium.base.library_loader.LibraryLoader; |
47 import org.chromium.base.library_loader.LibraryProcessType; | 48 import org.chromium.base.library_loader.LibraryProcessType; |
48 import org.chromium.base.library_loader.ProcessInitException; | 49 import org.chromium.base.library_loader.ProcessInitException; |
49 import org.chromium.content.app.ContentMain; | 50 import org.chromium.content.app.ContentMain; |
50 import org.chromium.content.browser.ContentViewStatics; | 51 import org.chromium.content.browser.ContentViewStatics; |
| 52 import org.chromium.ui.base.ResourceBundle; |
51 | 53 |
52 import java.io.File; | 54 import java.io.File; |
53 import java.lang.ref.WeakReference; | 55 import java.lang.ref.WeakReference; |
54 import java.util.ArrayList; | 56 import java.util.ArrayList; |
55 | 57 |
56 /** | 58 /** |
57 * Entry point to the WebView. The system framework talks to this class to get i
nstances of the | 59 * Entry point to the WebView. The system framework talks to this class to get i
nstances of the |
58 * implementation classes. | 60 * implementation classes. |
59 */ | 61 */ |
60 @SuppressWarnings("deprecation") | 62 @SuppressWarnings("deprecation") |
(...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
234 } catch (ProcessInitException e) { | 236 } catch (ProcessInitException e) { |
235 throw new RuntimeException("Error initializing WebView library", e); | 237 throw new RuntimeException("Error initializing WebView library", e); |
236 } | 238 } |
237 | 239 |
238 PathService.override(PathService.DIR_MODULE, "/system/lib/"); | 240 PathService.override(PathService.DIR_MODULE, "/system/lib/"); |
239 PathService.override(DIR_RESOURCE_PAKS_ANDROID, "/system/framework/webvi
ew/paks"); | 241 PathService.override(DIR_RESOURCE_PAKS_ANDROID, "/system/framework/webvi
ew/paks"); |
240 | 242 |
241 // Make sure that ResourceProvider is initialized before starting the br
owser process. | 243 // Make sure that ResourceProvider is initialized before starting the br
owser process. |
242 Context context = getWrappedCurrentApplicationContext(); | 244 Context context = getWrappedCurrentApplicationContext(); |
243 setUpResources(context); | 245 setUpResources(context); |
| 246 ResourceBundle.initializeLocalePaks(context, R.array.locale_paks); |
244 initPlatSupportLibrary(); | 247 initPlatSupportLibrary(); |
245 AwBrowserProcess.start(context); | 248 AwBrowserProcess.start(context); |
246 | 249 |
247 if (isBuildDebuggable()) { | 250 if (isBuildDebuggable()) { |
248 setWebContentsDebuggingEnabled(true); | 251 setWebContentsDebuggingEnabled(true); |
249 } | 252 } |
250 | 253 |
251 TraceEvent.setATraceEnabled(mWebViewDelegate.isTraceTagEnabled()); | 254 TraceEvent.setATraceEnabled(mWebViewDelegate.isTraceTagEnabled()); |
252 mWebViewDelegate.setOnTraceEnabledChangeListener( | 255 mWebViewDelegate.setOnTraceEnabledChangeListener( |
253 new WebViewDelegate.OnTraceEnabledChangeListener() { | 256 new WebViewDelegate.OnTraceEnabledChangeListener() { |
(...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
458 browserContext.getHttpAuthDatabase(context)); | 461 browserContext.getHttpAuthDatabase(context)); |
459 } | 462 } |
460 } | 463 } |
461 return mWebViewDatabase; | 464 return mWebViewDatabase; |
462 } | 465 } |
463 | 466 |
464 WebViewDelegate getWebViewDelegate() { | 467 WebViewDelegate getWebViewDelegate() { |
465 return mWebViewDelegate; | 468 return mWebViewDelegate; |
466 } | 469 } |
467 } | 470 } |
OLD | NEW |