OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/extensions/extension_bookmarks_module.h" | 5 #include "chrome/browser/extensions/extension_bookmarks_module.h" |
6 | 6 |
7 #include "base/json/json_writer.h" | 7 #include "base/json/json_writer.h" |
8 #include "base/sha1.h" | 8 #include "base/sha1.h" |
9 #include "base/stl_util-inl.h" | 9 #include "base/stl_util-inl.h" |
10 #include "base/string16.h" | 10 #include "base/string16.h" |
(...skipping 744 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
755 void UpdateBookmarkFunction::GetQuotaLimitHeuristics( | 755 void UpdateBookmarkFunction::GetQuotaLimitHeuristics( |
756 QuotaLimitHeuristics* heuristics) const { | 756 QuotaLimitHeuristics* heuristics) const { |
757 BookmarksQuotaLimitFactory::Build<UpdateBookmarkFunction>(heuristics); | 757 BookmarksQuotaLimitFactory::Build<UpdateBookmarkFunction>(heuristics); |
758 }; | 758 }; |
759 | 759 |
760 void CreateBookmarkFunction::GetQuotaLimitHeuristics( | 760 void CreateBookmarkFunction::GetQuotaLimitHeuristics( |
761 QuotaLimitHeuristics* heuristics) const { | 761 QuotaLimitHeuristics* heuristics) const { |
762 BookmarksQuotaLimitFactory::BuildForCreate(heuristics, profile()); | 762 BookmarksQuotaLimitFactory::BuildForCreate(heuristics, profile()); |
763 } | 763 } |
764 | 764 |
| 765 BookmarksIOFunction::BookmarksIOFunction() {} |
| 766 |
| 767 BookmarksIOFunction::~BookmarksIOFunction() {} |
| 768 |
765 void BookmarksIOFunction::SelectFile(SelectFileDialog::Type type) { | 769 void BookmarksIOFunction::SelectFile(SelectFileDialog::Type type) { |
766 // Balanced in one of the three callbacks of SelectFileDialog: | 770 // Balanced in one of the three callbacks of SelectFileDialog: |
767 // either FileSelectionCanceled, MultiFilesSelected, or FileSelected | 771 // either FileSelectionCanceled, MultiFilesSelected, or FileSelected |
768 AddRef(); | 772 AddRef(); |
769 select_file_dialog_ = SelectFileDialog::Create(this); | 773 select_file_dialog_ = SelectFileDialog::Create(this); |
770 SelectFileDialog::FileTypeInfo file_type_info; | 774 SelectFileDialog::FileTypeInfo file_type_info; |
771 file_type_info.extensions.resize(1); | 775 file_type_info.extensions.resize(1); |
772 file_type_info.extensions[0].push_back(FILE_PATH_LITERAL("html")); | 776 file_type_info.extensions[0].push_back(FILE_PATH_LITERAL("html")); |
773 | 777 |
774 select_file_dialog_->SelectFile(type, | 778 select_file_dialog_->SelectFile(type, |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
815 SelectFile(SelectFileDialog::SELECT_SAVEAS_FILE); | 819 SelectFile(SelectFileDialog::SELECT_SAVEAS_FILE); |
816 return true; | 820 return true; |
817 } | 821 } |
818 | 822 |
819 void ExportBookmarksFunction::FileSelected(const FilePath& path, | 823 void ExportBookmarksFunction::FileSelected(const FilePath& path, |
820 int index, | 824 int index, |
821 void* params) { | 825 void* params) { |
822 bookmark_html_writer::WriteBookmarks(profile(), path, NULL); | 826 bookmark_html_writer::WriteBookmarks(profile(), path, NULL); |
823 Release(); // Balanced in BookmarksIOFunction::SelectFile() | 827 Release(); // Balanced in BookmarksIOFunction::SelectFile() |
824 } | 828 } |
OLD | NEW |