Skip to content

Commit 0e9292b

Browse files
author
Selim Gurun
committed
Remove defunct searchbox implementation from webview.
The search box implementation has not been in use since ICS. This removes dead code from webview. Change-Id: I8a28eeeec556619abc4a902a3abec2ac52bad319
1 parent ce3ef0a commit 0e9292b

File tree

5 files changed

+1
-473
lines changed

5 files changed

+1
-473
lines changed

core/java/android/webkit/BrowserFrame.java

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -107,9 +107,6 @@ public JSObject(Object object, boolean requireAnnotation) {
107107
// Key store handler when Chromium HTTP stack is used.
108108
private KeyStoreHandler mKeyStoreHandler = null;
109109

110-
// Implementation of the searchbox API.
111-
private final SearchBoxImpl mSearchBox;
112-
113110
// message ids
114111
// a message posted when a frame loading is completed
115112
static final int FRAME_COMPLETED = 1001;
@@ -255,8 +252,6 @@ public BrowserFrame(Context context, WebViewCore w, CallbackProxy proxy,
255252
mDatabase = WebViewDatabaseClassic.getInstance(appContext);
256253
mWebViewCore = w;
257254

258-
mSearchBox = new SearchBoxImpl(mWebViewCore, mCallbackProxy);
259-
260255
AssetManager am = context.getAssets();
261256
nativeCreateFrame(w, am, proxy.getBackForwardList());
262257

@@ -1217,10 +1212,6 @@ private void setCertificate(byte cert_der[]) {
12171212
}
12181213
}
12191214

1220-
/*package*/ SearchBox getSearchBox() {
1221-
return mSearchBox;
1222-
}
1223-
12241215
/**
12251216
* Called by JNI when processing the X-Auto-Login header.
12261217
*/

core/java/android/webkit/CallbackProxy.java

Lines changed: 0 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -117,11 +117,8 @@ class CallbackProxy extends Handler {
117117
private static final int ADD_HISTORY_ITEM = 135;
118118
private static final int HISTORY_INDEX_CHANGED = 136;
119119
private static final int AUTH_CREDENTIALS = 137;
120-
private static final int NOTIFY_SEARCHBOX_LISTENERS = 139;
121120
private static final int AUTO_LOGIN = 140;
122121
private static final int CLIENT_CERT_REQUEST = 141;
123-
private static final int SEARCHBOX_IS_SUPPORTED_CALLBACK = 142;
124-
private static final int SEARCHBOX_DISPATCH_COMPLETE_CALLBACK = 143;
125122
private static final int PROCEEDED_AFTER_SSL_ERROR = 144;
126123

127124
// Message triggered by the client to resume execution
@@ -871,14 +868,6 @@ public void onCancel(
871868
host, realm, username, password);
872869
break;
873870
}
874-
case NOTIFY_SEARCHBOX_LISTENERS: {
875-
SearchBoxImpl searchBox = (SearchBoxImpl) mWebView.getSearchBox();
876-
877-
@SuppressWarnings("unchecked")
878-
List<String> suggestions = (List<String>) msg.obj;
879-
searchBox.handleSuggestions(msg.getData().getString("query"), suggestions);
880-
break;
881-
}
882871
case AUTO_LOGIN: {
883872
if (mWebViewClient != null) {
884873
String realm = msg.getData().getString("realm");
@@ -889,19 +878,6 @@ public void onCancel(
889878
}
890879
break;
891880
}
892-
case SEARCHBOX_IS_SUPPORTED_CALLBACK: {
893-
SearchBoxImpl searchBox = (SearchBoxImpl) mWebView.getSearchBox();
894-
Boolean supported = (Boolean) msg.obj;
895-
searchBox.handleIsSupportedCallback(supported);
896-
break;
897-
}
898-
case SEARCHBOX_DISPATCH_COMPLETE_CALLBACK: {
899-
SearchBoxImpl searchBox = (SearchBoxImpl) mWebView.getSearchBox();
900-
Boolean success = (Boolean) msg.obj;
901-
searchBox.handleDispatchCompleteCallback(msg.getData().getString("function"),
902-
msg.getData().getInt("id"), success);
903-
break;
904-
}
905881
}
906882
}
907883

@@ -1629,29 +1605,6 @@ boolean canShowAlertDialog() {
16291605
return mContext instanceof Activity;
16301606
}
16311607

1632-
void onSearchboxSuggestionsReceived(String query, List<String> suggestions) {
1633-
Message msg = obtainMessage(NOTIFY_SEARCHBOX_LISTENERS);
1634-
msg.obj = suggestions;
1635-
msg.getData().putString("query", query);
1636-
1637-
sendMessage(msg);
1638-
}
1639-
1640-
void onIsSupportedCallback(boolean isSupported) {
1641-
Message msg = obtainMessage(SEARCHBOX_IS_SUPPORTED_CALLBACK);
1642-
msg.obj = Boolean.valueOf(isSupported);
1643-
sendMessage(msg);
1644-
}
1645-
1646-
void onSearchboxDispatchCompleteCallback(String function, int id, boolean success) {
1647-
Message msg = obtainMessage(SEARCHBOX_DISPATCH_COMPLETE_CALLBACK);
1648-
msg.obj = Boolean.valueOf(success);
1649-
msg.getData().putString("function", function);
1650-
msg.getData().putInt("id", id);
1651-
1652-
sendMessage(msg);
1653-
}
1654-
16551608
private synchronized void sendMessageToUiThreadSync(Message msg) {
16561609
sendMessage(msg);
16571610
WebCoreThreadWatchdog.pause();

core/java/android/webkit/SearchBox.java

Lines changed: 0 additions & 109 deletions
This file was deleted.

0 commit comments

Comments
 (0)