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

Side by Side Diff: ios/web/navigation/navigation_manager_impl.mm

Issue 2655253002: Revert of Moved NavigationManagerImpl serialization out of CRWSessionController. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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
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/navigation/navigation_manager_impl.h" 5 #import "ios/web/navigation/navigation_manager_impl.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <utility> 9 #include <utility>
10 10
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
63 url = other.url; 63 url = other.url;
64 referrer = other.referrer; 64 referrer = other.referrer;
65 is_renderer_initiated = other.is_renderer_initiated; 65 is_renderer_initiated = other.is_renderer_initiated;
66 transition_type = other.transition_type; 66 transition_type = other.transition_type;
67 extra_headers.reset([other.extra_headers copy]); 67 extra_headers.reset([other.extra_headers copy]);
68 post_data.reset([other.post_data copy]); 68 post_data.reset([other.post_data copy]);
69 69
70 return *this; 70 return *this;
71 } 71 }
72 72
73 NavigationManagerImpl::NavigationManagerImpl() 73 NavigationManagerImpl::NavigationManagerImpl(
74 : delegate_(nullptr), browser_state_(nullptr), facade_delegate_(nullptr) {} 74 NavigationManagerDelegate* delegate,
75 BrowserState* browser_state)
76 : delegate_(delegate),
77 browser_state_(browser_state),
78 facade_delegate_(nullptr) {
79 DCHECK(browser_state_);
80 }
75 81
76 NavigationManagerImpl::~NavigationManagerImpl() { 82 NavigationManagerImpl::~NavigationManagerImpl() {
77 // The facade layer should be deleted before this object. 83 // The facade layer should be deleted before this object.
78 DCHECK(!facade_delegate_); 84 DCHECK(!facade_delegate_);
79 85
80 [session_controller_ setNavigationManager:nullptr]; 86 [session_controller_ setNavigationManager:nullptr];
81 } 87 }
82 88
83 void NavigationManagerImpl::SetDelegate(NavigationManagerDelegate* delegate) {
84 delegate_ = delegate;
85 }
86
87 void NavigationManagerImpl::SetBrowserState(BrowserState* browser_state) {
88 browser_state_ = browser_state;
89 }
90
91 void NavigationManagerImpl::SetSessionController( 89 void NavigationManagerImpl::SetSessionController(
92 CRWSessionController* session_controller) { 90 CRWSessionController* session_controller) {
93 session_controller_.reset(session_controller); 91 session_controller_.reset(session_controller);
94 [session_controller_ setNavigationManager:this]; 92 [session_controller_ setNavigationManager:this];
95 } 93 }
96 94
97 void NavigationManagerImpl::InitializeSession(NSString* window_name, 95 void NavigationManagerImpl::InitializeSession(NSString* window_name,
98 NSString* opener_id, 96 NSString* opener_id,
99 BOOL opened_by_dom, 97 BOOL opened_by_dom,
100 int opener_navigation_index) { 98 int opener_navigation_index) {
(...skipping 298 matching lines...) Expand 10 before | Expand all | Expand 10 after
399 } 397 }
400 398
401 bool NavigationManagerImpl::IsRedirectItemAtIndex(int index) const { 399 bool NavigationManagerImpl::IsRedirectItemAtIndex(int index) const {
402 DCHECK_GT(index, 0); 400 DCHECK_GT(index, 0);
403 DCHECK_LT(index, GetItemCount()); 401 DCHECK_LT(index, GetItemCount());
404 ui::PageTransition transition = GetItemAtIndex(index)->GetTransitionType(); 402 ui::PageTransition transition = GetItemAtIndex(index)->GetTransitionType();
405 return transition & ui::PAGE_TRANSITION_IS_REDIRECT_MASK; 403 return transition & ui::PAGE_TRANSITION_IS_REDIRECT_MASK;
406 } 404 }
407 405
408 } // namespace web 406 } // namespace web
OLDNEW
« no previous file with comments | « ios/web/navigation/navigation_manager_impl.h ('k') | ios/web/navigation/navigation_manager_impl_unittest.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698