OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/importer/firefox2_importer.h" | 5 #include "chrome/browser/importer/firefox2_importer.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/file_path.h" | 10 #include "base/file_path.h" |
(...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
198 &post_data) || | 198 &post_data) || |
199 ParseMinimumBookmarkFromLine(line, charset, &title, &url); | 199 ParseMinimumBookmarkFromLine(line, charset, &title, &url); |
200 | 200 |
201 if (is_bookmark) | 201 if (is_bookmark) |
202 last_folder_is_empty = false; | 202 last_folder_is_empty = false; |
203 | 203 |
204 if (is_bookmark && | 204 if (is_bookmark && |
205 post_data.empty() && | 205 post_data.empty() && |
206 CanImportURL(GURL(url)) && | 206 CanImportURL(GURL(url)) && |
207 default_urls.find(url) == default_urls.end()) { | 207 default_urls.find(url) == default_urls.end()) { |
208 if (toolbar_folder > path.size() && path.size() > 0) { | 208 if (toolbar_folder > path.size() && !path.empty()) { |
209 NOTREACHED(); // error in parsing. | 209 NOTREACHED(); // error in parsing. |
210 break; | 210 break; |
211 } | 211 } |
212 | 212 |
213 ProfileWriter::BookmarkEntry entry; | 213 ProfileWriter::BookmarkEntry entry; |
214 entry.creation_time = add_date; | 214 entry.creation_time = add_date; |
215 entry.url = url; | 215 entry.url = url; |
216 entry.title = title; | 216 entry.title = title; |
217 | 217 |
218 if (import_to_bookmark_bar && toolbar_folder) { | 218 if (import_to_bookmark_bar && toolbar_folder) { |
(...skipping 465 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
684 | 684 |
685 // We need to make up a URL for the favicon. We use a version of the page's | 685 // We need to make up a URL for the favicon. We use a version of the page's |
686 // URL so that we can be sure it will not collide. | 686 // URL so that we can be sure it will not collide. |
687 usage.favicon_url = GURL(std::string("made-up-favicon:") + link_url.spec()); | 687 usage.favicon_url = GURL(std::string("made-up-favicon:") + link_url.spec()); |
688 | 688 |
689 // We only have one URL per favicon for Firefox 2 bookmarks. | 689 // We only have one URL per favicon for Firefox 2 bookmarks. |
690 usage.urls.insert(link_url); | 690 usage.urls.insert(link_url); |
691 | 691 |
692 favicons->push_back(usage); | 692 favicons->push_back(usage); |
693 } | 693 } |
OLD | NEW |