summaryrefslogtreecommitdiff
path: root/core/java/android/webkit/FindActionModeCallback.java
diff options
context:
space:
mode:
authorLeon Scroggins <scroggo@google.com>2010-09-14 17:22:36 -0400
committerLeon Scroggins <scroggo@google.com>2010-09-15 11:43:49 -0400
commit05919f2133f8af89ab69c3a39aa34c6a32e78f05 (patch)
tree0abba043eadc0edda52aa6cb099664bf985ae6a4 /core/java/android/webkit/FindActionModeCallback.java
parentc71114919517e90710a37aa13b15f762bd7df7d4 (diff)
Exit action mode when destroying the WebView or loading.
Bug: 3000317 Change-Id: I7f131d5c159058c33c3249ee4e0fee3a667ec6d8
Diffstat (limited to 'core/java/android/webkit/FindActionModeCallback.java')
-rw-r--r--core/java/android/webkit/FindActionModeCallback.java6
1 files changed, 6 insertions, 0 deletions
diff --git a/core/java/android/webkit/FindActionModeCallback.java b/core/java/android/webkit/FindActionModeCallback.java
index 2299d4a0f04f..27043e0474cf 100644
--- a/core/java/android/webkit/FindActionModeCallback.java
+++ b/core/java/android/webkit/FindActionModeCallback.java
@@ -44,6 +44,7 @@ class FindActionModeCallback implements ActionMode.Callback, TextWatcher,
private boolean mMatchesFound;
private int mNumberOfMatches;
private View mTitleBar;
+ private ActionMode mActionMode;
FindActionModeCallback(Context context) {
mCustomView = LayoutInflater.from(context).inflate(
@@ -63,6 +64,10 @@ class FindActionModeCallback implements ActionMode.Callback, TextWatcher,
void setTitleBar(View v) { mTitleBar = v; }
+ void finish() {
+ mActionMode.finish();
+ }
+
/*
* Place text in the text field so it can be searched for. Need to press
* the find next or find previous button to find all of the matches.
@@ -156,6 +161,7 @@ class FindActionModeCallback implements ActionMode.Callback, TextWatcher,
mode.setCustomView(mCustomView);
mode.getMenuInflater().inflate(com.android.internal.R.menu.webview_find,
menu);
+ mActionMode = mode;
Editable edit = mEditText.getText();
Selection.setSelection(edit, edit.length());
mMatches.setVisibility(View.GONE);