#include "chrome/utility/importer/bookmark_html_reader.h"
#include <stddef.h>
#include <stdint.h>
#include "base/files/file_util.h"
#include "base/functional/callback.h"
#include "base/i18n/icu_string_conversions.h"
#include "base/strings/escape.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/string_split.h"
#include "base/strings/string_util.h"
#include "base/strings/utf_string_conversions.h"
#include "base/time/time.h"
#include "chrome/common/importer/imported_bookmark_entry.h"
#include "chrome/utility/importer/favicon_reencode.h"
#include "components/search_engines/search_terms_data.h"
#include "components/search_engines/template_url.h"
#include "net/base/data_url.h"
#include "url/gurl.h"
#include "url/url_constants.h"
namespace {
bool GetAttribute(const std::string& attribute_list,
const std::string& attribute,
std::string* value) { … }
void DataURLToFaviconUsage(const GURL& link_url,
const GURL& favicon_data,
favicon_base::FaviconUsageDataList* favicons) { … }
}
namespace bookmark_html_reader {
static std::string stripDt(const std::string& lineDt) { … }
void ImportBookmarksFile(
base::RepeatingCallback<bool(void)> cancellation_callback,
base::RepeatingCallback<bool(const GURL&)> valid_url_callback,
const base::FilePath& file_path,
std::vector<ImportedBookmarkEntry>* bookmarks,
std::vector<importer::SearchEngineInfo>* search_engines,
favicon_base::FaviconUsageDataList* favicons) { … }
bool CanImportURLAsSearchEngine(const GURL& url,
std::string* search_engine_url) { … }
namespace internal {
bool ParseCharsetFromLine(const std::string& line, std::string* charset) { … }
bool ParseFolderNameFromLine(const std::string& lineDt,
const std::string& charset,
std::u16string* folder_name,
bool* is_toolbar_folder,
base::Time* add_date) { … }
bool ParseBookmarkFromLine(const std::string& lineDt,
const std::string& charset,
std::u16string* title,
GURL* url,
GURL* favicon,
std::u16string* shortcut,
base::Time* add_date,
std::u16string* post_data) { … }
bool ParseMinimumBookmarkFromLine(const std::string& lineDt,
const std::string& charset,
std::u16string* title,
GURL* url) { … }
}
}