Input file type now supported in extension popups.
To do this, this CL generalize the TabContentsFileSelectHelper (renamed FileSelectHelper) so it is associated with a RenderViewHost rather than a TabContents.
This allows the extension popups which don't use a TabContents to use it.
As part of that, I also moved GetTopLevelNativeWindow() from TabContentsView to TabContent, as it can be implemented in a non-platform specific way.
BUG=28829
TEST=Make sure you can still open file on web pages (such as http://www.cs.tut.fi/~jkorpela/forms/file.html.
Create an extension with a popup that contains an input file tag. Make sure it does open a file dialog and lets you choose a file.
Review URL: http://codereview.chromium.org/3209002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@59105 0039d316-1c4b-4281-b951-d872f2087c98
diff --git a/chrome/browser/tab_contents/tab_contents.cc b/chrome/browser/tab_contents/tab_contents.cc
index 4a1511ed..3c35e61 100644
--- a/chrome/browser/tab_contents/tab_contents.cc
+++ b/chrome/browser/tab_contents/tab_contents.cc
@@ -45,6 +45,7 @@
#include "chrome/browser/history/history_types.h"
#include "chrome/browser/history/top_sites.h"
#include "chrome/browser/favicon_service.h"
+#include "chrome/browser/file_select_helper.h"
#include "chrome/browser/find_bar_state.h"
#include "chrome/browser/google/google_util.h"
#include "chrome/browser/host_content_settings_map.h"
@@ -79,7 +80,6 @@
#include "chrome/browser/tab_contents/navigation_entry.h"
#include "chrome/browser/tab_contents/provisional_load_details.h"
#include "chrome/browser/tab_contents/tab_contents_delegate.h"
-#include "chrome/browser/tab_contents/tab_contents_file_select_helper.h"
#include "chrome/browser/tab_contents/tab_contents_ssl_helper.h"
#include "chrome/browser/tab_contents/tab_contents_view.h"
#include "chrome/browser/tab_contents/thumbnail_generator.h"
@@ -2297,7 +2297,7 @@
RenderViewHostDelegate::FileSelect* TabContents::GetFileSelectDelegate() {
if (file_select_helper_.get() == NULL)
- file_select_helper_.reset(new TabContentsFileSelectHelper(this));
+ file_select_helper_.reset(new FileSelectHelper(profile()));
return file_select_helper_.get();
}