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" |
11 #include "base/memory/ptr_util.h" | 11 #include "base/memory/ptr_util.h" |
12 #include "base/metrics/histogram_macros.h" | 12 #include "base/metrics/histogram_macros.h" |
13 #include "base/strings/sys_string_conversions.h" | 13 #include "base/strings/sys_string_conversions.h" |
14 #import "ios/web/interstitials/web_interstitial_impl.h" | 14 #import "ios/web/interstitials/web_interstitial_impl.h" |
15 #import "ios/web/navigation/crw_session_controller.h" | 15 #import "ios/web/navigation/crw_session_controller.h" |
| 16 #import "ios/web/navigation/legacy_navigation_manager_impl.h" |
16 #import "ios/web/navigation/navigation_item_impl.h" | 17 #import "ios/web/navigation/navigation_item_impl.h" |
17 #import "ios/web/navigation/session_storage_builder.h" | 18 #import "ios/web/navigation/session_storage_builder.h" |
18 #include "ios/web/public/browser_state.h" | 19 #include "ios/web/public/browser_state.h" |
19 #import "ios/web/public/crw_session_storage.h" | 20 #import "ios/web/public/crw_session_storage.h" |
20 #import "ios/web/public/java_script_dialog_presenter.h" | 21 #import "ios/web/public/java_script_dialog_presenter.h" |
21 #import "ios/web/public/navigation_item.h" | 22 #import "ios/web/public/navigation_item.h" |
22 #include "ios/web/public/url_util.h" | 23 #include "ios/web/public/url_util.h" |
23 #import "ios/web/public/web_client.h" | 24 #import "ios/web/public/web_client.h" |
24 #import "ios/web/public/web_state/context_menu_params.h" | 25 #import "ios/web/public/web_state/context_menu_params.h" |
25 #import "ios/web/public/web_state/ui/crw_content_view.h" | 26 #import "ios/web/public/web_state/ui/crw_content_view.h" |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
73 is_being_destroyed_(false), | 74 is_being_destroyed_(false), |
74 web_controller_(nil), | 75 web_controller_(nil), |
75 interstitial_(nullptr), | 76 interstitial_(nullptr), |
76 created_with_opener_(params.created_with_opener), | 77 created_with_opener_(params.created_with_opener), |
77 weak_factory_(this) { | 78 weak_factory_(this) { |
78 // Create or deserialize the NavigationManager. | 79 // Create or deserialize the NavigationManager. |
79 if (session_storage) { | 80 if (session_storage) { |
80 SessionStorageBuilder session_storage_builder; | 81 SessionStorageBuilder session_storage_builder; |
81 session_storage_builder.ExtractSessionState(this, session_storage); | 82 session_storage_builder.ExtractSessionState(this, session_storage); |
82 } else { | 83 } else { |
83 navigation_manager_ = base::MakeUnique<NavigationManagerImpl>(); | 84 navigation_manager_ = base::WrapUnique<NavigationManagerImpl>( |
| 85 new LegacyNavigationManagerImpl); |
84 certificate_policy_cache_ = | 86 certificate_policy_cache_ = |
85 base::MakeUnique<SessionCertificatePolicyCacheImpl>(); | 87 base::MakeUnique<SessionCertificatePolicyCacheImpl>(); |
86 } | 88 } |
87 navigation_manager_->SetDelegate(this); | 89 navigation_manager_->SetDelegate(this); |
88 navigation_manager_->SetBrowserState(params.browser_state); | 90 navigation_manager_->SetBrowserState(params.browser_state); |
89 // Send creation event and create the web controller. | 91 // Send creation event and create the web controller. |
90 GlobalWebStateEventTracker::GetInstance()->OnWebStateCreated(this); | 92 GlobalWebStateEventTracker::GetInstance()->OnWebStateCreated(this); |
91 web_controller_.reset([[CRWWebController alloc] initWithWebState:this]); | 93 web_controller_.reset([[CRWWebController alloc] initWithWebState:this]); |
92 } | 94 } |
93 | 95 |
(...skipping 615 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
709 const LoadCommittedDetails& load_details) { | 711 const LoadCommittedDetails& load_details) { |
710 for (auto& observer : observers_) | 712 for (auto& observer : observers_) |
711 observer.NavigationItemCommitted(load_details); | 713 observer.NavigationItemCommitted(load_details); |
712 } | 714 } |
713 | 715 |
714 WebState* WebStateImpl::GetWebState() { | 716 WebState* WebStateImpl::GetWebState() { |
715 return this; | 717 return this; |
716 } | 718 } |
717 | 719 |
718 } // namespace web | 720 } // namespace web |
OLD | NEW |