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

Side by Side Diff: chrome/utility/importer/bookmark_html_reader.h

Issue 1873403003: Read bookmarks from 'NETSCAPE-Bookmark-file's that don't have a beginning <DT> tag. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed failing tests Created 4 years, 8 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 #ifndef CHROME_UTILITY_IMPORTER_BOOKMARK_HTML_READER_H_ 5 #ifndef CHROME_UTILITY_IMPORTER_BOOKMARK_HTML_READER_H_
6 #define CHROME_UTILITY_IMPORTER_BOOKMARK_HTML_READER_H_ 6 #define CHROME_UTILITY_IMPORTER_BOOKMARK_HTML_READER_H_
7 7
8 #include <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
65 // <DT><H3 PERSONAL_TOOLBAR_FOLDER="true" ...>title</H3> 65 // <DT><H3 PERSONAL_TOOLBAR_FOLDER="true" ...>title</H3>
66 // <DL><p> 66 // <DL><p>
67 // ... container ... 67 // ... container ...
68 // </DL><p> 68 // </DL><p>
69 // And a bookmark is presented by a <A> tag: 69 // And a bookmark is presented by a <A> tag:
70 // <DT><A HREF="url" SHORTCUTURL="shortcut" ADD_DATE="11213014"...>name</A> 70 // <DT><A HREF="url" SHORTCUTURL="shortcut" ADD_DATE="11213014"...>name</A>
71 // Reference: http://kb.mozillazine.org/Bookmarks.html 71 // Reference: http://kb.mozillazine.org/Bookmarks.html
72 72
73 bool ParseCharsetFromLine(const std::string& line, 73 bool ParseCharsetFromLine(const std::string& line,
74 std::string* charset); 74 std::string* charset);
75 bool ParseFolderNameFromLine(const std::string& line, 75 bool ParseFolderNameFromLine(std::string line,
76 const std::string& charset, 76 const std::string& charset,
77 base::string16* folder_name, 77 base::string16* folder_name,
78 bool* is_toolbar_folder, 78 bool* is_toolbar_folder,
79 base::Time* add_date); 79 base::Time* add_date);
80 // See above, this will also put the data: URL of the favicon into |*favicon| 80 // See above, this will also put the data: URL of the favicon into |*favicon|
81 // if there is a favicon given. |post_data| is set for POST base keywords to 81 // if there is a favicon given. |post_data| is set for POST base keywords to
82 // the contents of the actual POST (with %s for the search term). 82 // the contents of the actual POST (with %s for the search term).
83 bool ParseBookmarkFromLine(const std::string& line, 83 bool ParseBookmarkFromLine(std::string line,
84 const std::string& charset, 84 const std::string& charset,
85 base::string16* title, 85 base::string16* title,
86 GURL* url, 86 GURL* url,
87 GURL* favicon, 87 GURL* favicon,
88 base::string16* shortcut, 88 base::string16* shortcut,
89 base::Time* add_date, 89 base::Time* add_date,
90 base::string16* post_data); 90 base::string16* post_data);
91 // Save bookmarks imported from browsers with Firefox 2 compatible bookmark 91 // Save bookmarks imported from browsers with Firefox 2 compatible bookmark
92 // systems such as Epiphany. This bookmark format is the same as that of the 92 // systems such as Epiphany. This bookmark format is the same as that of the
93 // basic Firefox 2 bookmark, but it misses additional properties and uses 93 // basic Firefox 2 bookmark, but it misses additional properties and uses
94 // lower-case tag: 94 // lower-case tag:
95 // ...<h1>Bookmarks</h1><dl> 95 // ...<h1>Bookmarks</h1><dl>
96 // <dt><a href="url">name</a></dt> 96 // <dt><a href="url">name</a></dt>
97 // <dt><a href="url">name</a></dt> 97 // <dt><a href="url">name</a></dt>
98 // </dl> 98 // </dl>
99 bool ParseMinimumBookmarkFromLine(const std::string& line, 99 bool ParseMinimumBookmarkFromLine(std::string line,
100 const std::string& charset, 100 const std::string& charset,
101 base::string16* title, 101 base::string16* title,
102 GURL* url); 102 GURL* url);
103 103
104 } // namespace internal 104 } // namespace internal
105 105
106 } // namespace bookmark_html_reader 106 } // namespace bookmark_html_reader
107 107
108 #endif // CHROME_UTILITY_IMPORTER_BOOKMARK_HTML_READER_H_ 108 #endif // CHROME_UTILITY_IMPORTER_BOOKMARK_HTML_READER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698