Skip to content

Commit c6911d4

Browse files
Ben MurdochAndroid (Google) Code Review
authored andcommitted
Merge "Create WebViewDatabaseClassic from WebViewDatabase." into jb-dev
2 parents b33c34c + 99c12e8 commit c6911d4

File tree

5 files changed

+685
-577
lines changed

5 files changed

+685
-577
lines changed

core/java/android/webkit/BrowserFrame.java

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ class BrowserFrame extends Handler {
7272
private final CallbackProxy mCallbackProxy;
7373
private final WebSettingsClassic mSettings;
7474
private final Context mContext;
75-
private final WebViewDatabase mDatabase;
75+
private final WebViewDatabaseClassic mDatabase;
7676
private final WebViewCore mWebViewCore;
7777
/* package */ boolean mLoadInitFromJava;
7878
private int mLoadType;
@@ -241,7 +241,7 @@ public BrowserFrame(Context context, WebViewCore w, CallbackProxy proxy,
241241
mSettings = settings;
242242
mContext = context;
243243
mCallbackProxy = proxy;
244-
mDatabase = WebViewDatabase.getInstance(appContext);
244+
mDatabase = WebViewDatabaseClassic.getInstance(appContext);
245245
mWebViewCore = w;
246246

247247
mSearchBox = new SearchBoxImpl(mWebViewCore, mCallbackProxy);
@@ -496,8 +496,8 @@ public void handleMessage(Message msg) {
496496
if (item != null) {
497497
WebAddress uri = new WebAddress(item.getUrl());
498498
String schemePlusHost = uri.getScheme() + uri.getHost();
499-
String[] up =
500-
mDatabase.getUsernamePassword(schemePlusHost);
499+
String[] up = mDatabase.getUsernamePassword(
500+
schemePlusHost);
501501
if (up != null && up[0] != null) {
502502
setUsernamePassword(up[0], up[1]);
503503
}
@@ -809,8 +809,7 @@ private void maybeSavePassword(
809809
// non-null username implies that user has
810810
// chosen to save password, so update the
811811
// recorded password
812-
mDatabase.setUsernamePassword(
813-
schemePlusHost, username, password);
812+
mDatabase.setUsernamePassword(schemePlusHost, username, password);
814813
}
815814
} else {
816815
// CallbackProxy will handle creating the resume

core/java/android/webkit/WebViewClassic.java

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -701,7 +701,7 @@ public void onTrimMemory(int level) {
701701
// A final CallbackProxy shared by WebViewCore and BrowserFrame.
702702
private CallbackProxy mCallbackProxy;
703703

704-
private WebViewDatabase mDatabase;
704+
private WebViewDatabaseClassic mDatabase;
705705

706706
// SSL certificate for the main top-level page (if secure)
707707
private SslCertificate mCertificate;
@@ -1230,7 +1230,7 @@ public void init(Map<String, Object> javaScriptInterfaces, boolean privateBrowsi
12301230
mViewManager = new ViewManager(this);
12311231
L10nUtils.setApplicationContext(context.getApplicationContext());
12321232
mWebViewCore = new WebViewCore(context, this, mCallbackProxy, javaScriptInterfaces);
1233-
mDatabase = WebViewDatabase.getInstance(context);
1233+
mDatabase = WebViewDatabaseClassic.getInstance(context);
12341234
mScroller = new OverScroller(context, null, 0, 0, false); //TODO Use OverScroller's flywheel
12351235
mZoomManager = new ZoomManager(this, mCallbackProxy);
12361236

@@ -1294,6 +1294,11 @@ public WebIconDatabase getWebIconDatabase() {
12941294
public WebStorage getWebStorage() {
12951295
return WebStorageClassic.getInstance();
12961296
}
1297+
1298+
@Override
1299+
public WebViewDatabase getWebViewDatabase(Context context) {
1300+
return WebViewDatabaseClassic.getInstance(context);
1301+
}
12971302
}
12981303

12991304
private void onHandleUiEvent(MotionEvent event, int eventType, int flags) {
@@ -7192,8 +7197,7 @@ public void handleMessage(Message msg) {
71927197
break;
71937198
}
71947199
case NEVER_REMEMBER_PASSWORD: {
7195-
mDatabase.setUsernamePassword(
7196-
msg.getData().getString("host"), null, null);
7200+
mDatabase.setUsernamePassword(msg.getData().getString("host"), null, null);
71977201
((Message) msg.obj).sendToTarget();
71987202
break;
71997203
}

0 commit comments

Comments
 (0)