summaryrefslogtreecommitdiffstats
path: root/extensions/common/permissions/permission_message_util.h
blob: 410e1a2816696ff4afa704d719211ddc3d0ccd1c (plain)
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
// Copyright 2014 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 EXTENSIONS_COMMON_PERMISSIONS_PERMISSION_MESSAGE_UTIL_H_
#define EXTENSIONS_COMMON_PERMISSIONS_PERMISSION_MESSAGE_UTIL_H_

#include <set>
#include <string>

namespace extensions {
class PermissionMessage;
class PermissionSet;
class URLPatternSet;
}

namespace permission_message_util {

// Creates the corresponding permission message for a list of hosts.
// The messages change depending on what hosts are present.
extensions::PermissionMessage CreateFromHostList(
    const std::set<std::string>& hosts);

std::set<std::string> GetDistinctHosts(
    const extensions::URLPatternSet& host_patterns,
    bool include_rcd,
    bool exclude_file_scheme);

}  // namespace permission_message_util

#endif  // EXTENSIONS_COMMON_PERMISSIONS_PERMISSION_MESSAGE_UTIL_H_