| OLD | NEW |
| 1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 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/crw_session_controller.h" | 5 #import "ios/web/navigation/crw_session_controller.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <algorithm> | 9 #include <algorithm> |
| 10 #include <utility> | 10 #include <utility> |
| (...skipping 668 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 679 return [_entries objectAtIndex:index]; | 679 return [_entries objectAtIndex:index]; |
| 680 } | 680 } |
| 681 | 681 |
| 682 - (void)useDesktopUserAgentForNextPendingItem { | 682 - (void)useDesktopUserAgentForNextPendingItem { |
| 683 if (_pendingEntry) | 683 if (_pendingEntry) |
| 684 [_pendingEntry navigationItem]->SetIsOverridingUserAgent(true); | 684 [_pendingEntry navigationItem]->SetIsOverridingUserAgent(true); |
| 685 else | 685 else |
| 686 _useDesktopUserAgentForNextPendingItem = YES; | 686 _useDesktopUserAgentForNextPendingItem = YES; |
| 687 } | 687 } |
| 688 | 688 |
| 689 - (NSInteger)indexOfItem:(web::NavigationItem*)item { | 689 - (NSInteger)indexOfItem:(const web::NavigationItem*)item { |
| 690 web::NavigationItemList items = self.items; | 690 web::NavigationItemList items = self.items; |
| 691 for (NSInteger i = 0; i < static_cast<NSInteger>(items.size()); ++i) { | 691 for (NSInteger i = 0; i < static_cast<NSInteger>(items.size()); ++i) { |
| 692 if (items[i] == item) | 692 if (items[i] == item) |
| 693 return i; | 693 return i; |
| 694 } | 694 } |
| 695 return NSNotFound; | 695 return NSNotFound; |
| 696 } | 696 } |
| 697 | 697 |
| 698 #pragma mark - | 698 #pragma mark - |
| 699 #pragma mark Private methods | 699 #pragma mark Private methods |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 745 } | 745 } |
| 746 | 746 |
| 747 - (web::NavigationItemList)itemListForEntryList:(NSArray*)entries { | 747 - (web::NavigationItemList)itemListForEntryList:(NSArray*)entries { |
| 748 web::NavigationItemList list(entries.count); | 748 web::NavigationItemList list(entries.count); |
| 749 for (size_t index = 0; index < entries.count; ++index) | 749 for (size_t index = 0; index < entries.count; ++index) |
| 750 list[index] = [entries[index] navigationItem]; | 750 list[index] = [entries[index] navigationItem]; |
| 751 return list; | 751 return list; |
| 752 } | 752 } |
| 753 | 753 |
| 754 @end | 754 @end |
| OLD | NEW |