forked from adamlaska/electron
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathplugin_utils.h
More file actions
35 lines (27 loc) · 1.11 KB
/
plugin_utils.h
File metadata and controls
35 lines (27 loc) · 1.11 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
// 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.
#ifndef ELECTRON_SHELL_BROWSER_PLUGINS_PLUGIN_UTILS_H_
#define ELECTRON_SHELL_BROWSER_PLUGINS_PLUGIN_UTILS_H_
#include <string>
#include "base/containers/flat_map.h"
namespace content {
class BrowserContext;
}
class PluginUtils {
public:
// disable copy
PluginUtils() = delete;
PluginUtils(const PluginUtils&) = delete;
PluginUtils& operator=(const PluginUtils&) = delete;
// 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);
};
#endif // ELECTRON_SHELL_BROWSER_PLUGINS_PLUGIN_UTILS_H_