OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 #import "ios/web/web_state/web_state_impl.h" | 5 #import "ios/web/web_state/web_state_impl.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 20 matching lines...) Expand all Loading... |
31 #include "ios/web/public/webui/web_ui_ios_controller.h" | 31 #include "ios/web/public/webui/web_ui_ios_controller.h" |
32 #include "ios/web/web_state/global_web_state_event_tracker.h" | 32 #include "ios/web/web_state/global_web_state_event_tracker.h" |
33 #import "ios/web/web_state/navigation_context_impl.h" | 33 #import "ios/web/web_state/navigation_context_impl.h" |
34 #import "ios/web/web_state/session_certificate_policy_cache_impl.h" | 34 #import "ios/web/web_state/session_certificate_policy_cache_impl.h" |
35 #import "ios/web/web_state/ui/crw_web_controller.h" | 35 #import "ios/web/web_state/ui/crw_web_controller.h" |
36 #import "ios/web/web_state/ui/crw_web_controller_container_view.h" | 36 #import "ios/web/web_state/ui/crw_web_controller_container_view.h" |
37 #include "ios/web/webui/web_ui_ios_controller_factory_registry.h" | 37 #include "ios/web/webui/web_ui_ios_controller_factory_registry.h" |
38 #include "ios/web/webui/web_ui_ios_impl.h" | 38 #include "ios/web/webui/web_ui_ios_impl.h" |
39 #include "net/http/http_response_headers.h" | 39 #include "net/http/http_response_headers.h" |
40 | 40 |
41 #if !defined(__has_feature) || !__has_feature(objc_arc) | |
42 #error "This file requires ARC support." | |
43 #endif | |
44 | |
45 namespace web { | 41 namespace web { |
46 | 42 |
47 /* static */ | 43 /* static */ |
48 std::unique_ptr<WebState> WebState::Create(const CreateParams& params) { | 44 std::unique_ptr<WebState> WebState::Create(const CreateParams& params) { |
49 std::unique_ptr<WebStateImpl> web_state(new WebStateImpl(params)); | 45 std::unique_ptr<WebStateImpl> web_state(new WebStateImpl(params)); |
50 | 46 |
51 // Initialize the new session. | 47 // Initialize the new session. |
52 web_state->GetNavigationManagerImpl().InitializeSession(); | 48 web_state->GetNavigationManagerImpl().InitializeSession(); |
53 | 49 |
54 // TODO(crbug.com/703565): remove std::move() once Xcode 9.0+ is required. | 50 // TODO(crbug.com/703565): remove std::move() once Xcode 9.0+ is required. |
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
159 bool WebStateImpl::Configured() const { | 155 bool WebStateImpl::Configured() const { |
160 return web_controller_ != nil; | 156 return web_controller_ != nil; |
161 } | 157 } |
162 | 158 |
163 CRWWebController* WebStateImpl::GetWebController() { | 159 CRWWebController* WebStateImpl::GetWebController() { |
164 return web_controller_; | 160 return web_controller_; |
165 } | 161 } |
166 | 162 |
167 void WebStateImpl::SetWebController(CRWWebController* web_controller) { | 163 void WebStateImpl::SetWebController(CRWWebController* web_controller) { |
168 [web_controller_ close]; | 164 [web_controller_ close]; |
169 web_controller_.reset(web_controller); | 165 web_controller_.reset([web_controller retain]); |
170 } | 166 } |
171 | 167 |
172 void WebStateImpl::OnTitleChanged() { | 168 void WebStateImpl::OnTitleChanged() { |
173 for (auto& observer : observers_) | 169 for (auto& observer : observers_) |
174 observer.TitleWasSet(); | 170 observer.TitleWasSet(); |
175 } | 171 } |
176 | 172 |
177 void WebStateImpl::OnVisibleSecurityStateChange() { | 173 void WebStateImpl::OnVisibleSecurityStateChange() { |
178 for (auto& observer : observers_) | 174 for (auto& observer : observers_) |
179 observer.DidChangeVisibleSecurityState(); | 175 observer.DidChangeVisibleSecurityState(); |
(...skipping 533 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
713 const LoadCommittedDetails& load_details) { | 709 const LoadCommittedDetails& load_details) { |
714 for (auto& observer : observers_) | 710 for (auto& observer : observers_) |
715 observer.NavigationItemCommitted(load_details); | 711 observer.NavigationItemCommitted(load_details); |
716 } | 712 } |
717 | 713 |
718 WebState* WebStateImpl::GetWebState() { | 714 WebState* WebStateImpl::GetWebState() { |
719 return this; | 715 return this; |
720 } | 716 } |
721 | 717 |
722 } // namespace web | 718 } // namespace web |
OLD | NEW |