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
3 // found in the LICENSE file.
5 #include "ios/web/public/test/test_web_state.h"
9 TestWebState::TestWebState() : trust_level_(kAbsolute
), content_is_html_(true) {
12 TestWebState::~TestWebState() = default;
14 UIView
* TestWebState::GetView() {
18 WebViewType
TestWebState::GetWebViewType() const {
19 return web::UI_WEB_VIEW_TYPE
;
22 BrowserState
* TestWebState::GetBrowserState() const {
26 NavigationManager
* TestWebState::GetNavigationManager() {
30 CRWJSInjectionReceiver
* TestWebState::GetJSInjectionReceiver() const {
34 const std::string
& TestWebState::GetContentsMimeType() const {
38 const std::string
& TestWebState::GetContentLanguageHeader() const {
39 return content_language_
;
42 bool TestWebState::ContentIsHTML() const {
43 return content_is_html_
;
46 const GURL
& TestWebState::GetVisibleURL() const {
50 const GURL
& TestWebState::GetLastCommittedURL() const {
54 GURL
TestWebState::GetCurrentURL(URLVerificationTrustLevel
* trust_level
) const {
55 *trust_level
= trust_level_
;
59 bool TestWebState::IsShowingWebInterstitial() const {
63 WebInterstitial
* TestWebState::GetWebInterstitial() const {
67 void TestWebState::SetContentIsHTML(bool content_is_html
) {
68 content_is_html_
= content_is_html
;
71 const base::string16
& TestWebState::GetTitle() const {
75 bool TestWebState::IsLoading() const {
79 void TestWebState::SetCurrentURL(const GURL
& url
) {
83 void TestWebState::SetTrustLevel(URLVerificationTrustLevel trust_level
) {
84 trust_level_
= trust_level
;
87 CRWWebViewProxyType
TestWebState::GetWebViewProxy() const {
91 int TestWebState::DownloadImage(const GURL
& url
,
93 uint32_t max_bitmap_size
,
95 const ImageDownloadCallback
& callback
) {