diff options
author | feldstein@chromium.org <feldstein@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-03-26 21:40:55 +0000 |
---|---|---|
committer | feldstein@chromium.org <feldstein@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-03-26 21:40:55 +0000 |
commit | dc0412127385b73df3647ebfb313b61e51ef1496 (patch) | |
tree | f1a6db934166721bf81c80909d87fd6a15565dd3 /chrome/browser/extensions/extension_bookmark_manager_api.cc | |
parent | 31db0071f84abe836f54218bd9240adb847d3211 (diff) | |
download | chromium_src-dc0412127385b73df3647ebfb313b61e51ef1496.zip chromium_src-dc0412127385b73df3647ebfb313b61e51ef1496.tar.gz chromium_src-dc0412127385b73df3647ebfb313b61e51ef1496.tar.bz2 |
Move onImportBegan/Ended to the regular bookmarks api
It used to live in the experimental.bookmarkManager namespace.
BUG=35320
TEST=none
Review URL: http://codereview.chromium.org/1353004
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@42825 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/extensions/extension_bookmark_manager_api.cc')
-rw-r--r-- | chrome/browser/extensions/extension_bookmark_manager_api.cc | 64 |
1 files changed, 0 insertions, 64 deletions
diff --git a/chrome/browser/extensions/extension_bookmark_manager_api.cc b/chrome/browser/extensions/extension_bookmark_manager_api.cc index ff29fab..def7eeb 100644 --- a/chrome/browser/extensions/extension_bookmark_manager_api.cc +++ b/chrome/browser/extensions/extension_bookmark_manager_api.cc @@ -12,14 +12,11 @@ #include "base/values.h" #include "chrome/browser/bookmarks/bookmark_drag_data.h" #include "chrome/browser/bookmarks/bookmark_model.h" -#include "chrome/browser/bookmarks/bookmark_html_writer.h" #include "chrome/browser/bookmarks/bookmark_utils.h" #include "chrome/browser/dom_ui/chrome_url_data_manager.h" #include "chrome/browser/extensions/extension_bookmarks_module_constants.h" #include "chrome/browser/extensions/extension_dom_ui.h" #include "chrome/browser/extensions/extension_message_service.h" -#include "chrome/browser/importer/importer.h" -#include "chrome/browser/importer/importer_data_types.h" #include "chrome/browser/profile.h" #include "chrome/browser/renderer_host/render_view_host.h" #include "chrome/browser/tab_contents/tab_contents.h" @@ -251,67 +248,6 @@ bool CanPasteBookmarkManagerFunction::RunImpl() { return true; } -void BookmarkManagerIOFunction::SelectFile(SelectFileDialog::Type type) { - // Balanced in one of the three callbacks of SelectFileDialog: - // either FileSelectionCanceled, MultiFilesSelected, or FileSelected - AddRef(); - select_file_dialog_ = SelectFileDialog::Create(this); - SelectFileDialog::FileTypeInfo file_type_info; - file_type_info.extensions.resize(1); - file_type_info.extensions[0].push_back(FILE_PATH_LITERAL("html")); - - select_file_dialog_->SelectFile(type, - string16(), - FilePath(), - &file_type_info, - 0, - FILE_PATH_LITERAL(""), - NULL, - NULL); -} - -void BookmarkManagerIOFunction::FileSelectionCanceled(void* params) { - Release(); // Balanced in BookmarkManagerIOFunction::SelectFile() -} - -void BookmarkManagerIOFunction::MultiFilesSelected( - const std::vector<FilePath>& files, void* params) { - Release(); // Balanced in BookmarkManagerIOFunction::SelectFile() - NOTREACHED() << "Should not be able to select multiple files"; -} - -bool ImportBookmarksFunction::RunImpl() { - SelectFile(SelectFileDialog::SELECT_OPEN_FILE); - return true; -} - -void ImportBookmarksFunction::FileSelected(const FilePath& path, - int index, - void* params) { - ImporterHost* host = new ImporterHost(); - importer::ProfileInfo profile_info; - profile_info.browser_type = importer::BOOKMARKS_HTML; - profile_info.source_path = path.ToWStringHack(); - host->StartImportSettings(profile_info, - profile(), - importer::FAVORITES, - new ProfileWriter(profile()), - true); - Release(); // Balanced in BookmarkManagerIOFunction::SelectFile() -} - -bool ExportBookmarksFunction::RunImpl() { - SelectFile(SelectFileDialog::SELECT_SAVEAS_FILE); - return true; -} - -void ExportBookmarksFunction::FileSelected(const FilePath& path, - int index, - void* params) { - bookmark_html_writer::WriteBookmarks(profile(), path, NULL); - Release(); // Balanced in BookmarkManagerIOFunction::SelectFile() -} - bool SortChildrenBookmarkManagerFunction::RunImpl() { BookmarkModel* model = profile()->GetBookmarkModel(); const BookmarkNode* parent_node = GetNodeFromArguments(model, args_.get()); |