chromium/chrome/utility/importer/bookmark_html_reader.cc

// Copyright 2013 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#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 {

// Fetches the given |attribute| value from the |attribute_list|. Returns true
// if successful, and |value| will contain the value.
bool GetAttribute(const std::string& attribute_list,
                  const std::string& attribute,
                  std::string* value) {}

// Given the URL of a page and a favicon data URL, adds an appropriate record
// to the given favicon usage vector.
void DataURLToFaviconUsage(const GURL& link_url,
                           const GURL& favicon_data,
                           favicon_base::FaviconUsageDataList* favicons) {}

}  // namespace

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) {}

}  // namespace internal

}  // namespace bookmark_html_reader