| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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_TEST_AUTOMATION_JAVASCRIPT_MESSAGE_UTILS_H_ | 5 #ifndef CHROME_TEST_AUTOMATION_JAVASCRIPT_MESSAGE_UTILS_H_ |
| 6 #define CHROME_TEST_AUTOMATION_JAVASCRIPT_MESSAGE_UTILS_H_ | 6 #define CHROME_TEST_AUTOMATION_JAVASCRIPT_MESSAGE_UTILS_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| 11 | 11 |
| 12 #include "base/json/json_writer.h" | 12 #include "base/json/json_writer.h" |
| 13 #include "base/ref_counted.h" | |
| 14 #include "base/scoped_ptr.h" | 13 #include "base/scoped_ptr.h" |
| 15 #include "base/string_util.h" | 14 #include "base/string_util.h" |
| 16 #include "base/values.h" | 15 #include "base/values.h" |
| 17 #include "chrome/test/automation/dom_element_proxy.h" | 16 #include "chrome/test/automation/dom_element_proxy.h" |
| 18 | 17 |
| 19 // ValueConversionTraits contains functions for creating a value from a | 18 // ValueConversionTraits contains functions for creating a value from a |
| 20 // type, and setting a type from a value. This is general-purpose and can | 19 // type, and setting a type from a value. This is general-purpose and can |
| 21 // be moved to a common location if needed. | 20 // be moved to a common location if needed. |
| 22 template <class T> | 21 template <class T> |
| 23 struct ValueConversionTraits { | 22 struct ValueConversionTraits { |
| (...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 136 const T2& arg2, const T3& arg3) { | 135 const T2& arg2, const T3& arg3) { |
| 137 return StringPrintf(format.c_str(), | 136 return StringPrintf(format.c_str(), |
| 138 JSONStringify(arg1).c_str(), | 137 JSONStringify(arg1).c_str(), |
| 139 JSONStringify(arg2).c_str(), | 138 JSONStringify(arg2).c_str(), |
| 140 JSONStringify(arg3).c_str()); | 139 JSONStringify(arg3).c_str()); |
| 141 } | 140 } |
| 142 | 141 |
| 143 } // namespace javascript_utils | 142 } // namespace javascript_utils |
| 144 | 143 |
| 145 #endif // CHROME_TEST_AUTOMATION_JAVASCRIPT_MESSAGE_UTILS_H_ | 144 #endif // CHROME_TEST_AUTOMATION_JAVASCRIPT_MESSAGE_UTILS_H_ |
| OLD | NEW |