| 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 402 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 413 // Result may be out of bounds, so stop trying to skip redirect items and | 413 // Result may be out of bounds, so stop trying to skip redirect items and |
| 414 // simply add the remainder. | 414 // simply add the remainder. |
| 415 result += offset; | 415 result += offset; |
| 416 if (result < 0 /* overflow */) | 416 if (result < 0 /* overflow */) |
| 417 result = INT_MAX; | 417 result = INT_MAX; |
| 418 } | 418 } |
| 419 | 419 |
| 420 return result; | 420 return result; |
| 421 } | 421 } |
| 422 | 422 |
| 423 bool NavigationManagerImpl::GetUseDesktopUserAgent() const { |
| 424 return GetVisibleItem() && GetVisibleItem()->IsOverridingUserAgent(); |
| 425 } |
| 426 |
| 423 void NavigationManagerImpl::OverrideDesktopUserAgentForNextPendingItem() { | 427 void NavigationManagerImpl::OverrideDesktopUserAgentForNextPendingItem() { |
| 424 if (GetPendingItem()) | 428 if (GetPendingItem()) |
| 425 GetPendingItem()->SetIsOverridingUserAgent(true); | 429 GetPendingItem()->SetIsOverridingUserAgent(true); |
| 426 else | 430 else |
| 427 override_desktop_user_agent_for_next_pending_item_ = true; | 431 override_desktop_user_agent_for_next_pending_item_ = true; |
| 428 } | 432 } |
| 429 | 433 |
| 430 bool NavigationManagerImpl::IsRedirectItemAtIndex(int index) const { | 434 bool NavigationManagerImpl::IsRedirectItemAtIndex(int index) const { |
| 431 DCHECK_GT(index, 0); | 435 DCHECK_GT(index, 0); |
| 432 DCHECK_LT(index, GetItemCount()); | 436 DCHECK_LT(index, GetItemCount()); |
| 433 ui::PageTransition transition = GetItemAtIndex(index)->GetTransitionType(); | 437 ui::PageTransition transition = GetItemAtIndex(index)->GetTransitionType(); |
| 434 return transition & ui::PAGE_TRANSITION_IS_REDIRECT_MASK; | 438 return transition & ui::PAGE_TRANSITION_IS_REDIRECT_MASK; |
| 435 } | 439 } |
| 436 | 440 |
| 437 } // namespace web | 441 } // namespace web |
| OLD | NEW |