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

Side by Side Diff: chrome/utility/importer/bookmarks_file_importer.cc

Issue 616763002: Importing certain bookmarks from firefox and HTML file as search engines. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed comments Created 6 years, 2 months 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 unified diff | Download patch
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/utility/importer/bookmarks_file_importer.h" 5 #include "chrome/utility/importer/bookmarks_file_importer.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "chrome/common/importer/imported_bookmark_entry.h" 8 #include "chrome/common/importer/imported_bookmark_entry.h"
9 #include "chrome/common/importer/imported_favicon_usage.h" 9 #include "chrome/common/importer/imported_favicon_usage.h"
10 #include "chrome/common/importer/importer_bridge.h" 10 #include "chrome/common/importer/importer_bridge.h"
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
83 uint16 items, 83 uint16 items,
84 ImporterBridge* bridge) { 84 ImporterBridge* bridge) {
85 // The only thing this importer can import is a bookmarks file, aka 85 // The only thing this importer can import is a bookmarks file, aka
86 // "favorites". 86 // "favorites".
87 DCHECK_EQ(importer::FAVORITES, items); 87 DCHECK_EQ(importer::FAVORITES, items);
88 88
89 bridge->NotifyStarted(); 89 bridge->NotifyStarted();
90 bridge->NotifyItemStarted(importer::FAVORITES); 90 bridge->NotifyItemStarted(importer::FAVORITES);
91 91
92 std::vector<ImportedBookmarkEntry> bookmarks; 92 std::vector<ImportedBookmarkEntry> bookmarks;
93 std::vector<importer::URLKeywordInfo> url_keywords;
93 std::vector<ImportedFaviconUsage> favicons; 94 std::vector<ImportedFaviconUsage> favicons;
94 95
95 bookmark_html_reader::ImportBookmarksFile( 96 bookmark_html_reader::ImportBookmarksFile(
96 base::Bind(IsImporterCancelled, base::Unretained(this)), 97 base::Bind(IsImporterCancelled, base::Unretained(this)),
97 base::Bind(internal::CanImportURL), 98 base::Bind(internal::CanImportURL),
98 source_profile.source_path, 99 source_profile.source_path,
99 &bookmarks, 100 &bookmarks,
101 &url_keywords,
100 &favicons); 102 &favicons);
101 103
102 if (!bookmarks.empty() && !cancelled()) { 104 if (!bookmarks.empty() && !cancelled()) {
103 base::string16 first_folder_name = 105 base::string16 first_folder_name =
104 bridge->GetLocalizedString(IDS_BOOKMARK_GROUP); 106 bridge->GetLocalizedString(IDS_BOOKMARK_GROUP);
105 bridge->AddBookmarks(bookmarks, first_folder_name); 107 bridge->AddBookmarks(bookmarks, first_folder_name);
106 } 108 }
109 if (!url_keywords.empty() && !cancelled()) {
Peter Kasting 2014/10/07 23:17:39 If we're supposed to check cancelled() here, are w
Tapu Ghose 2014/10/12 00:58:21 Removed check for cancelled().
110 bridge->SetKeywords(url_keywords, false);
111 }
107 if (!favicons.empty()) 112 if (!favicons.empty())
108 bridge->SetFavicons(favicons); 113 bridge->SetFavicons(favicons);
109 114
110 bridge->NotifyItemEnded(importer::FAVORITES); 115 bridge->NotifyItemEnded(importer::FAVORITES);
111 bridge->NotifyEnded(); 116 bridge->NotifyEnded();
112 } 117 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698