OLD | NEW |
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "chrome/browser/views/bookmark_manager_view.h" | 5 #include "chrome/browser/views/bookmark_manager_view.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "base/gfx/skia_utils.h" | 9 #include "base/gfx/skia_utils.h" |
10 #include "chrome/app/locales/locale_settings.h" | 10 #include "chrome/app/locales/locale_settings.h" |
(...skipping 667 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
678 menu.AppendMenuItemWithLabel( | 678 menu.AppendMenuItemWithLabel( |
679 IDS_BOOKMARK_MANAGER_EXPORT_MENU, | 679 IDS_BOOKMARK_MANAGER_EXPORT_MENU, |
680 l10n_util::GetString(IDS_BOOKMARK_MANAGER_EXPORT_MENU)); | 680 l10n_util::GetString(IDS_BOOKMARK_MANAGER_EXPORT_MENU)); |
681 menu.RunMenuAt(GetWidget()->GetHWND(), gfx::Rect(x, y, 0, 0), | 681 menu.RunMenuAt(GetWidget()->GetHWND(), gfx::Rect(x, y, 0, 0), |
682 views::MenuItemView::TOPLEFT, true); | 682 views::MenuItemView::TOPLEFT, true); |
683 } | 683 } |
684 | 684 |
685 // The filter used when opening a file. | 685 // The filter used when opening a file. |
686 // TODO(sky): need a textual description here once we can add new | 686 // TODO(sky): need a textual description here once we can add new |
687 // strings. | 687 // strings. |
688 static const wchar_t KFilterString[] = L"*.html\0*.html\0"; | 688 static const wchar_t KFilterString[] = L"*.html\0*.html;*.htm\0"; |
689 | 689 |
690 void BookmarkManagerView::ShowImportBookmarksFileChooser() { | 690 void BookmarkManagerView::ShowImportBookmarksFileChooser() { |
691 if (select_file_dialog_.get()) | 691 if (select_file_dialog_.get()) |
692 select_file_dialog_->ListenerDestroyed(); | 692 select_file_dialog_->ListenerDestroyed(); |
693 | 693 |
694 std::wstring filter_string(KFilterString, arraysize(KFilterString)); | 694 std::wstring filter_string(KFilterString, arraysize(KFilterString)); |
695 select_file_dialog_ = SelectFileDialog::Create(this); | 695 select_file_dialog_ = SelectFileDialog::Create(this); |
696 select_file_dialog_->SelectFile( | 696 select_file_dialog_->SelectFile( |
697 SelectFileDialog::SELECT_OPEN_FILE, std::wstring(), L"bookmarks.html", | 697 SelectFileDialog::SELECT_OPEN_FILE, std::wstring(), L"bookmarks.html", |
698 filter_string, std::wstring(), GetWidget()->GetHWND(), | 698 filter_string, std::wstring(), GetWidget()->GetHWND(), |
699 reinterpret_cast<void*>(IDS_BOOKMARK_MANAGER_IMPORT_MENU)); | 699 reinterpret_cast<void*>(IDS_BOOKMARK_MANAGER_IMPORT_MENU)); |
700 } | 700 } |
701 | 701 |
702 void BookmarkManagerView::ShowExportBookmarksFileChooser() { | 702 void BookmarkManagerView::ShowExportBookmarksFileChooser() { |
703 if (select_file_dialog_.get()) | 703 if (select_file_dialog_.get()) |
704 select_file_dialog_->ListenerDestroyed(); | 704 select_file_dialog_->ListenerDestroyed(); |
705 | 705 |
706 select_file_dialog_ = SelectFileDialog::Create(this); | 706 select_file_dialog_ = SelectFileDialog::Create(this); |
707 select_file_dialog_->SelectFile( | 707 select_file_dialog_->SelectFile( |
708 SelectFileDialog::SELECT_SAVEAS_FILE, std::wstring(), L"bookmarks.html", | 708 SelectFileDialog::SELECT_SAVEAS_FILE, std::wstring(), L"bookmarks.html", |
709 win_util::GetFileFilterFromPath(L"bookmarks.html"), L"html", | 709 win_util::GetFileFilterFromPath(L"bookmarks.html"), L"html", |
710 GetWidget()->GetHWND(), | 710 GetWidget()->GetHWND(), |
711 reinterpret_cast<void*>(IDS_BOOKMARK_MANAGER_EXPORT_MENU)); | 711 reinterpret_cast<void*>(IDS_BOOKMARK_MANAGER_EXPORT_MENU)); |
712 } | 712 } |
OLD | NEW |