Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(576)

Side by Side Diff: ios/web/web_state/web_state_impl.mm

Issue 2698413004: Implemented WebStateObserver::DidFinishNavigation(NavigationHandle*). (Closed)
Patch Set: Addressed review comments Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « ios/web/web_state/web_state_impl.h ('k') | ios/web/web_state/web_state_impl_unittest.mm » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 13 matching lines...) Expand all
24 #import "ios/web/public/web_client.h" 24 #import "ios/web/public/web_client.h"
25 #import "ios/web/public/web_state/context_menu_params.h" 25 #import "ios/web/public/web_state/context_menu_params.h"
26 #include "ios/web/public/web_state/credential.h" 26 #include "ios/web/public/web_state/credential.h"
27 #import "ios/web/public/web_state/ui/crw_content_view.h" 27 #import "ios/web/public/web_state/ui/crw_content_view.h"
28 #import "ios/web/public/web_state/web_state_delegate.h" 28 #import "ios/web/public/web_state/web_state_delegate.h"
29 #include "ios/web/public/web_state/web_state_observer.h" 29 #include "ios/web/public/web_state/web_state_observer.h"
30 #import "ios/web/public/web_state/web_state_policy_decider.h" 30 #import "ios/web/public/web_state/web_state_policy_decider.h"
31 #include "ios/web/public/web_thread.h" 31 #include "ios/web/public/web_thread.h"
32 #include "ios/web/public/webui/web_ui_ios_controller.h" 32 #include "ios/web/public/webui/web_ui_ios_controller.h"
33 #include "ios/web/web_state/global_web_state_event_tracker.h" 33 #include "ios/web/web_state/global_web_state_event_tracker.h"
34 #include "ios/web/web_state/navigation_context_impl.h"
34 #import "ios/web/web_state/ui/crw_web_controller.h" 35 #import "ios/web/web_state/ui/crw_web_controller.h"
35 #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"
36 #include "ios/web/web_state/web_state_facade_delegate.h" 37 #include "ios/web/web_state/web_state_facade_delegate.h"
37 #include "ios/web/webui/web_ui_ios_controller_factory_registry.h" 38 #include "ios/web/webui/web_ui_ios_controller_factory_registry.h"
38 #include "ios/web/webui/web_ui_ios_impl.h" 39 #include "ios/web/webui/web_ui_ios_impl.h"
39 #include "net/http/http_response_headers.h" 40 #include "net/http/http_response_headers.h"
40 #include "services/service_manager/public/cpp/interface_registry.h" 41 #include "services/service_manager/public/cpp/interface_registry.h"
41 42
42 namespace web { 43 namespace web {
43 44
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after
179 WebStateFacadeDelegate* WebStateImpl::GetFacadeDelegate() const { 180 WebStateFacadeDelegate* WebStateImpl::GetFacadeDelegate() const {
180 return facade_delegate_; 181 return facade_delegate_;
181 } 182 }
182 183
183 void WebStateImpl::SetFacadeDelegate(WebStateFacadeDelegate* facade_delegate) { 184 void WebStateImpl::SetFacadeDelegate(WebStateFacadeDelegate* facade_delegate) {
184 facade_delegate_ = facade_delegate; 185 facade_delegate_ = facade_delegate;
185 } 186 }
186 187
187 void WebStateImpl::OnNavigationCommitted(const GURL& url) { 188 void WebStateImpl::OnNavigationCommitted(const GURL& url) {
188 UpdateHttpResponseHeaders(url); 189 UpdateHttpResponseHeaders(url);
190 std::unique_ptr<NavigationContext> context =
191 NavigationContextImpl::CreateNavigationContext(this, url);
192 for (auto& observer : observers_)
193 observer.DidFinishNavigation(context.get());
189 } 194 }
190 195
191 void WebStateImpl::OnUrlHashChanged() { 196 void WebStateImpl::OnUrlHashChanged() {
192 for (auto& observer : observers_) 197 for (auto& observer : observers_)
193 observer.UrlHashChanged(); 198 observer.UrlHashChanged();
194 } 199 }
195 200
196 void WebStateImpl::OnHistoryStateChanged() { 201 void WebStateImpl::OnHistoryStateChanged() {
197 for (auto& observer : observers_) 202 for (auto& observer : observers_)
198 observer.HistoryStateChanged(); 203 observer.HistoryStateChanged();
199 } 204 }
200 205
206 void WebStateImpl::OnSamePageNavigation(const GURL& url) {
207 std::unique_ptr<NavigationContext> context =
208 NavigationContextImpl::CreateSamePageNavigationContext(this, url);
209 for (auto& observer : observers_)
210 observer.DidFinishNavigation(context.get());
211 }
212
213 void WebStateImpl::OnErrorPageNavigation(const GURL& url) {
214 std::unique_ptr<NavigationContext> context =
215 NavigationContextImpl::CreateErrorPageNavigationContext(this, url);
216 for (auto& observer : observers_)
217 observer.DidFinishNavigation(context.get());
218 }
219
201 void WebStateImpl::OnRenderProcessGone() { 220 void WebStateImpl::OnRenderProcessGone() {
202 for (auto& observer : observers_) 221 for (auto& observer : observers_)
203 observer.RenderProcessGone(); 222 observer.RenderProcessGone();
204 } 223 }
205 224
206 bool WebStateImpl::OnScriptCommandReceived(const std::string& command, 225 bool WebStateImpl::OnScriptCommandReceived(const std::string& command,
207 const base::DictionaryValue& value, 226 const base::DictionaryValue& value,
208 const GURL& url, 227 const GURL& url,
209 bool user_is_interacting) { 228 bool user_is_interacting) {
210 size_t dot_position = command.find_first_of('.'); 229 size_t dot_position = command.find_first_of('.');
(...skipping 511 matching lines...) Expand 10 before | Expand all | Expand 10 after
722 const LoadCommittedDetails& load_details) { 741 const LoadCommittedDetails& load_details) {
723 for (auto& observer : observers_) 742 for (auto& observer : observers_)
724 observer.NavigationItemCommitted(load_details); 743 observer.NavigationItemCommitted(load_details);
725 } 744 }
726 745
727 WebState* WebStateImpl::GetWebState() { 746 WebState* WebStateImpl::GetWebState() {
728 return this; 747 return this;
729 } 748 }
730 749
731 } // namespace web 750 } // namespace web
OLDNEW
« no previous file with comments | « ios/web/web_state/web_state_impl.h ('k') | ios/web/web_state/web_state_impl_unittest.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698