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 IOS_WEB_PUBLIC_TEST_TEST_WEB_STATE_H_ | 5 #ifndef IOS_WEB_PUBLIC_TEST_TEST_WEB_STATE_H_ |
6 #define IOS_WEB_PUBLIC_TEST_TEST_WEB_STATE_H_ | 6 #define IOS_WEB_PUBLIC_TEST_TEST_WEB_STATE_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "ios/web/public/web_state/web_state.h" | 10 #include "ios/web/public/web_state/web_state.h" |
11 #include "url/gurl.h" | 11 #include "url/gurl.h" |
12 | 12 |
13 namespace web { | 13 namespace web { |
14 | 14 |
15 // Minimal implementation of WebState, to be used in tests. | 15 // Minimal implementation of WebState, to be used in tests. |
16 class TestWebState : public WebState { | 16 class TestWebState : public WebState { |
17 public: | 17 public: |
18 // WebState implementation. | 18 // WebState implementation. |
19 virtual BrowserState* GetBrowserState() const override; | 19 BrowserState* GetBrowserState() const override; |
20 virtual void OpenURL(const OpenURLParams& params) override {} | 20 void OpenURL(const OpenURLParams& params) override {} |
21 virtual NavigationManager* GetNavigationManager() override; | 21 NavigationManager* GetNavigationManager() override; |
22 virtual CRWJSInjectionReceiver* GetJSInjectionReceiver() const override; | 22 CRWJSInjectionReceiver* GetJSInjectionReceiver() const override; |
23 virtual const std::string& GetContentsMimeType() const override; | 23 const std::string& GetContentsMimeType() const override; |
24 virtual const std::string& GetContentLanguageHeader() const override; | 24 const std::string& GetContentLanguageHeader() const override; |
25 virtual bool ContentIsHTML() const override; | 25 bool ContentIsHTML() const override; |
26 virtual const GURL& GetVisibleURL() const override; | 26 const GURL& GetVisibleURL() const override; |
27 virtual const GURL& GetLastCommittedURL() const override; | 27 const GURL& GetLastCommittedURL() const override; |
28 virtual void AddScriptCommandCallback( | 28 void AddScriptCommandCallback(const ScriptCommandCallback& callback, |
29 const ScriptCommandCallback& callback, | 29 const std::string& command_prefix) override {} |
30 const std::string& command_prefix) override {} | 30 void RemoveScriptCommandCallback(const std::string& command_prefix) override { |
31 virtual void RemoveScriptCommandCallback( | 31 } |
32 const std::string& command_prefix) override {} | 32 void AddObserver(WebStateObserver* observer) override {} |
33 virtual void AddObserver(WebStateObserver* observer) override {} | 33 void RemoveObserver(WebStateObserver* observer) override {} |
34 virtual void RemoveObserver(WebStateObserver* observer) override {} | |
35 | 34 |
36 private: | 35 private: |
37 GURL url_; | 36 GURL url_; |
38 std::string mime_type_; | 37 std::string mime_type_; |
39 std::string content_language_; | 38 std::string content_language_; |
40 }; | 39 }; |
41 | 40 |
42 } // namespace web | 41 } // namespace web |
43 | 42 |
44 #endif // IOS_WEB_PUBLIC_TEST_TEST_WEB_STATE_H_ | 43 #endif // IOS_WEB_PUBLIC_TEST_TEST_WEB_STATE_H_ |
OLD | NEW |