| 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.Manifest; | 7 import android.Manifest; |
| 8 import android.app.ActivityManager; | 8 import android.app.ActivityManager; |
| 9 import android.content.ComponentCallbacks2; | 9 import android.content.ComponentCallbacks2; |
| 10 import android.content.Context; | 10 import android.content.Context; |
| (...skipping 474 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 485 ensureChromiumStartedLocked(true); | 485 ensureChromiumStartedLocked(true); |
| 486 AwGeolocationPermissions awGelocationPermissions = ThreadUtils.r
unningOnUiThread() | 486 AwGeolocationPermissions awGelocationPermissions = ThreadUtils.r
unningOnUiThread() |
| 487 ? getBrowserContextOnUiThread().getGeolocationPermission
s() | 487 ? getBrowserContextOnUiThread().getGeolocationPermission
s() |
| 488 : runOnUiThreadBlocking(new Callable<AwGeolocationPermis
sions>() { | 488 : runOnUiThreadBlocking(new Callable<AwGeolocationPermis
sions>() { |
| 489 @Override | 489 @Override |
| 490 public AwGeolocationPermissions call() { | 490 public AwGeolocationPermissions call() { |
| 491 return getBrowserContextOnUiThread().getGeolocat
ionPermissions(); | 491 return getBrowserContextOnUiThread().getGeolocat
ionPermissions(); |
| 492 } | 492 } |
| 493 }); | 493 }); |
| 494 mGeolocationPermissions = | 494 mGeolocationPermissions = |
| 495 new GeolocationPermissionsAdapter(awGelocationPermission
s); | 495 new GeolocationPermissionsAdapter(this, awGelocationPerm
issions); |
| 496 } | 496 } |
| 497 } | 497 } |
| 498 return mGeolocationPermissions; | 498 return mGeolocationPermissions; |
| 499 } | 499 } |
| 500 | 500 |
| 501 @Override | 501 @Override |
| 502 public CookieManager getCookieManager() { | 502 public CookieManager getCookieManager() { |
| 503 synchronized (mLock) { | 503 synchronized (mLock) { |
| 504 if (mCookieManager == null) { | 504 if (mCookieManager == null) { |
| 505 mCookieManager = new CookieManagerAdapter(new AwCookieManager())
; | 505 mCookieManager = new CookieManagerAdapter(new AwCookieManager())
; |
| (...skipping 19 matching lines...) Expand all Loading... |
| 525 if (mWebStorage == null) { | 525 if (mWebStorage == null) { |
| 526 ensureChromiumStartedLocked(true); | 526 ensureChromiumStartedLocked(true); |
| 527 AwQuotaManagerBridge awQuotaManager = ThreadUtils.runningOnUiThr
ead() | 527 AwQuotaManagerBridge awQuotaManager = ThreadUtils.runningOnUiThr
ead() |
| 528 ? AwQuotaManagerBridge.getInstance() | 528 ? AwQuotaManagerBridge.getInstance() |
| 529 : runOnUiThreadBlocking(new Callable<AwQuotaManagerBridg
e>() { | 529 : runOnUiThreadBlocking(new Callable<AwQuotaManagerBridg
e>() { |
| 530 @Override | 530 @Override |
| 531 public AwQuotaManagerBridge call() { | 531 public AwQuotaManagerBridge call() { |
| 532 return AwQuotaManagerBridge.getInstance(); | 532 return AwQuotaManagerBridge.getInstance(); |
| 533 } | 533 } |
| 534 }); | 534 }); |
| 535 mWebStorage = new WebStorageAdapter(awQuotaManager); | 535 mWebStorage = new WebStorageAdapter(this, awQuotaManager); |
| 536 } | 536 } |
| 537 } | 537 } |
| 538 return mWebStorage; | 538 return mWebStorage; |
| 539 } | 539 } |
| 540 | 540 |
| 541 @Override | 541 @Override |
| 542 public WebViewDatabase getWebViewDatabase(final Context context) { | 542 public WebViewDatabase getWebViewDatabase(final Context context) { |
| 543 synchronized (mLock) { | 543 synchronized (mLock) { |
| 544 if (mWebViewDatabase == null) { | 544 if (mWebViewDatabase == null) { |
| 545 ensureChromiumStartedLocked(true); | 545 ensureChromiumStartedLocked(true); |
| 546 HttpAuthDatabase awDatabase = ThreadUtils.runningOnUiThread() | 546 HttpAuthDatabase awDatabase = ThreadUtils.runningOnUiThread() |
| 547 ? getBrowserContextOnUiThread().getHttpAuthDatabase(cont
ext) | 547 ? getBrowserContextOnUiThread().getHttpAuthDatabase(cont
ext) |
| 548 : runOnUiThreadBlocking(new Callable<HttpAuthDatabase>()
{ | 548 : runOnUiThreadBlocking(new Callable<HttpAuthDatabase>()
{ |
| 549 @Override | 549 @Override |
| 550 public HttpAuthDatabase call() { | 550 public HttpAuthDatabase call() { |
| 551 return getBrowserContextOnUiThread().getHttpAuth
Database(context); | 551 return getBrowserContextOnUiThread().getHttpAuth
Database(context); |
| 552 } | 552 } |
| 553 }); | 553 }); |
| 554 mWebViewDatabase = new WebViewDatabaseAdapter(this, awDatabase); | 554 mWebViewDatabase = new WebViewDatabaseAdapter(this, awDatabase); |
| 555 } | 555 } |
| 556 } | 556 } |
| 557 return mWebViewDatabase; | 557 return mWebViewDatabase; |
| 558 } | 558 } |
| 559 | 559 |
| 560 WebViewDelegate getWebViewDelegate() { | 560 WebViewDelegate getWebViewDelegate() { |
| 561 return mWebViewDelegate; | 561 return mWebViewDelegate; |
| 562 } | 562 } |
| 563 } | 563 } |
| OLD | NEW |