summaryrefslogtreecommitdiffstats
path: root/chrome/browser/views/bookmark_manager_view.cc
diff options
context:
space:
mode:
authoravi@chromium.org <avi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-04-12 20:03:08 +0000
committeravi@chromium.org <avi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-04-12 20:03:08 +0000
commitb949f1110dea9e220706cbe72ede4118d78308f0 (patch)
tree16627db33014921df4287548a54caac852dd76eb /chrome/browser/views/bookmark_manager_view.cc
parent3e1302168c2b16d744486172b55dc48114baac7e (diff)
downloadchromium_src-b949f1110dea9e220706cbe72ede4118d78308f0.zip
chromium_src-b949f1110dea9e220706cbe72ede4118d78308f0.tar.gz
chromium_src-b949f1110dea9e220706cbe72ede4118d78308f0.tar.bz2
Refactoring; switch the |filter| parameter into something that is more amenable to cross-platform implementation.
BUG=9852 Review URL: http://codereview.chromium.org/63093 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@13573 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/views/bookmark_manager_view.cc')
-rw-r--r--chrome/browser/views/bookmark_manager_view.cc21
1 files changed, 13 insertions, 8 deletions
diff --git a/chrome/browser/views/bookmark_manager_view.cc b/chrome/browser/views/bookmark_manager_view.cc
index 12150c6..585f6a4 100644
--- a/chrome/browser/views/bookmark_manager_view.cc
+++ b/chrome/browser/views/bookmark_manager_view.cc
@@ -716,14 +716,16 @@ void BookmarkManagerView::ShowImportBookmarksFileChooser() {
if (select_file_dialog_.get())
select_file_dialog_->ListenerDestroyed();
- std::wstring filter_string =
- win_util::GetFileFilterFromExtensions(L"*.html;*.htm", true);
+ SelectFileDialog::FileTypeInfo file_type_info;
+ file_type_info.extensions.resize(1);
+ file_type_info.extensions[0].push_back(FILE_PATH_LITERAL("html"));
+ file_type_info.extensions[0].push_back(FILE_PATH_LITERAL("htm"));
+ file_type_info.include_all_files = true;
select_file_dialog_ = SelectFileDialog::Create(this);
select_file_dialog_->SelectFile(
SelectFileDialog::SELECT_OPEN_FILE, std::wstring(),
- FilePath(FILE_PATH_LITERAL("bookmarks.html")), filter_string, 0,
- std::wstring(),
- GetWidget()->GetNativeView(),
+ FilePath(FILE_PATH_LITERAL("bookmarks.html")), &file_type_info, 0,
+ std::wstring(), GetWidget()->GetNativeView(),
reinterpret_cast<void*>(IDS_BOOKMARK_MANAGER_IMPORT_MENU));
}
@@ -731,11 +733,14 @@ void BookmarkManagerView::ShowExportBookmarksFileChooser() {
if (select_file_dialog_.get())
select_file_dialog_->ListenerDestroyed();
+ SelectFileDialog::FileTypeInfo file_type_info;
+ file_type_info.extensions.resize(1);
+ file_type_info.extensions[0].push_back(FILE_PATH_LITERAL("html"));
+ file_type_info.include_all_files = true;
select_file_dialog_ = SelectFileDialog::Create(this);
select_file_dialog_->SelectFile(
SelectFileDialog::SELECT_SAVEAS_FILE, std::wstring(),
- FilePath(FILE_PATH_LITERAL("bookmarks.html")),
- win_util::GetFileFilterFromPath(L"bookmarks.html"), 0, L"html",
- GetWidget()->GetNativeView(),
+ FilePath(FILE_PATH_LITERAL("bookmarks.html")), &file_type_info, 0,
+ L"html", GetWidget()->GetNativeView(),
reinterpret_cast<void*>(IDS_BOOKMARK_MANAGER_EXPORT_MENU));
}