Wire up Select Action Bar in WebView.

Bug: 10800319
Change-Id: I59445237e0e328417175386239f33ce71c465eea
diff --git a/chromium/java/com/android/webview/chromium/ResourceProvider.java b/chromium/java/com/android/webview/chromium/ResourceProvider.java
index cabc894..42c8321 100644
--- a/chromium/java/com/android/webview/chromium/ResourceProvider.java
+++ b/chromium/java/com/android/webview/chromium/ResourceProvider.java
@@ -35,10 +35,6 @@
         AwResource.setResources(context.getResources());
 
         // attr
-        org.chromium.content.R.attr.action_mode_share_drawable =
-                com.android.internal.R.attr.actionModeShareDrawable;
-        org.chromium.content.R.attr.action_mode_web_search_drawable =
-                com.android.internal.R.attr.actionModeWebSearchDrawable;
         org.chromium.content.R.attr.select_dialog_multichoice =
                 com.android.internal.R.attr.webviewchromium_select_dialog_multichoice;
         org.chromium.content.R.attr.select_dialog_singlechoice =
@@ -76,6 +72,18 @@
                 com.android.internal.R.id.webviewchromium_second_colon;
         org.chromium.content.R.id.second_dot =
                 com.android.internal.R.id.webviewchromium_second_dot;
+        org.chromium.content.R.id.select_action_menu_select_all =
+                com.android.internal.R.id.webviewchromium_select_action_menu_select_all;
+        org.chromium.content.R.id.select_action_menu_cut =
+                com.android.internal.R.id.webviewchromium_select_action_menu_cut;
+        org.chromium.content.R.id.select_action_menu_copy =
+                com.android.internal.R.id.webviewchromium_select_action_menu_copy;
+        org.chromium.content.R.id.select_action_menu_paste =
+                com.android.internal.R.id.webviewchromium_select_action_menu_paste;
+        org.chromium.content.R.id.select_action_menu_share =
+                com.android.internal.R.id.webviewchromium_select_action_menu_share;
+        org.chromium.content.R.id.select_action_menu_web_search =
+                com.android.internal.R.id.webviewchromium_select_action_menu_web_search;
         org.chromium.content.R.id.time_picker =
                 com.android.internal.R.id.webviewchromium_time_picker;
         org.chromium.content.R.id.year = com.android.internal.R.id.webviewchromium_year;
@@ -125,6 +133,10 @@
         org.chromium.ui.R.layout.autofill_text =
                 com.android.internal.R.layout.webviewchromium_autofill_text;
 
+        // menu
+        org.chromium.content.R.menu.select_action_menu =
+                com.android.internal.R.menu.webviewchromium_select_action_menu;
+
         // string
 
         org.chromium.content.R.string.accessibility_content_view =
@@ -190,9 +202,6 @@
                 com.android.internal.R.string.webviewchromium_color_picker_dialog_title;
 
         // style
-
-        org.chromium.content.R.style.ContentActionBar =
-                com.android.internal.R.style.webviewchromium_ContentActionBar;
         org.chromium.content.R.style.SelectPopupDialog =
                 com.android.internal.R.style.webviewchromium_SelectPopupDialog;
         org.chromium.ui.R.style.AutofillPopupWindow =
diff --git a/chromium/overlay/frameworks/base/core/res/res/menu/webviewchromium_select_action_menu.xml b/chromium/overlay/frameworks/base/core/res/res/menu/webviewchromium_select_action_menu.xml
new file mode 100644
index 0000000..1278749
--- /dev/null
+++ b/chromium/overlay/frameworks/base/core/res/res/menu/webviewchromium_select_action_menu.xml
@@ -0,0 +1,56 @@
+<?xml version="1.0" encoding="utf-8"?>
+
+<!--
+/*
+** Copyright 2013, The Android Open Source Project
+**
+** Licensed under the Apache License, Version 2.0 (the "License");
+** you may not use this file except in compliance with the License.
+** You may obtain a copy of the License at
+**
+**     http://www.apache.org/licenses/LICENSE-2.0
+**
+** Unless required by applicable law or agreed to in writing, software
+** distributed under the License is distributed on an "AS IS" BASIS,
+** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+** See the License for the specific language governing permissions and
+** limitations under the License.
+**/
+-->
+
+<menu xmlns:android="http://schemas.android.com/apk/res/android">
+    <item android:id="@+id/webviewchromium_select_action_menu_select_all"
+        android:icon="?android:attr/actionModeSelectAllDrawable"
+        android:title="@android:string/selectAll"
+        android:showAsAction="always|withText"
+        android:alphabeticShortcut="a"
+        />
+    <item android:id="@+id/webviewchromium_select_action_menu_cut"
+        android:icon="?android:attr/actionModeCutDrawable"
+        android:title="@android:string/cut"
+        android:showAsAction="always|withText"
+        android:alphabeticShortcut="x"
+        />
+    <item android:id="@+id/webviewchromium_select_action_menu_copy"
+        android:icon="?android:attr/actionModeCopyDrawable"
+        android:title="@android:string/copy"
+        android:showAsAction="always|withText"
+        android:alphabeticShortcut="c"
+        />
+    <item android:id="@+id/webviewchromium_select_action_menu_paste"
+        android:icon="?android:attr/actionModePasteDrawable"
+        android:title="@android:string/paste"
+        android:showAsAction="always|withText"
+        android:alphabeticShortcut="v"
+        />
+    <item android:id="@+id/webviewchromium_select_action_menu_share"
+        android:icon="?attr/actionModeShareDrawable"
+        android:title="@android:string/share"
+        android:showAsAction="always|withText"
+        />
+    <item android:id="@+id/webviewchromium_select_action_menu_web_search"
+        android:icon="?attr/actionModeWebSearchDrawable"
+        android:title="@android:string/websearch"
+        android:showAsAction="always|withText"
+        />
+</menu>
diff --git a/chromium/overlay/frameworks/base/core/res/res/values-v17/webviewchromium_styles.xml b/chromium/overlay/frameworks/base/core/res/res/values-v17/webviewchromium_styles.xml
index 39062d8..1bfd2ac 100644
--- a/chromium/overlay/frameworks/base/core/res/res/values-v17/webviewchromium_styles.xml
+++ b/chromium/overlay/frameworks/base/core/res/res/values-v17/webviewchromium_styles.xml
@@ -10,11 +10,6 @@
     <style name="webviewchromium_AutofillPopupWindow" parent="@android:style/Widget.ListPopupWindow">
         <item name="android:popupBackground">@drawable/webviewchromium_autofill_popup_background</item>
     </style>
