Home | History | Annotate | Download | only in extensions
      1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
      2 // Use of this source code is governed by a BSD-style license that can be
      3 // found in the LICENSE file.
      4 
      5 #ifndef CHROME_BROWSER_EXTENSIONS_SUGGEST_PERMISSION_UTIL_H_
      6 #define CHROME_BROWSER_EXTENSIONS_SUGGEST_PERMISSION_UTIL_H_
      7 
      8 #include "extensions/common/permissions/api_permission.h"
      9 
     10 class Profile;
     11 
     12 namespace content {
     13 class RenderViewHost;
     14 }
     15 
     16 namespace extensions {
     17 
     18 class Extension;
     19 
     20 // Outputs a suggestion in the developer tools console to use |permission|.
     21 void SuggestAPIPermissionInDevToolsConsole(APIPermission::ID permission,
     22                                            const Extension* extension,
     23                                            content::RenderViewHost* host);
     24 
     25 // Outputs a suggestion in the developer tools console to use |permission|.
     26 void SuggestAPIPermissionInDevToolsConsole(APIPermission::ID permission,
     27                                            const Extension* extension,
     28                                            Profile* profile);
     29 
     30 // Checks that |extension| is not NULL and that it has |permission|. If not
     31 // and extension, just returns false. If an extension without |permission|
     32 // returns false and suggests |permision| in the developer tools console.
     33 bool IsExtensionWithPermissionOrSuggestInConsole(
     34     APIPermission::ID permission,
     35     const Extension* extension,
     36     content::RenderViewHost* host);
     37 
     38 // Checks that |extension| is not NULL and that it has |permission|. If not
     39 // and extension, just returns false. If an extension without |permission|
     40 // returns false and suggests |permision| in the developer tools console.
     41 bool IsExtensionWithPermissionOrSuggestInConsole(
     42     APIPermission::ID permission,
     43     const Extension* extension,
     44     Profile* profile);
     45 
     46 }  // namespace extensions
     47 
     48 #endif  // CHROME_BROWSER_EXTENSIONS_SUGGEST_PERMISSION_UTIL_H_
     49