chromium/chrome/browser/web_applications/os_integration/web_app_file_handler_registration_linux.cc

// Copyright 2019 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/browser/web_applications/os_integration/web_app_file_handler_registration.h"

#include <memory>
#include <string>
#include <vector>

#include "base/check_is_test.h"
#include "base/environment.h"
#include "base/files/file_path.h"
#include "base/files/file_util.h"
#include "base/files/scoped_temp_dir.h"
#include "base/functional/bind.h"
#include "base/functional/callback.h"
#include "base/functional/callback_helpers.h"
#include "base/memory/scoped_refptr.h"
#include "base/metrics/histogram_functions.h"
#include "base/metrics/histogram_macros.h"
#include "base/nix/xdg_util.h"
#include "base/no_destructor.h"
#include "base/strings/string_util.h"
#include "chrome/browser/shell_integration_linux.h"
#include "chrome/browser/web_applications/os_integration/os_integration_manager.h"
#include "chrome/browser/web_applications/os_integration/os_integration_test_override.h"
#include "chrome/browser/web_applications/os_integration/web_app_shortcut.h"

namespace web_app {

namespace {

// Result of registering file handlers.
// These values are persisted to logs. Entries should not be renumbered and
// numeric values should never be reused.
enum class RegistrationResult {};

// UMA metric name for MIME type registration result.
constexpr const char* kRegistrationResultMetric =;

// UMA metric name for MIME type unregistration result.
constexpr const char* kUnregistrationResultMetric =;

// Records UMA metric for result of MIME type registration/unregistration.
void RecordRegistration(RegistrationResult result, bool install) {}

void OnMimeInfoDatabaseUpdated(bool install,
                               ResultCallback result_callback,
                               bool registration_succeeded) {}

UpdateMimeInfoDatabaseOnLinuxCallback&
GetUpdateMimeInfoDatabaseCallbackForTesting() {}

void RefreshMimeInfoCache() {}

bool UpdateMimeInfoDatabase(bool install,
                            base::FilePath filename,
                            std::string file_contents) {}

void UninstallMimeInfoOnLinux(const webapps::AppId& app_id,
                              const base::FilePath& profile_path,
                              ResultCallback on_done) {}

}  // namespace

bool ShouldRegisterFileHandlersWithOs() {}

bool FileHandlingIconsSupportedByOs() {}

void RegisterFileHandlersWithOs(const webapps::AppId& app_id,
                                const std::string& app_name,
                                const base::FilePath& profile_path,
                                const apps::FileHandlers& file_handlers,
                                ResultCallback callback) {}

void UnregisterFileHandlersWithOs(const webapps::AppId& app_id,
                                  const base::FilePath& profile_path,
                                  ResultCallback callback) {}

void InstallMimeInfoOnLinux(const webapps::AppId& app_id,
                            const base::FilePath& profile_path,
                            const apps::FileHandlers& file_handlers,
                            ResultCallback done_callback) {}

void SetUpdateMimeInfoDatabaseOnLinuxCallbackForTesting(  // IN-TEST
    UpdateMimeInfoDatabaseOnLinuxCallback callback) {}

}  // namespace web_app