Home | History | Annotate | Download | only in extensions
      1 // Copyright 2013 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_RENDERER_EXTENSIONS_RENDERER_PERMISSIONS_POLICY_DELEGATE_H_
      6 #define CHROME_RENDERER_EXTENSIONS_RENDERER_PERMISSIONS_POLICY_DELEGATE_H_
      7 
      8 #include "chrome/common/extensions/permissions/permissions_data.h"
      9 
     10 namespace extensions {
     11 
     12 class Dispatcher;
     13 
     14 // Policy delegate for the renderer process.
     15 class RendererPermissionsPolicyDelegate
     16     : public PermissionsData::PolicyDelegate {
     17  public:
     18   explicit RendererPermissionsPolicyDelegate(Dispatcher* dispatcher);
     19   virtual ~RendererPermissionsPolicyDelegate();
     20 
     21   virtual bool CanExecuteScriptOnPage(const Extension* extension,
     22                                       const GURL& document_url,
     23                                       const GURL& top_document_url,
     24                                       int tab_id,
     25                                       const UserScript* script,
     26                                       int process_id,
     27                                       std::string* error) OVERRIDE;
     28 
     29  private:
     30   Dispatcher* dispatcher_;
     31 
     32   DISALLOW_COPY_AND_ASSIGN(RendererPermissionsPolicyDelegate);
     33 };
     34 
     35 }  // namespace extensions
     36 
     37 #endif  // CHROME_RENDERER_EXTENSIONS_RENDERER_PERMISSIONS_POLICY_DELEGATE_H_
     38