| OLD | NEW |
| (Empty) |
| 1 // Copyright (c) 2011 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_EXTENSION_BINDINGS_H_ | |
| 6 #define CHROME_RENDERER_EXTENSIONS_RENDERER_EXTENSION_BINDINGS_H_ | |
| 7 #pragma once | |
| 8 | |
| 9 #include <string> | |
| 10 | |
| 11 #include "chrome/renderer/extensions/chrome_v8_context_set.h" | |
| 12 | |
| 13 class ExtensionDispatcher; | |
| 14 | |
| 15 namespace content { | |
| 16 class RenderView; | |
| 17 } | |
| 18 | |
| 19 namespace v8 { | |
| 20 class Extension; | |
| 21 } | |
| 22 | |
| 23 // This class adds extension-related javascript bindings to a renderer. It is | |
| 24 // used by both web renderers and extension processes. | |
| 25 class RendererExtensionBindings { | |
| 26 public: | |
| 27 // Creates an instance of the extension. | |
| 28 static v8::Extension* Get(ExtensionDispatcher* dispatcher); | |
| 29 | |
| 30 // Delivers a message sent using content script messaging to some of the | |
| 31 // contexts in |bindings_context_set|. If |restrict_to_render_view| is | |
| 32 // specified, only contexts in that render view will receive the message. | |
| 33 static void DeliverMessage( | |
| 34 const ChromeV8ContextSet::ContextSet& context_set, | |
| 35 int target_port_id, | |
| 36 const std::string& message, | |
| 37 content::RenderView* restrict_to_render_view); | |
| 38 }; | |
| 39 | |
| 40 #endif // CHROME_RENDERER_EXTENSIONS_RENDERER_EXTENSION_BINDINGS_H_ | |
| OLD | NEW |