| 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/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 Loading... |
| 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 NavigationManagerDelegate* delegate, | 74 : delegate_(nullptr), browser_state_(nullptr), facade_delegate_(nullptr) {} |
| 75 BrowserState* browser_state) | |
| 76 : delegate_(delegate), | |
| 77 browser_state_(browser_state), | |
| 78 facade_delegate_(nullptr) { | |
| 79 DCHECK(browser_state_); | |
| 80 } | |
| 81 | 75 |
| 82 NavigationManagerImpl::~NavigationManagerImpl() { | 76 NavigationManagerImpl::~NavigationManagerImpl() { |
| 83 // The facade layer should be deleted before this object. | 77 // The facade layer should be deleted before this object. |
| 84 DCHECK(!facade_delegate_); | 78 DCHECK(!facade_delegate_); |
| 85 | 79 |
| 86 [session_controller_ setNavigationManager:nullptr]; | 80 [session_controller_ setNavigationManager:nullptr]; |
| 87 } | 81 } |
| 88 | 82 |
| 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 |
| 89 void NavigationManagerImpl::SetSessionController( | 91 void NavigationManagerImpl::SetSessionController( |
| 90 CRWSessionController* session_controller) { | 92 CRWSessionController* session_controller) { |
| 91 session_controller_.reset(session_controller); | 93 session_controller_.reset(session_controller); |
| 92 [session_controller_ setNavigationManager:this]; | 94 [session_controller_ setNavigationManager:this]; |
| 93 } | 95 } |
| 94 | 96 |
| 95 void NavigationManagerImpl::InitializeSession(NSString* window_name, | 97 void NavigationManagerImpl::InitializeSession(NSString* window_name, |
| 96 NSString* opener_id, | 98 NSString* opener_id, |
| 97 BOOL opened_by_dom, | 99 BOOL opened_by_dom, |
| 98 int opener_navigation_index) { | 100 int opener_navigation_index) { |
| (...skipping 298 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 397 } | 399 } |
| 398 | 400 |
| 399 bool NavigationManagerImpl::IsRedirectItemAtIndex(int index) const { | 401 bool NavigationManagerImpl::IsRedirectItemAtIndex(int index) const { |
| 400 DCHECK_GT(index, 0); | 402 DCHECK_GT(index, 0); |
| 401 DCHECK_LT(index, GetItemCount()); | 403 DCHECK_LT(index, GetItemCount()); |
| 402 ui::PageTransition transition = GetItemAtIndex(index)->GetTransitionType(); | 404 ui::PageTransition transition = GetItemAtIndex(index)->GetTransitionType(); |
| 403 return transition & ui::PAGE_TRANSITION_IS_REDIRECT_MASK; | 405 return transition & ui::PAGE_TRANSITION_IS_REDIRECT_MASK; |
| 404 } | 406 } |
| 405 | 407 |
| 406 } // namespace web | 408 } // namespace web |
| OLD | NEW |