Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(88)

Unified Diff: chrome/browser/views/bookmark_manager_view.cc

Issue 10621: Adds the ability for save dialogs to take a default extension.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 12 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/shell_dialogs.h ('k') | chrome/browser/views/options/content_page_view.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/views/bookmark_manager_view.cc
===================================================================
--- chrome/browser/views/bookmark_manager_view.cc (revision 5130)
+++ chrome/browser/views/bookmark_manager_view.cc (working copy)
@@ -26,6 +26,7 @@
#include "chrome/common/gfx/color_utils.h"
#include "chrome/common/pref_names.h"
#include "chrome/common/pref_service.h"
+#include "chrome/common/win_util.h"
#include "chrome/views/container_win.h"
#include "chrome/views/grid_layout.h"
#include "chrome/views/menu_button.h"
@@ -683,18 +684,20 @@
views::MenuItemView::TOPLEFT, true);
}
+// The filter used when opening a file.
+// TODO(sky): need a textual description here once we can add new
+// strings.
+static const wchar_t filter_c_str[] = L"*.html\0*.html\0";
M-A Ruel 2008/11/12 17:28:02 Can you just name it kFilterStr so it's clear it's
+
void BookmarkManagerView::ShowImportBookmarksFileChooser() {
if (select_file_dialog_.get())
select_file_dialog_->ListenerDestroyed();
- // TODO(sky): need a textual description here once we can add new
- // strings.
- const wchar_t filter_c_str[] = L"*.html\0*.html\0\0\0";
std::wstring filter_string(filter_c_str, arraysize(filter_c_str));
select_file_dialog_ = SelectFileDialog::Create(this);
select_file_dialog_->SelectFile(
- SelectFileDialog::SELECT_OPEN_FILE, std::wstring(), std::wstring(),
- filter_string, GetContainer()->GetHWND(),
+ SelectFileDialog::SELECT_OPEN_FILE, std::wstring(), L"bookmarks.html",
+ filter_string, std::wstring(), GetContainer()->GetHWND(),
reinterpret_cast<void*>(IDS_BOOKMARK_MANAGER_IMPORT_MENU));
}
@@ -704,7 +707,8 @@
select_file_dialog_ = SelectFileDialog::Create(this);
select_file_dialog_->SelectFile(
- SelectFileDialog::SELECT_SAVEAS_FILE, std::wstring(), std::wstring(),
- std::wstring(), GetContainer()->GetHWND(),
+ SelectFileDialog::SELECT_SAVEAS_FILE, std::wstring(), L"bookmarks.html",
+ win_util::GetFileFilterFromPath(L"bookmarks.html"), L"html",
+ GetContainer()->GetHWND(),
reinterpret_cast<void*>(IDS_BOOKMARK_MANAGER_EXPORT_MENU));
}
« no previous file with comments | « chrome/browser/shell_dialogs.h ('k') | chrome/browser/views/options/content_page_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698