-    <style name="webviewchromium_ContentActionBar">
-        <!-- Intentionally does not define any style items. The items that the
-             content/ layer defines upstream are resolved via internal private
-             framework attributes. -->
-    </style>
     <style name="webviewchromium_SelectPopupDialog">
         <item name="webviewchromium_select_dialog_multichoice">@android:layout/select_dialog_multichoice</item>
         <item name="webviewchromium_select_dialog_singlechoice">@android:layout/webview_select_singlechoice</item>
diff --git a/chromium/overlay/frameworks/base/core/res/res/values/chromium-resources.xml b/chromium/overlay/frameworks/base/core/res/res/values/chromium-resources.xml
index 1a1153b..c82d374 100644
--- a/chromium/overlay/frameworks/base/core/res/res/values/chromium-resources.xml
+++ b/chromium/overlay/frameworks/base/core/res/res/values/chromium-resources.xml
@@ -82,6 +82,5 @@
   <add-resource type="string" name="webviewchromium_week_picker_dialog_title" />
 
   <add-resource type="style" name="webviewchromium_AutofillPopupWindow" />
-  <add-resource type="style" name="webviewchromium_ContentActionBar" />
   <add-resource type="style" name="webviewchromium_SelectPopupDialog" />
 </resources>
diff --git a/chromium/overlay/frameworks/base/core/res/res/values/chromium-symbols.xml b/chromium/overlay/frameworks/base/core/res/res/values/chromium-symbols.xml
index d88cb0f..63d4235 100644
--- a/chromium/overlay/frameworks/base/core/res/res/values/chromium-symbols.xml
+++ b/chromium/overlay/frameworks/base/core/res/res/values/chromium-symbols.xml
@@ -41,6 +41,8 @@
   <java-symbol type="layout" name="webviewchromium_two_field_date_picker" />
   <java-symbol type="layout" name="webviewchromium_multi_field_time_picker_dialog" />
 
+  <java-symbol type="menu" name="webviewchromium_select_action_menu" />
+
   <java-symbol type="string" name="webviewchromium_accessibility_content_view" />
   <java-symbol type="string" name="webviewchromium_accessibility_date_picker_month" />
   <java-symbol type="string" name="webviewchromium_accessibility_date_picker_week" />
@@ -106,10 +108,15 @@
   <java-symbol type="id" name="webviewchromium_second" />
   <java-symbol type="id" name="webviewchromium_second_colon" />
   <java-symbol type="id" name="webviewchromium_second_dot" />
+  <java-symbol type="id" name="webviewchromium_select_action_menu_cut" />
+  <java-symbol type="id" name="webviewchromium_select_action_menu_copy" />
+  <java-symbol type="id" name="webviewchromium_select_action_menu_paste" />
+  <java-symbol type="id" name="webviewchromium_select_action_menu_select_all" />
+  <java-symbol type="id" name="webviewchromium_select_action_menu_share" />
+  <java-symbol type="id" name="webviewchromium_select_action_menu_web_search" />
   <java-symbol type="id" name="webviewchromium_time_picker" />
   <java-symbol type="id" name="webviewchromium_year" />
 
   <java-symbol type="style" name="webviewchromium_AutofillPopupWindow" />
-  <java-symbol type="style" name="webviewchromium_ContentActionBar" />
   <java-symbol type="style" name="webviewchromium_SelectPopupDialog" />
 </resources>