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.webkit.WebViewDatabase; | 7 import android.webkit.WebViewDatabase; |
8 | 8 |
9 import org.chromium.android_webview.AwFormDatabase; | 9 import org.chromium.android_webview.AwFormDatabase; |
10 import org.chromium.android_webview.HttpAuthDatabase; | 10 import org.chromium.android_webview.HttpAuthDatabase; |
| 11 import org.chromium.base.BuildInfo; |
11 import org.chromium.base.ThreadUtils; | 12 import org.chromium.base.ThreadUtils; |
12 | 13 |
13 import java.util.concurrent.Callable; | 14 import java.util.concurrent.Callable; |
14 | 15 |
15 /** | 16 /** |
16 * Chromium implementation of WebViewDatabase -- forwards calls to the | 17 * Chromium implementation of WebViewDatabase -- forwards calls to the |
17 * chromium internal implementation. | 18 * chromium internal implementation. |
18 */ | 19 */ |
19 @SuppressWarnings("deprecation") | 20 @SuppressWarnings("deprecation") |
20 final class WebViewDatabaseAdapter extends WebViewDatabase { | 21 final class WebViewDatabaseAdapter extends WebViewDatabase { |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
90 public String[] call() { | 91 public String[] call() { |
91 return mHttpAuthDatabase.getHttpAuthUsernamePassword(host, r
ealm); | 92 return mHttpAuthDatabase.getHttpAuthUsernamePassword(host, r
ealm); |
92 } | 93 } |
93 }); | 94 }); |
94 } | 95 } |
95 return mHttpAuthDatabase.getHttpAuthUsernamePassword(host, realm); | 96 return mHttpAuthDatabase.getHttpAuthUsernamePassword(host, realm); |
96 } | 97 } |
97 | 98 |
98 @Override | 99 @Override |
99 public boolean hasFormData() { | 100 public boolean hasFormData() { |
| 101 if (BuildInfo.isAtLeastO()) return false; |
| 102 |
100 if (checkNeedsPost()) { | 103 if (checkNeedsPost()) { |
101 return mFactory.runOnUiThreadBlocking(new Callable<Boolean>() { | 104 return mFactory.runOnUiThreadBlocking(new Callable<Boolean>() { |
102 @Override | 105 @Override |
103 public Boolean call() { | 106 public Boolean call() { |
104 return AwFormDatabase.hasFormData(); | 107 return AwFormDatabase.hasFormData(); |
105 } | 108 } |
106 | 109 |
107 }); | 110 }); |
108 } | 111 } |
109 return AwFormDatabase.hasFormData(); | 112 return AwFormDatabase.hasFormData(); |
110 } | 113 } |
111 | 114 |
112 @Override | 115 @Override |
113 public void clearFormData() { | 116 public void clearFormData() { |
| 117 if (BuildInfo.isAtLeastO()) return; |
| 118 |
114 if (checkNeedsPost()) { | 119 if (checkNeedsPost()) { |
115 mFactory.addTask(new Runnable() { | 120 mFactory.addTask(new Runnable() { |
116 @Override | 121 @Override |
117 public void run() { | 122 public void run() { |
118 AwFormDatabase.clearFormData(); | 123 AwFormDatabase.clearFormData(); |
119 } | 124 } |
120 | 125 |
121 }); | 126 }); |
122 return; | 127 return; |
123 } | 128 } |
124 AwFormDatabase.clearFormData(); | 129 AwFormDatabase.clearFormData(); |
125 } | 130 } |
126 | 131 |
127 private static boolean checkNeedsPost() { | 132 private static boolean checkNeedsPost() { |
128 // Init is guaranteed to have happened if a WebViewDatabaseAdapter is cr
eated, so do not | 133 // Init is guaranteed to have happened if a WebViewDatabaseAdapter is cr
eated, so do not |
129 // need to check WebViewChromiumFactoryProvider.hasStarted. | 134 // need to check WebViewChromiumFactoryProvider.hasStarted. |
130 return !ThreadUtils.runningOnUiThread(); | 135 return !ThreadUtils.runningOnUiThread(); |
131 } | 136 } |
132 } | 137 } |
OLD | NEW |