OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 CONTENT_PUBLIC_TEST_TEST_WEB_UI_H_ | 5 #ifndef CONTENT_PUBLIC_TEST_TEST_WEB_UI_H_ |
6 #define CONTENT_PUBLIC_TEST_TEST_WEB_UI_H_ | 6 #define CONTENT_PUBLIC_TEST_TEST_WEB_UI_H_ |
7 | 7 |
8 #include <memory> | 8 #include <memory> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
63 void CallJavascriptFunctionUnsafe( | 63 void CallJavascriptFunctionUnsafe( |
64 const std::string& function_name, | 64 const std::string& function_name, |
65 const std::vector<const base::Value*>& args) override; | 65 const std::vector<const base::Value*>& args) override; |
66 ScopedVector<WebUIMessageHandler>* GetHandlersForTesting() override; | 66 ScopedVector<WebUIMessageHandler>* GetHandlersForTesting() override; |
67 | 67 |
68 class CallData { | 68 class CallData { |
69 public: | 69 public: |
70 explicit CallData(const std::string& function_name); | 70 explicit CallData(const std::string& function_name); |
71 ~CallData(); | 71 ~CallData(); |
72 | 72 |
73 void TakeAsArg1(base::Value* arg); | 73 void TakeAsArg1(std::unique_ptr<base::Value> arg); |
74 void TakeAsArg2(base::Value* arg); | 74 void TakeAsArg2(std::unique_ptr<base::Value> arg); |
75 void TakeAsArg3(base::Value* arg); | 75 void TakeAsArg3(std::unique_ptr<base::Value> arg); |
| 76 void TakeAsArg4(std::unique_ptr<base::Value> arg); |
76 | 77 |
77 const std::string& function_name() const { return function_name_; } | 78 const std::string& function_name() const { return function_name_; } |
78 const base::Value* arg1() const { return arg1_.get(); } | 79 const base::Value* arg1() const { return arg1_.get(); } |
79 const base::Value* arg2() const { return arg2_.get(); } | 80 const base::Value* arg2() const { return arg2_.get(); } |
80 const base::Value* arg3() const { return arg3_.get(); } | 81 const base::Value* arg3() const { return arg3_.get(); } |
| 82 const base::Value* arg4() const { return arg4_.get(); } |
81 | 83 |
82 private: | 84 private: |
83 std::string function_name_; | 85 std::string function_name_; |
84 std::unique_ptr<base::Value> arg1_; | 86 std::unique_ptr<base::Value> arg1_; |
85 std::unique_ptr<base::Value> arg2_; | 87 std::unique_ptr<base::Value> arg2_; |
86 std::unique_ptr<base::Value> arg3_; | 88 std::unique_ptr<base::Value> arg3_; |
| 89 std::unique_ptr<base::Value> arg4_; |
87 }; | 90 }; |
88 | 91 |
89 const ScopedVector<CallData>& call_data() const { return call_data_; } | 92 const ScopedVector<CallData>& call_data() const { return call_data_; } |
90 | 93 |
91 private: | 94 private: |
92 ScopedVector<CallData> call_data_; | 95 ScopedVector<CallData> call_data_; |
93 ScopedVector<WebUIMessageHandler> handlers_; | 96 ScopedVector<WebUIMessageHandler> handlers_; |
94 base::string16 temp_string_; | 97 base::string16 temp_string_; |
95 WebContents* web_contents_; | 98 WebContents* web_contents_; |
96 }; | 99 }; |
97 | 100 |
98 } // namespace content | 101 } // namespace content |
99 | 102 |
100 #endif // CONTENT_PUBLIC_TEST_TEST_WEB_UI_H_ | 103 #endif // CONTENT_PUBLIC_TEST_TEST_WEB_UI_H_ |
OLD | NEW |