| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "v8/include/v8.h" | 10 #include "v8/include/v8.h" |
| (...skipping 17 matching lines...) Expand all Loading... |
| 28 | 28 |
| 29 // Handle a script context coming / going away. | 29 // Handle a script context coming / going away. |
| 30 static void HandleContextCreated(WebKit::WebFrame* frame, | 30 static void HandleContextCreated(WebKit::WebFrame* frame, |
| 31 bool content_script); | 31 bool content_script); |
| 32 static void HandleContextDestroyed(WebKit::WebFrame* frame); | 32 static void HandleContextDestroyed(WebKit::WebFrame* frame); |
| 33 | 33 |
| 34 // Calls the given function in each registered context which is listening for | 34 // Calls the given function in each registered context which is listening for |
| 35 // events. If render_view is non-NULL, only call the function in contexts | 35 // events. If render_view is non-NULL, only call the function in contexts |
| 36 // belonging to that view. See comments on | 36 // belonging to that view. See comments on |
| 37 // bindings_utils::CallFunctionInContext for more details. | 37 // bindings_utils::CallFunctionInContext for more details. |
| 38 // The called javascript function should not return a value other than |
| 39 // v8::Undefined(). A DCHECK is setup to break if it is otherwise. |
| 38 static void CallFunction(const std::string& function_name, int argc, | 40 static void CallFunction(const std::string& function_name, int argc, |
| 39 v8::Handle<v8::Value>* argv, | 41 v8::Handle<v8::Value>* argv, |
| 40 RenderView* render_view); | 42 RenderView* render_view); |
| 41 }; | 43 }; |
| 42 | 44 |
| 43 #endif // CHROME_RENDERER_EXTENSIONS_EVENT_BINDINGS_H_ | 45 #endif // CHROME_RENDERER_EXTENSIONS_EVENT_BINDINGS_H_ |
| OLD | NEW |