2020-02-13 00:39:12 +00:00
|
|
|
// Copyright 2016 The Chromium Authors. All rights reserved.
|
|
|
|
// Use of this source code is governed by a BSD-style license that can be
|
|
|
|
// found in the LICENSE file.
|
|
|
|
|
2021-11-22 07:34:31 +00:00
|
|
|
#ifndef ELECTRON_SHELL_BROWSER_PLUGINS_PLUGIN_UTILS_H_
|
|
|
|
#define ELECTRON_SHELL_BROWSER_PLUGINS_PLUGIN_UTILS_H_
|
2020-02-13 00:39:12 +00:00
|
|
|
|
|
|
|
#include <string>
|
|
|
|
|
|
|
|
#include "base/containers/flat_map.h"
|
|
|
|
|
|
|
|
namespace content {
|
|
|
|
class BrowserContext;
|
|
|
|
}
|
|
|
|
|
|
|
|
class PluginUtils {
|
|
|
|
public:
|
2021-11-03 11:41:45 +00:00
|
|
|
// disable copy
|
|
|
|
PluginUtils(const PluginUtils&) = delete;
|
|
|
|
PluginUtils& operator=(const PluginUtils&) = delete;
|
|
|
|
|
2020-02-13 00:39:12 +00:00
|
|
|
// If there's an extension that is allowed to handle |mime_type|, returns its
|
|
|
|
// ID. Otherwise returns an empty string.
|
|
|
|
static std::string GetExtensionIdForMimeType(
|
|
|
|
content::BrowserContext* browser_context,
|
|
|
|
const std::string& mime_type);
|
|
|
|
|
|
|
|
// Returns a map populated with MIME types that are handled by an extension as
|
|
|
|
// keys and the corresponding extensions Ids as values.
|
|
|
|
static base::flat_map<std::string, std::string> GetMimeTypeToExtensionIdMap(
|
|
|
|
content::BrowserContext* browser_context);
|
|
|
|
};
|
|
|
|
|
2021-11-22 07:34:31 +00:00
|
|
|
#endif // ELECTRON_SHELL_BROWSER_PLUGINS_PLUGIN_UTILS_H_
|