Moved context modes into view, renamed to action modes

ContextualMode renamed to ActionMode. Adds a reference to the action
bar and reduces confusion around things named "Context".

Change-Id: Ia5098b1d0799a0ece0810c34e6696eda039fb005
diff --git a/core/java/android/view/View.java b/core/java/android/view/View.java
index b1025c9..363aced 100644
--- a/core/java/android/view/View.java
+++ b/core/java/android/view/View.java
@@ -16,7 +16,6 @@
 
 package android.view;
 
-import android.graphics.RectF;
 import com.android.internal.R;
 import com.android.internal.view.menu.MenuBuilder;
 
@@ -35,6 +34,7 @@
 import android.graphics.PorterDuff;
 import android.graphics.PorterDuffXfermode;
 import android.graphics.Rect;
+import android.graphics.RectF;
 import android.graphics.Region;
 import android.graphics.Shader;
 import android.graphics.drawable.ColorDrawable;
@@ -57,6 +57,7 @@
 import android.util.Pools;
 import android.util.SparseArray;
 import android.view.ContextMenu.ContextMenuInfo;
+import android.view.View.MeasureSpec;
 import android.view.accessibility.AccessibilityEvent;
 import android.view.accessibility.AccessibilityEventSource;
 import android.view.accessibility.AccessibilityManager;
@@ -2541,6 +2542,18 @@
     }
 
     /**
+     * Start an action mode.
+     *
+     * @param callback Callback that will control the lifecycle of the action mode
+     * @return The new action mode if it is started, null otherwise
+     *
+     * @see ActionMode
+     */
+    public ActionMode startActionMode(ActionMode.Callback callback) {
+        return getParent().startActionModeForChild(this, callback);
+    }
+
+    /**
      * Register a callback to be invoked when a key is pressed in this view.
      * @param l the key listener to attach to this view
      */