Wire up stylable attributes for <select> dialogs.

This complements crrev.com/23523025 and overrides the layouts used
for rendering the <select> dialogs using the same ones used by classic
WebView. Clank's default layouts, in fact, can be (graphically) broken
by apps if they override, for instance as happened in b/10549550, the
text color for their alert dialogs and show the WebView in an alert dialog.

Change-Id: Ie64d11a85fd39425915122fa11901989bee9d5a7
diff --git a/chromium/java/com/android/webview/chromium/ResourceProvider.java b/chromium/java/com/android/webview/chromium/ResourceProvider.java
index 6c90fb2..cabc894 100644
--- a/chromium/java/com/android/webview/chromium/ResourceProvider.java
+++ b/chromium/java/com/android/webview/chromium/ResourceProvider.java
@@ -39,6 +39,10 @@
                 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 =
+                com.android.internal.R.attr.webviewchromium_select_dialog_singlechoice;
 
         // color
         org.chromium.ui.R.color.color_picker_border_color =
@@ -189,6 +193,8 @@
 
         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 =
                 com.android.internal.R.style.webviewchromium_AutofillPopupWindow;
 
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 861ce02..39062d8 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
@@ -15,4 +15,8 @@
              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>
+    </style>
 </resources>
diff --git a/chromium/overlay/frameworks/base/core/res/res/values/attrs.xml b/chromium/overlay/frameworks/base/core/res/res/values/attrs.xml
new file mode 100644
index 0000000..3ab2cc6
--- /dev/null
+++ b/chromium/overlay/frameworks/base/core/res/res/values/attrs.xml
@@ -0,0 +1,23 @@
+<?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.
+**/
+-->
+
+<resources>
+    <attr name="webviewchromium_select_dialog_multichoice" format="reference" />
+    <attr name="webviewchromium_select_dialog_singlechoice" format="reference" />
+</resources>
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 1ef00c6..1a1153b 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
@@ -18,6 +18,9 @@
 -->
 
 <resources>
+  <add-resource type="attr" name="webviewchromium_select_dialog_multichoice" />
+  <add-resource type="attr" name="webviewchromium_select_dialog_singlechoice" />
+
   <add-resource type="color" name="webviewchromium_color_picker_border_color" />
 
   <add-resource type="dimen" name="webviewchromium_color_picker_gradient_margin" />
@@ -80,4 +83,5 @@
 
   <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 4a2275b..d88cb0f 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
@@ -21,6 +21,9 @@
 <resources>
   <private-symbols package="com.android.internal" />
 
+  <java-symbol type="attr" name="webviewchromium_select_dialog_multichoice" />
+  <java-symbol type="attr" name="webviewchromium_select_dialog_singlechoice" />
+
   <java-symbol type="color" name="webviewchromium_color_picker_border_color" />
 
   <java-symbol type="dimen" name="webviewchromium_color_picker_gradient_margin" />
@@ -108,4 +111,5 @@
 
   <java-symbol type="style" name="webviewchromium_AutofillPopupWindow" />
   <java-symbol type="style" name="webviewchromium_ContentActionBar" />
+  <java-symbol type="style" name="webviewchromium_SelectPopupDialog" />
 </resources>