OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CHROME_RENDERER_EXTENSIONS_EVENT_BINDINGS_H_ | 5 #ifndef CHROME_RENDERER_EXTENSIONS_EVENT_BINDINGS_H_ |
6 #define CHROME_RENDERER_EXTENSIONS_EVENT_BINDINGS_H_ | 6 #define CHROME_RENDERER_EXTENSIONS_EVENT_BINDINGS_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 19 matching lines...) Expand all Loading... |
30 static const char* kTestingExtensionId; | 30 static const char* kTestingExtensionId; |
31 | 31 |
32 static v8::Extension* Get(ExtensionDispatcher* dispatcher); | 32 static v8::Extension* Get(ExtensionDispatcher* dispatcher); |
33 | 33 |
34 // Allow RenderThread to be mocked out. | 34 // Allow RenderThread to be mocked out. |
35 static void SetRenderThread(RenderThreadBase* thread); | 35 static void SetRenderThread(RenderThreadBase* thread); |
36 static RenderThreadBase* GetRenderThread(); | 36 static RenderThreadBase* GetRenderThread(); |
37 | 37 |
38 // Handle a script context coming / going away. | 38 // Handle a script context coming / going away. |
39 static void HandleContextCreated(WebKit::WebFrame* frame, | 39 static void HandleContextCreated(WebKit::WebFrame* frame, |
40 bool content_script, | 40 v8::Handle<v8::Context> context, |
41 ExtensionDispatcher* extension_dispatcher); | 41 ExtensionDispatcher* extension_dispatcher, |
| 42 int isolated_world_id); |
42 static void HandleContextDestroyed(WebKit::WebFrame* frame); | 43 static void HandleContextDestroyed(WebKit::WebFrame* frame); |
43 | 44 |
44 // Calls the given function in each registered context which is listening for | 45 // Calls the given function in each registered context which is listening for |
45 // events. If render_view is non-NULL, only call the function in contexts | 46 // events. If render_view is non-NULL, only call the function in contexts |
46 // belonging to that view. See comments on | 47 // belonging to that view. See comments on |
47 // bindings_utils::CallFunctionInContext for more details. | 48 // bindings_utils::CallFunctionInContext for more details. |
48 // The called javascript function should not return a value other than | 49 // The called javascript function should not return a value other than |
49 // v8::Undefined(). A DCHECK is setup to break if it is otherwise. | 50 // v8::Undefined(). A DCHECK is setup to break if it is otherwise. |
50 static void CallFunction(const std::string& extension_id, | 51 static void CallFunction(const std::string& extension_id, |
51 const std::string& function_name, | 52 const std::string& function_name, |
52 const base::ListValue& arguments, | 53 const base::ListValue& arguments, |
53 RenderView* render_view, | 54 RenderView* render_view, |
54 const GURL& event_url); | 55 const GURL& event_url); |
55 }; | 56 }; |
56 | 57 |
57 #endif // CHROME_RENDERER_EXTENSIONS_EVENT_BINDINGS_H_ | 58 #endif // CHROME_RENDERER_EXTENSIONS_EVENT_BINDINGS_H_ |
OLD | NEW |