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 304 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
315 "Toggling of Web Contents Debugging must be done on the UI t
hread"); | 315 "Toggling of Web Contents Debugging must be done on the UI t
hread"); |
316 } | 316 } |
317 if (mDevToolsServer == null) { | 317 if (mDevToolsServer == null) { |
318 if (!enable) return; | 318 if (!enable) return; |
319 mDevToolsServer = new AwDevToolsServer(); | 319 mDevToolsServer = new AwDevToolsServer(); |
320 } | 320 } |
321 mDevToolsServer.setRemoteDebuggingEnabled(enable); | 321 mDevToolsServer.setRemoteDebuggingEnabled(enable); |
322 } | 322 } |
323 | 323 |
324 private void setUpResources(Context context) { | 324 private void setUpResources(Context context) { |
325 try { | 325 final String packageName = WebViewFactory.getLoadedPackageInfo().package
Name; |
326 final String packageName = WebViewFactory.getLoadedPackageInfo().pac
kageName; | 326 ResourceRewriter.rewriteRValues( |
327 ResourceRewriter.rewriteRValues( | 327 mWebViewDelegate.getPackageId(context.getResources(), packageNam
e)); |
328 mWebViewDelegate.getPackageId(context.getResources(), packag
eName)); | |
329 } catch (RuntimeException e) { | |
330 // TODO(torne): remove this when we're no longer using the Android b
uild system. | |
331 // The Android.mk-based build uses a different resources package nam
e than the | |
332 // ninja-based build: the resources are always called com.android.we
bview even if the | |
333 // manifest has had the package renamed. | |
334 ResourceRewriter.rewriteRValues( | |
335 mWebViewDelegate.getPackageId(context.getResources(), "com.a
ndroid.webview")); | |
336 } | |
337 | 328 |
338 AwResource.setResources(context.getResources()); | 329 AwResource.setResources(context.getResources()); |
339 AwResource.setErrorPageResources(android.R.raw.loaderror, android.R.raw.
nodomain); | 330 AwResource.setErrorPageResources(android.R.raw.loaderror, android.R.raw.
nodomain); |
340 AwResource.setConfigKeySystemUuidMapping(android.R.array.config_keySyste
mUuidMapping); | 331 AwResource.setConfigKeySystemUuidMapping(android.R.array.config_keySyste
mUuidMapping); |
341 } | 332 } |
342 | 333 |
343 @Override | 334 @Override |
344 public Statics getStatics() { | 335 public Statics getStatics() { |
345 synchronized (mLock) { | 336 synchronized (mLock) { |
346 if (mStaticMethods == null) { | 337 if (mStaticMethods == null) { |
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
471 browserContext.getHttpAuthDatabase(context)); | 462 browserContext.getHttpAuthDatabase(context)); |
472 } | 463 } |
473 } | 464 } |
474 return mWebViewDatabase; | 465 return mWebViewDatabase; |
475 } | 466 } |
476 | 467 |
477 WebViewDelegate getWebViewDelegate() { | 468 WebViewDelegate getWebViewDelegate() { |
478 return mWebViewDelegate; | 469 return mWebViewDelegate; |
479 } | 470 } |
480 } | 471 } |
OLD | NEW |