Chromium Code Reviews| Index: chrome/utility/importer/bookmark_html_reader.cc |
| diff --git a/chrome/utility/importer/bookmark_html_reader.cc b/chrome/utility/importer/bookmark_html_reader.cc |
| index 5d34d7b191a817ce63ad6cf27df6cf68d6a56ce1..f2bfef139cced7bc2099e068cbdda9df893982e3 100644 |
| --- a/chrome/utility/importer/bookmark_html_reader.cc |
| +++ b/chrome/utility/importer/bookmark_html_reader.cc |
| @@ -92,6 +92,7 @@ void ImportBookmarksFile( |
| const base::FilePath& file_path, |
| std::vector<ImportedBookmarkEntry>* bookmarks, |
| std::vector<ImportedFaviconUsage>* favicons) { |
| + const std::string kHrTag = "<HR>"; |
|
gab
2013/08/09 13:27:30
All string constants should be of the form:
stat
|
| std::string content; |
| file_util::ReadFileToString(file_path, &content); |
| std::vector<std::string> lines; |
| @@ -112,6 +113,10 @@ void ImportBookmarksFile( |
| std::string line; |
| TrimString(lines[i], " ", &line); |
| + // Remove "<HR>" if |line| starts with it. See http://crbug.com/257474. |
| + if (StartsWithASCII(line, kHrTag, false)) |
| + TrimString(line.substr(kHrTag.size()), " ", &line); |
|
gab
2013/08/09 13:27:30
use "arraysize(kHrTag)" here instead of kHrTag.siz
gab
2013/08/09 13:27:30
This line is slightly tricky and it creates a new
zhchbin
2013/08/09 14:20:00
Can you accept
line.erase(0, arraysize(kHrTag) -
gab
2013/08/09 14:29:03
Ah, right, yes, because the actual arraysize inclu
|
| + |
| // Get the encoding of the bookmark file. |
| if (internal::ParseCharsetFromLine(line, &charset)) |
| continue; |