12a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)// Copyright (c) 2012 The Chromium Authors. All rights reserved.
22a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)// Use of this source code is governed by a BSD-style license that can be
32a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)// found in the LICENSE file.
42a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)
503b57e008b61dfcb1fbad3aea950ae0e001748b0Torne (Richard Coles)#ifndef EXTENSIONS_BROWSER_SUGGEST_PERMISSION_UTIL_H_
603b57e008b61dfcb1fbad3aea950ae0e001748b0Torne (Richard Coles)#define EXTENSIONS_BROWSER_SUGGEST_PERMISSION_UTIL_H_
72a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)
84e180b6a0b4720a9b8e9e959a882386f690f08ffTorne (Richard Coles)#include "extensions/common/permissions/api_permission.h"
92a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)
102a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)namespace content {
112a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)class RenderViewHost;
122a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)}
132a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)
142a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)namespace extensions {
152a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)
162a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)class Extension;
172a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)
1803b57e008b61dfcb1fbad3aea950ae0e001748b0Torne (Richard Coles)// Checks that |extension| is not NULL and that it has |permission|. If
1903b57e008b61dfcb1fbad3aea950ae0e001748b0Torne (Richard Coles)// |extension| is NULL, just returns false. If an extension without |permission|
202a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)// returns false and suggests |permision| in the developer tools console.
212a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)bool IsExtensionWithPermissionOrSuggestInConsole(
222a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)    APIPermission::ID permission,
232a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)    const Extension* extension,
242a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)    content::RenderViewHost* host);
252a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)
262a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)}  // namespace extensions
272a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)
2803b57e008b61dfcb1fbad3aea950ae0e001748b0Torne (Richard Coles)#endif  // EXTENSIONS_BROWSER_SUGGEST_PERMISSION_UTIL_H_
29