Upstreaming SelectFileDialog for Android

Upstreaming the Select File Dialog and its dependencies needed for
Chrome on Android

BUG=116131


Review URL: https://chromiumcodereview.appspot.com/10916160

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@157424 0039d316-1c4b-4281-b951-d872f2087c98
diff --git a/chrome/browser/file_select_helper.cc b/chrome/browser/file_select_helper.cc
index 43118c5..ee1f3d3 100644
--- a/chrome/browser/file_select_helper.cc
+++ b/chrome/browser/file_select_helper.cc
@@ -409,6 +409,12 @@
   gfx::NativeWindow owning_window =
       platform_util::GetTopLevel(render_view_host_->GetView()->GetNativeView());
 
+#if defined(OS_ANDROID)
+  // Android needs the original MIME types and an additional capture value.
+  std::vector<string16> accept_types(params.accept_types);
+  accept_types.push_back(params.capture);
+#endif
+
   select_file_dialog_->SelectFile(
       dialog_type_,
       params.title,
@@ -419,7 +425,7 @@
       FILE_PATH_LITERAL(""),
       owning_window,
 #if defined(OS_ANDROID)
-      const_cast<content::FileChooserParams*>(&params));
+      &accept_types);
 #else
       NULL);
 #endif