| 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 #include "ios/web/web_state/web_state_impl.h" | 5 #include "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/metrics/histogram_macros.h" | 10 #include "base/metrics/histogram_macros.h" |
| (...skipping 16 matching lines...) Expand all Loading... |
| 27 #include "ios/web/public/web_state/web_state_policy_decider.h" | 27 #include "ios/web/public/web_state/web_state_policy_decider.h" |
| 28 #include "ios/web/web_state/global_web_state_event_tracker.h" | 28 #include "ios/web/web_state/global_web_state_event_tracker.h" |
| 29 #import "ios/web/web_state/ui/crw_web_controller.h" | 29 #import "ios/web/web_state/ui/crw_web_controller.h" |
| 30 #import "ios/web/web_state/ui/crw_web_controller_container_view.h" | 30 #import "ios/web/web_state/ui/crw_web_controller_container_view.h" |
| 31 #include "ios/web/web_state/web_state_facade_delegate.h" | 31 #include "ios/web/web_state/web_state_facade_delegate.h" |
| 32 #import "ios/web/webui/web_ui_ios_controller_factory_registry.h" | 32 #import "ios/web/webui/web_ui_ios_controller_factory_registry.h" |
| 33 #import "ios/web/webui/web_ui_ios_impl.h" | 33 #import "ios/web/webui/web_ui_ios_impl.h" |
| 34 #include "net/http/http_response_headers.h" | 34 #include "net/http/http_response_headers.h" |
| 35 #include "services/service_manager/public/cpp/interface_registry.h" | 35 #include "services/service_manager/public/cpp/interface_registry.h" |
| 36 | 36 |
| 37 #if !defined(__has_feature) || !__has_feature(objc_arc) |
| 38 #error "This file requires ARC support." |
| 39 #endif |
| 40 |
| 37 namespace web { | 41 namespace web { |
| 38 | 42 |
| 39 /* static */ | 43 /* static */ |
| 40 std::unique_ptr<WebState> WebState::Create(const CreateParams& params) { | 44 std::unique_ptr<WebState> WebState::Create(const CreateParams& params) { |
| 41 std::unique_ptr<WebStateImpl> web_state( | 45 std::unique_ptr<WebStateImpl> web_state( |
| 42 new WebStateImpl(params.browser_state)); | 46 new WebStateImpl(params.browser_state)); |
| 43 | 47 |
| 44 NSString* window_name = nil; | 48 NSString* window_name = nil; |
| 45 NSString* opener_id = nil; | 49 NSString* opener_id = nil; |
| 46 BOOL opened_by_dom = NO; | 50 BOOL opened_by_dom = NO; |
| (...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 134 bool WebStateImpl::Configured() const { | 138 bool WebStateImpl::Configured() const { |
| 135 return web_controller_ != nil; | 139 return web_controller_ != nil; |
| 136 } | 140 } |
| 137 | 141 |
| 138 CRWWebController* WebStateImpl::GetWebController() { | 142 CRWWebController* WebStateImpl::GetWebController() { |
| 139 return web_controller_; | 143 return web_controller_; |
| 140 } | 144 } |
| 141 | 145 |
| 142 void WebStateImpl::SetWebController(CRWWebController* web_controller) { | 146 void WebStateImpl::SetWebController(CRWWebController* web_controller) { |
| 143 [web_controller_ close]; | 147 [web_controller_ close]; |
| 144 web_controller_.reset([web_controller retain]); | 148 web_controller_.reset(web_controller); |
| 145 } | 149 } |
| 146 | 150 |
| 147 WebStateFacadeDelegate* WebStateImpl::GetFacadeDelegate() const { | 151 WebStateFacadeDelegate* WebStateImpl::GetFacadeDelegate() const { |
| 148 return facade_delegate_; | 152 return facade_delegate_; |
| 149 } | 153 } |
| 150 | 154 |
| 151 void WebStateImpl::SetFacadeDelegate(WebStateFacadeDelegate* facade_delegate) { | 155 void WebStateImpl::SetFacadeDelegate(WebStateFacadeDelegate* facade_delegate) { |
| 152 facade_delegate_ = facade_delegate; | 156 facade_delegate_ = facade_delegate; |
| 153 } | 157 } |
| 154 | 158 |
| (...skipping 545 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 700 const LoadCommittedDetails& load_details) { | 704 const LoadCommittedDetails& load_details) { |
| 701 for (auto& observer : observers_) | 705 for (auto& observer : observers_) |
| 702 observer.NavigationItemCommitted(load_details); | 706 observer.NavigationItemCommitted(load_details); |
| 703 } | 707 } |
| 704 | 708 |
| 705 WebState* WebStateImpl::GetWebState() { | 709 WebState* WebStateImpl::GetWebState() { |
| 706 return this; | 710 return this; |
| 707 } | 711 } |
| 708 | 712 |
| 709 } // namespace web | 713 } // namespace web |
| OLD | NEW |