OLD | NEW |
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 <stddef.h> |
| 8 |
7 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/macros.h" |
8 #include "chrome/common/importer/imported_bookmark_entry.h" | 11 #include "chrome/common/importer/imported_bookmark_entry.h" |
9 #include "chrome/common/importer/importer_bridge.h" | 12 #include "chrome/common/importer/importer_bridge.h" |
10 #include "chrome/common/importer/importer_data_types.h" | 13 #include "chrome/common/importer/importer_data_types.h" |
11 #include "chrome/common/url_constants.h" | 14 #include "chrome/common/url_constants.h" |
12 #include "chrome/grit/generated_resources.h" | 15 #include "chrome/grit/generated_resources.h" |
13 #include "chrome/utility/importer/bookmark_html_reader.h" | 16 #include "chrome/utility/importer/bookmark_html_reader.h" |
14 #include "components/favicon_base/favicon_usage_data.h" | 17 #include "components/favicon_base/favicon_usage_data.h" |
15 #include "components/url_formatter/url_fixer.h" | 18 #include "components/url_formatter/url_fixer.h" |
16 #include "content/public/common/url_constants.h" | 19 #include "content/public/common/url_constants.h" |
17 | 20 |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
73 } | 76 } |
74 | 77 |
75 } // namespace internal | 78 } // namespace internal |
76 | 79 |
77 BookmarksFileImporter::BookmarksFileImporter() {} | 80 BookmarksFileImporter::BookmarksFileImporter() {} |
78 | 81 |
79 BookmarksFileImporter::~BookmarksFileImporter() {} | 82 BookmarksFileImporter::~BookmarksFileImporter() {} |
80 | 83 |
81 void BookmarksFileImporter::StartImport( | 84 void BookmarksFileImporter::StartImport( |
82 const importer::SourceProfile& source_profile, | 85 const importer::SourceProfile& source_profile, |
83 uint16 items, | 86 uint16_t items, |
84 ImporterBridge* bridge) { | 87 ImporterBridge* bridge) { |
85 // The only thing this importer can import is a bookmarks file, aka | 88 // The only thing this importer can import is a bookmarks file, aka |
86 // "favorites". | 89 // "favorites". |
87 DCHECK_EQ(importer::FAVORITES, items); | 90 DCHECK_EQ(importer::FAVORITES, items); |
88 | 91 |
89 bridge->NotifyStarted(); | 92 bridge->NotifyStarted(); |
90 bridge->NotifyItemStarted(importer::FAVORITES); | 93 bridge->NotifyItemStarted(importer::FAVORITES); |
91 | 94 |
92 std::vector<ImportedBookmarkEntry> bookmarks; | 95 std::vector<ImportedBookmarkEntry> bookmarks; |
93 std::vector<importer::SearchEngineInfo> search_engines; | 96 std::vector<importer::SearchEngineInfo> search_engines; |
(...skipping 13 matching lines...) Expand all Loading... |
107 bridge->AddBookmarks(bookmarks, first_folder_name); | 110 bridge->AddBookmarks(bookmarks, first_folder_name); |
108 } | 111 } |
109 if (!search_engines.empty()) | 112 if (!search_engines.empty()) |
110 bridge->SetKeywords(search_engines, false); | 113 bridge->SetKeywords(search_engines, false); |
111 if (!favicons.empty()) | 114 if (!favicons.empty()) |
112 bridge->SetFavicons(favicons); | 115 bridge->SetFavicons(favicons); |
113 | 116 |
114 bridge->NotifyItemEnded(importer::FAVORITES); | 117 bridge->NotifyItemEnded(importer::FAVORITES); |
115 bridge->NotifyEnded(); | 118 bridge->NotifyEnded(); |
116 } | 119 } |
OLD | NEW |