| 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 // This file contains the definition for CppBindingExample, which is used in | 5 // This file contains the definition for CppBindingExample, which is used in |
| 6 // cpp_bound_class_unittest. | 6 // cpp_bound_class_unittest. |
| 7 | 7 |
| 8 #include "cpp_binding_example.h" | 8 #include "cpp_binding_example.h" |
| 9 | 9 |
| 10 #include <stdio.h> |
| 11 |
| 10 #include "base/bind.h" | 12 #include "base/bind.h" |
| 11 #include "base/bind_helpers.h" | 13 #include "base/bind_helpers.h" |
| 12 | 14 |
| 13 namespace webkit_glue { | 15 namespace webkit_glue { |
| 14 | 16 |
| 15 namespace { | 17 namespace { |
| 16 | 18 |
| 17 class PropertyCallbackExample : public CppBoundClass::PropertyCallback { | 19 class PropertyCallbackExample : public CppBoundClass::PropertyCallback { |
| 18 public: | 20 public: |
| 19 virtual bool GetValue(CppVariant* value) { | 21 virtual bool GetValue(CppVariant* value) { |
| (...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 126 void CppBindingExample::same(CppVariant* result) { | 128 void CppBindingExample::same(CppVariant* result) { |
| 127 result->Set(42); | 129 result->Set(42); |
| 128 } | 130 } |
| 129 | 131 |
| 130 void CppBindingExample::fallbackMethod(const CppArgumentList& args, | 132 void CppBindingExample::fallbackMethod(const CppArgumentList& args, |
| 131 CppVariant* result) { | 133 CppVariant* result) { |
| 132 printf("Error: unknown JavaScript method invoked.\n"); | 134 printf("Error: unknown JavaScript method invoked.\n"); |
| 133 } | 135 } |
| 134 | 136 |
| 135 } // namespace webkit_glue | 137 } // namespace webkit_glue |
| OLD | NEW |