#include "chrome/browser/importer/profile_writer.h"
#include <stddef.h>
#include <map>
#include <set>
#include <string>
#include "base/ranges/algorithm.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/utf_string_conversions.h"
#include "base/threading/thread.h"
#include "chrome/browser/bookmarks/bookmark_model_factory.h"
#include "chrome/browser/favicon/favicon_service_factory.h"
#include "chrome/browser/first_run/first_run.h"
#include "chrome/browser/history/history_service_factory.h"
#include "chrome/browser/password_manager/profile_password_store_factory.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/search_engines/template_url_service_factory.h"
#include "chrome/browser/webdata_services/web_data_service_factory.h"
#include "chrome/common/importer/imported_bookmark_entry.h"
#include "chrome/common/pref_names.h"
#include "components/autofill/core/browser/webdata/autofill_webdata_service.h"
#include "components/bookmarks/browser/bookmark_model.h"
#include "components/bookmarks/common/bookmark_pref_names.h"
#include "components/favicon/core/favicon_service.h"
#include "components/history/core/browser/history_service.h"
#include "components/password_manager/core/browser/password_form.h"
#include "components/password_manager/core/browser/password_store/password_store_interface.h"
#include "components/password_manager/core/common/password_manager_pref_names.h"
#include "components/prefs/pref_service.h"
#include "components/search_engines/template_url.h"
#include "components/search_engines/template_url_service.h"
BookmarkModel;
BookmarkNode;
namespace {
std::u16string GenerateUniqueFolderName(BookmarkModel* model,
const std::u16string& folder_name) { … }
void ShowBookmarkBar(Profile* profile) { … }
}
ProfileWriter::ProfileWriter(Profile* profile) : … { … }
bool ProfileWriter::BookmarkModelIsLoaded() const { … }
bool ProfileWriter::TemplateURLServiceIsLoaded() const { … }
void ProfileWriter::AddPasswordForm(
const password_manager::PasswordForm& form) { … }
void ProfileWriter::AddHistoryPage(const history::URLRows& page,
history::VisitSource visit_source) { … }
void ProfileWriter::AddHomepage(const GURL& home_page) { … }
void ProfileWriter::AddBookmarks(
const std::vector<ImportedBookmarkEntry>& bookmarks,
const std::u16string& top_level_folder_name) { … }
void ProfileWriter::AddFavicons(
const favicon_base::FaviconUsageDataList& favicons) { … }
HostPathMap;
static std::string HostPathKeyForURL(const GURL& url) { … }
static std::string BuildHostPathKey(const TemplateURL* t_url,
const SearchTermsData& search_terms_data,
bool try_url_if_invalid) { … }
static void BuildHostPathMap(TemplateURLService* model,
HostPathMap* host_path_map) { … }
void ProfileWriter::AddKeywords(
TemplateURLService::OwnedTemplateURLVector template_urls,
bool unique_on_host_and_path) { … }
void ProfileWriter::AddAutocompleteFormDataEntries(
const std::vector<autofill::AutocompleteEntry>& autocomplete_entries) { … }
ProfileWriter::~ProfileWriter() { … }