Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 WEB_TEST_WEB_PUBLIC_TEST_TEST_WEB_CLIENT_H_ | 5 #ifndef WEB_TEST_WEB_PUBLIC_TEST_TEST_WEB_CLIENT_H_ |
| 6 #define WEB_TEST_WEB_PUBLIC_TEST_TEST_WEB_CLIENT_H_ | 6 #define WEB_TEST_WEB_PUBLIC_TEST_TEST_WEB_CLIENT_H_ |
| 7 | 7 |
| 8 #import <Foundation/Foundation.h> | 8 #import <Foundation/Foundation.h> |
| 9 | 9 |
| 10 #include <memory> | |
|
noyau (Ping after 24h)
2016/04/07 13:34:05
Not needed.
| |
| 11 | |
| 10 #include "base/compiler_specific.h" | 12 #include "base/compiler_specific.h" |
| 11 #include "base/mac/scoped_nsobject.h" | 13 #include "base/mac/scoped_nsobject.h" |
| 12 #include "base/memory/scoped_ptr.h" | |
| 13 #include "ios/web/public/web_client.h" | 14 #include "ios/web/public/web_client.h" |
| 14 | 15 |
| 15 namespace web { | 16 namespace web { |
| 16 | 17 |
| 17 // A WebClient used for testing purposes. | 18 // A WebClient used for testing purposes. |
| 18 class TestWebClient : public web::WebClient { | 19 class TestWebClient : public web::WebClient { |
| 19 public: | 20 public: |
| 20 TestWebClient(); | 21 TestWebClient(); |
| 21 ~TestWebClient() override; | 22 ~TestWebClient() override; |
| 22 // WebClient implementation. | 23 // WebClient implementation. |
| 23 NSString* GetEarlyPageScript(web::WebViewType web_view_type) const override; | 24 NSString* GetEarlyPageScript(web::WebViewType web_view_type) const override; |
| 24 bool WebViewsNeedActiveStateManager() const override; | 25 bool WebViewsNeedActiveStateManager() const override; |
| 25 | 26 |
| 26 // Changes Early Page Script for testing purposes. | 27 // Changes Early Page Script for testing purposes. |
| 27 void SetEarlyPageScript(NSString* page_script, | 28 void SetEarlyPageScript(NSString* page_script, |
| 28 web::WebViewType web_view_type); | 29 web::WebViewType web_view_type); |
| 29 | 30 |
| 30 private: | 31 private: |
| 31 base::scoped_nsobject<NSMutableDictionary> early_page_scripts_; | 32 base::scoped_nsobject<NSMutableDictionary> early_page_scripts_; |
| 32 }; | 33 }; |
| 33 | 34 |
| 34 } // namespace web | 35 } // namespace web |
| 35 | 36 |
| 36 #endif // WEB_TEST_WEB_PUBLIC_TEST_TEST_WEB_CLIENT_H_ | 37 #endif // WEB_TEST_WEB_PUBLIC_TEST_TEST_WEB_CLIENT_H_ |
| OLD | NEW |