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 #include "ios/web/public/test/test_web_state.h" | 5 #include "ios/web/public/test/test_web_state.h" |
6 | 6 |
7 namespace web { | 7 namespace web { |
8 | 8 |
| 9 TestWebState::TestWebState() : trust_level_(kAbsolute), content_is_html_(true) { |
| 10 } |
| 11 |
| 12 TestWebState::~TestWebState() = default; |
| 13 |
| 14 UIView* TestWebState::GetView() { |
| 15 return nullptr; |
| 16 } |
| 17 |
| 18 WebViewType TestWebState::GetWebViewType() const { |
| 19 return web::UI_WEB_VIEW_TYPE; |
| 20 } |
| 21 |
9 BrowserState* TestWebState::GetBrowserState() const { | 22 BrowserState* TestWebState::GetBrowserState() const { |
10 return nullptr; | 23 return nullptr; |
11 } | 24 } |
12 | 25 |
13 NavigationManager* TestWebState::GetNavigationManager() { | 26 NavigationManager* TestWebState::GetNavigationManager() { |
14 return nullptr; | 27 return nullptr; |
15 } | 28 } |
16 | 29 |
17 CRWJSInjectionReceiver* TestWebState::GetJSInjectionReceiver() const { | 30 CRWJSInjectionReceiver* TestWebState::GetJSInjectionReceiver() const { |
18 return nullptr; | 31 return nullptr; |
19 } | 32 } |
20 | 33 |
21 const std::string& TestWebState::GetContentsMimeType() const { | 34 const std::string& TestWebState::GetContentsMimeType() const { |
22 return mime_type_; | 35 return mime_type_; |
23 } | 36 } |
24 | 37 |
25 const std::string& TestWebState::GetContentLanguageHeader() const { | 38 const std::string& TestWebState::GetContentLanguageHeader() const { |
26 return content_language_; | 39 return content_language_; |
27 } | 40 } |
28 | 41 |
29 bool TestWebState::ContentIsHTML() const { | 42 bool TestWebState::ContentIsHTML() const { |
30 return true; | 43 return content_is_html_; |
31 } | 44 } |
32 | 45 |
33 const GURL& TestWebState::GetVisibleURL() const { | 46 const GURL& TestWebState::GetVisibleURL() const { |
34 return url_; | 47 return url_; |
35 } | 48 } |
36 | 49 |
37 const GURL& TestWebState::GetLastCommittedURL() const { | 50 const GURL& TestWebState::GetLastCommittedURL() const { |
38 return url_; | 51 return url_; |
39 } | 52 } |
40 | 53 |
| 54 GURL TestWebState::GetCurrentURL(URLVerificationTrustLevel* trust_level) const { |
| 55 *trust_level = trust_level_; |
| 56 return url_; |
| 57 } |
| 58 |
| 59 bool TestWebState::IsShowingWebInterstitial() const { |
| 60 return false; |
| 61 } |
| 62 |
| 63 WebInterstitial* TestWebState::GetWebInterstitial() const { |
| 64 return nullptr; |
| 65 } |
| 66 |
| 67 void TestWebState::SetContentIsHTML(bool content_is_html) { |
| 68 content_is_html_ = content_is_html; |
| 69 } |
| 70 |
| 71 void TestWebState::SetCurrentURL(const GURL& url) { |
| 72 url_ = url; |
| 73 } |
| 74 |
| 75 void TestWebState::SetTrustLevel(URLVerificationTrustLevel trust_level) { |
| 76 trust_level_ = trust_level; |
| 77 } |
| 78 |
| 79 CRWWebViewProxyType TestWebState::GetWebViewProxy() const { |
| 80 return nullptr; |
| 81 } |
| 82 |
41 } // namespace web | 83 } // namespace web |
OLD | NEW |