| 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 <vector> | 9 #include <vector> |
| 9 | 10 |
| 10 #include "base/memory/scoped_ptr.h" | |
| 11 #include "base/memory/scoped_vector.h" | 11 #include "base/memory/scoped_vector.h" |
| 12 #include "base/values.h" | 12 #include "base/values.h" |
| 13 #include "content/public/browser/web_ui.h" | 13 #include "content/public/browser/web_ui.h" |
| 14 | 14 |
| 15 namespace content { | 15 namespace content { |
| 16 | 16 |
| 17 // Test instance of WebUI that tracks the data passed to | 17 // Test instance of WebUI that tracks the data passed to |
| 18 // CallJavascriptFunction(). | 18 // CallJavascriptFunction(). |
| 19 class TestWebUI : public WebUI { | 19 class TestWebUI : public WebUI { |
| 20 public: | 20 public: |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 72 void TakeAsArg2(base::Value* arg); | 72 void TakeAsArg2(base::Value* arg); |
| 73 void TakeAsArg3(base::Value* arg); | 73 void TakeAsArg3(base::Value* arg); |
| 74 | 74 |
| 75 const std::string& function_name() const { return function_name_; } | 75 const std::string& function_name() const { return function_name_; } |
| 76 const base::Value* arg1() const { return arg1_.get(); } | 76 const base::Value* arg1() const { return arg1_.get(); } |
| 77 const base::Value* arg2() const { return arg2_.get(); } | 77 const base::Value* arg2() const { return arg2_.get(); } |
| 78 const base::Value* arg3() const { return arg3_.get(); } | 78 const base::Value* arg3() const { return arg3_.get(); } |
| 79 | 79 |
| 80 private: | 80 private: |
| 81 std::string function_name_; | 81 std::string function_name_; |
| 82 scoped_ptr<base::Value> arg1_; | 82 std::unique_ptr<base::Value> arg1_; |
| 83 scoped_ptr<base::Value> arg2_; | 83 std::unique_ptr<base::Value> arg2_; |
| 84 scoped_ptr<base::Value> arg3_; | 84 std::unique_ptr<base::Value> arg3_; |
| 85 }; | 85 }; |
| 86 | 86 |
| 87 const ScopedVector<CallData>& call_data() const { return call_data_; } | 87 const ScopedVector<CallData>& call_data() const { return call_data_; } |
| 88 | 88 |
| 89 private: | 89 private: |
| 90 ScopedVector<CallData> call_data_; | 90 ScopedVector<CallData> call_data_; |
| 91 ScopedVector<WebUIMessageHandler> handlers_; | 91 ScopedVector<WebUIMessageHandler> handlers_; |
| 92 base::string16 temp_string_; | 92 base::string16 temp_string_; |
| 93 WebContents* web_contents_; | 93 WebContents* web_contents_; |
| 94 }; | 94 }; |
| 95 | 95 |
| 96 } // namespace content | 96 } // namespace content |
| 97 | 97 |
| 98 #endif // CONTENT_PUBLIC_TEST_TEST_WEB_UI_H_ | 98 #endif // CONTENT_PUBLIC_TEST_TEST_WEB_UI_H_ |
| OLD | NEW |