| 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 |
| 11 #include "v8/include/v8.h" | 11 #include "v8/include/v8.h" |
| 12 | 12 |
| 13 class ExtensionDispatcher; | 13 class ExtensionDispatcher; |
| 14 class GURL; | 14 class GURL; |
| 15 class ListValue; | |
| 16 class RenderThreadBase; | 15 class RenderThreadBase; |
| 17 class RenderView; | 16 class RenderView; |
| 18 | 17 |
| 18 namespace base { |
| 19 class ListValue; |
| 20 } |
| 21 |
| 19 namespace WebKit { | 22 namespace WebKit { |
| 20 class WebFrame; | 23 class WebFrame; |
| 21 } | 24 } |
| 22 | 25 |
| 23 // This class deals with the javascript bindings related to Event objects. | 26 // This class deals with the javascript bindings related to Event objects. |
| 24 class EventBindings { | 27 class EventBindings { |
| 25 public: | 28 public: |
| 26 static const char* kName; // The v8::Extension name, for dependencies. | 29 static const char* kName; // The v8::Extension name, for dependencies. |
| 27 static const char* kTestingExtensionId; | 30 static const char* kTestingExtensionId; |
| 28 | 31 |
| (...skipping 10 matching lines...) Expand all Loading... |
| 39 static void HandleContextDestroyed(WebKit::WebFrame* frame); | 42 static void HandleContextDestroyed(WebKit::WebFrame* frame); |
| 40 | 43 |
| 41 // Calls the given function in each registered context which is listening for | 44 // Calls the given function in each registered context which is listening for |
| 42 // events. If render_view is non-NULL, only call the function in contexts | 45 // events. If render_view is non-NULL, only call the function in contexts |
| 43 // belonging to that view. See comments on | 46 // belonging to that view. See comments on |
| 44 // bindings_utils::CallFunctionInContext for more details. | 47 // bindings_utils::CallFunctionInContext for more details. |
| 45 // The called javascript function should not return a value other than | 48 // The called javascript function should not return a value other than |
| 46 // v8::Undefined(). A DCHECK is setup to break if it is otherwise. | 49 // v8::Undefined(). A DCHECK is setup to break if it is otherwise. |
| 47 static void CallFunction(const std::string& extension_id, | 50 static void CallFunction(const std::string& extension_id, |
| 48 const std::string& function_name, | 51 const std::string& function_name, |
| 49 const ListValue& arguments, | 52 const base::ListValue& arguments, |
| 50 RenderView* render_view, | 53 RenderView* render_view, |
| 51 const GURL& event_url); | 54 const GURL& event_url); |
| 52 }; | 55 }; |
| 53 | 56 |
| 54 #endif // CHROME_RENDERER_EXTENSIONS_EVENT_BINDINGS_H_ | 57 #endif // CHROME_RENDERER_EXTENSIONS_EVENT_BINDINGS_H_ |
| OLD | NEW |