Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(67)

Side by Side Diff: content/public/android/java/src/org/chromium/content/browser/SelectActionMode.java

Issue 1066053002: [Android] Allow custom ActionMode creation via ContentViewClient (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 5 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 package org.chromium.content.browser;
6
7 import android.util.Log;
8 import android.view.ActionMode;
9
10 /**
11 * An ActionMode for in-page selection. This class wraps an ActionMode created
12 * by the associated View, providing modified interaction with that ActionMode.
13 */
14 public class SelectActionMode {
15 private static final String TAG = "SelectActionMode";
16
17 protected final ActionMode mActionMode;
18
19 /**
20 * Constructs a SelectActionMode instance wrapping a concrete ActionMode.
21 * @param actionMode the wrapped ActionMode.
22 */
23 public SelectActionMode(ActionMode actionMode) {
24 mActionMode = actionMode;
25 }
26
27 /**
28 * @see ActionMode#finish()
29 */
30 public void finish() {
31 mActionMode.finish();
32 }
33
34 /**
35 * @see ActionMode#invalidate()
36 */
37 public void invalidate() {
38 // Try/catch necessary for framework bug, crbug.com/446717.
39 try {
40 mActionMode.invalidate();
41 } catch (NullPointerException e) {
42 Log.w(TAG, "Ignoring NPE from ActionMode.invalidate() as workaround for L", e);
43 }
44 }
45
46 /**
47 * @see ActionMode#invalidateContentRect()
48 */
49 public void invalidateContentRect() {}
50 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698