Skip to content

Commit

Permalink
Show action mode bar on Android WebView Test Shell
Browse files Browse the repository at this point in the history
Basically do what ContentViewClient.startActionMode does.

BUG=501072

Review URL: https://codereview.chromium.org/1193463003

Cr-Commit-Position: refs/heads/master@{#334732}
  • Loading branch information
hush authored and Commit bot committed Jun 16, 2015
1 parent 192c516 commit e7b6958
Showing 1 changed file with 14 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import android.content.SharedPreferences;
import android.os.Bundle;
import android.text.TextUtils;
import android.view.ActionMode;
import android.view.Gravity;
import android.view.KeyEvent;
import android.view.View;
Expand Down Expand Up @@ -38,6 +39,9 @@
import org.chromium.android_webview.test.AwTestContainerView;
import org.chromium.android_webview.test.NullContentsClient;
import org.chromium.base.CommandLine;
import org.chromium.content.browser.SelectActionMode;
import org.chromium.content.browser.SelectActionModeCallback;
import org.chromium.content.browser.SelectActionModeCallback.ActionHandler;
import org.chromium.content_public.browser.LoadUrlParams;
import org.chromium.content_public.browser.NavigationController;
import org.chromium.content_public.browser.WebContents;
Expand Down Expand Up @@ -144,6 +148,16 @@ public boolean shouldOverrideKeyEvent(KeyEvent event) {
}
return false;
}

@Override
public SelectActionMode startActionMode(
View view, ActionHandler actionHandler, boolean floating) {
if (floating) return null;
ActionMode.Callback callback =
new SelectActionModeCallback(view.getContext(), actionHandler);
ActionMode actionMode = view.startActionMode(callback);
return actionMode != null ? new SelectActionMode(actionMode) : null;
}
};

SharedPreferences sharedPreferences =
Expand Down

0 comments on commit e7b6958

Please sign in to comment.