| OLD | NEW |
| (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 } |
| OLD | NEW |