summaryrefslogtreecommitdiffstats
path: root/chrome/renderer/extensions/renderer_extension_bindings.h
blob: 3e70e8f3547e1fd0ebbda4853e8457c9666dcd9f (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
32
// Copyright (c) 2009 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 CHROME_RENDERER_EXTENSIONS_RENDERER_EXTENSION_BINDINGS_H_
#define CHROME_RENDERER_EXTENSIONS_RENDERER_EXTENSION_BINDINGS_H_

#include "v8/include/v8.h"

#include <string>

class GURL;
class ListValue;
class RenderView;

// This class adds extension-related javascript bindings to a renderer.  It is
// used by both web renderers and extension processes.
class RendererExtensionBindings {
 public:
  // Name of extension, for dependencies.
  static const char* kName;

  // Creates an instance of the extension.
  static v8::Extension* Get();

  // Call the given javascript function with the specified arguments.
  static void Invoke(const std::string& function_name, const ListValue& args,
                     RenderView* renderview, bool requires_incognito_access,
                     const GURL& event_url);
};

#endif  // CHROME_RENDERER_EXTENSIONS_RENDERER_EXTENSION_BINDINGS_H_