OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 /* | 5 /* |
6 CppBoundClass class: | 6 CppBoundClass class: |
7 This base class serves as a parent for C++ classes designed to be bound to | 7 This base class serves as a parent for C++ classes designed to be bound to |
8 JavaScript objects. | 8 JavaScript objects. |
9 | 9 |
10 Subclasses should define the constructor to build the property and method | 10 Subclasses should define the constructor to build the property and method |
11 lists needed to bind this class to a JS object. They should also declare | 11 lists needed to bind this class to a JS object. They should also declare |
12 and define member variables and methods to be exposed to JS through | 12 and define member variables and methods to be exposed to JS through |
13 that object. | 13 that object. |
14 | 14 |
15 See cpp_binding_example.{h|cc} for an example. | 15 See cpp_binding_example.{h|cc} for an example. |
16 */ | 16 */ |
17 | 17 |
18 #ifndef WEBKIT_GLUE_CPP_BOUNDCLASS_H__ | 18 #ifndef WEBKIT_GLUE_CPP_BOUND_CLASS_H_ |
19 #define WEBKIT_GLUE_CPP_BOUNDCLASS_H__ | 19 #define WEBKIT_GLUE_CPP_BOUND_CLASS_H_ |
20 | 20 |
21 #include <map> | 21 #include <map> |
22 #include <vector> | 22 #include <vector> |
23 | 23 |
| 24 #include "base/callback.h" |
24 #include "webkit/glue/cpp_variant.h" | 25 #include "webkit/glue/cpp_variant.h" |
25 | |
26 #include "base/callback.h" | |
27 #include "base/memory/scoped_ptr.h" | |
28 #include "webkit/glue/webkit_glue_export.h" | 26 #include "webkit/glue/webkit_glue_export.h" |
29 | 27 |
30 namespace WebKit { | 28 namespace WebKit { |
31 class WebFrame; | 29 class WebFrame; |
32 } | 30 } |
33 | 31 |
34 namespace webkit_glue { | 32 namespace webkit_glue { |
35 | 33 |
36 typedef std::vector<CppVariant> CppArgumentList; | 34 typedef std::vector<CppVariant> CppArgumentList; |
37 | 35 |
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
137 | 135 |
138 // True if our np_object has been bound to a WebFrame, in which case it must | 136 // True if our np_object has been bound to a WebFrame, in which case it must |
139 // be unregistered with V8 when we delete it. | 137 // be unregistered with V8 when we delete it. |
140 bool bound_to_frame_; | 138 bool bound_to_frame_; |
141 | 139 |
142 DISALLOW_COPY_AND_ASSIGN(CppBoundClass); | 140 DISALLOW_COPY_AND_ASSIGN(CppBoundClass); |
143 }; | 141 }; |
144 | 142 |
145 } // namespace webkit_glue | 143 } // namespace webkit_glue |
146 | 144 |
147 #endif // CPP_BOUNDCLASS_H__ | 145 #endif // WEBKIT_GLUE_CPP_BOUND_CLASS_H_ |
OLD | NEW |