summaryrefslogtreecommitdiffstats
path: root/extensions/browser/suggest_permission_util.h
blob: a10c345691e83b227051dcf92bef88c6d4ad8d83 (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
// Copyright (c) 2012 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_BROWSER_SUGGEST_PERMISSION_UTIL_H_
#define EXTENSIONS_BROWSER_SUGGEST_PERMISSION_UTIL_H_

#include "extensions/common/permissions/api_permission.h"

namespace content {
class RenderViewHost;
}

namespace extensions {

class Extension;

// Checks that |extension| is not NULL and that it has |permission|. If
// |extension| is NULL, just returns false. If an extension without |permission|
// returns false and suggests |permision| in the developer tools console.
bool IsExtensionWithPermissionOrSuggestInConsole(
    APIPermission::ID permission,
    const Extension* extension,
    content::RenderViewHost* host);

}  // namespace extensions

#endif  // EXTENSIONS_BROWSER_SUGGEST_PERMISSION_UTIL_H_