chromium/components/filename_generation/filename_generation.cc

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

#include "components/filename_generation/filename_generation.h"

#include "base/check.h"
#include "base/files/file_path.h"
#include "base/files/file_util.h"
#include "base/i18n/file_util_icu.h"
#include "base/strings/string_util.h"
#include "base/strings/sys_string_conversions.h"
#include "base/strings/utf_string_conversions.h"
#include "base/third_party/icu/icu_utf.h"
#include "build/build_config.h"
#include "build/chromeos_buildflags.h"
#include "components/url_formatter/url_formatter.h"
#include "net/base/filename_util.h"
#include "net/base/mime_util.h"
#include "url/gurl.h"

namespace filename_generation {

namespace {

// The lower bound for file name truncation. If the truncation results in a name
// shorter than this limit, we give up automatic truncation and prompt the user.
const size_t kTruncatedNameLengthLowerbound =;

const base::FilePath::CharType kDefaultHtmlExtension[] =);

// Check whether we can save page as complete-HTML for the contents which
// have specified a MIME type. Now only contents which have the MIME type
// "text/html" can be saved as complete-HTML.
bool CanSaveAsComplete(const std::string& contents_mime_type) {}

}  // namespace

const base::FilePath::CharType* ExtensionForMimeType(
    const std::string& contents_mime_type) {}

base::FilePath EnsureHtmlExtension(const base::FilePath& name) {}

base::FilePath EnsureMimeExtension(const base::FilePath& name,
                                   const std::string& contents_mime_type) {}

base::FilePath GenerateFilename(const std::u16string& title,
                                const GURL& url,
                                bool can_save_as_complete,
                                std::string contents_mime_type) {}

bool TruncateFilename(base::FilePath* path, size_t limit) {}

}  // namespace filename_generation