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

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

Issue 2915303002: Added NavigationManager::GetIndexOfItem(). (Closed)
Patch Set: rebase Created 3 years, 6 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 249 matching lines...) Expand 10 before | Expand all | Expand 10 after
260 } 260 }
261 261
262 int NavigationManagerImpl::GetItemCount() const { 262 int NavigationManagerImpl::GetItemCount() const {
263 return [session_controller_ items].size(); 263 return [session_controller_ items].size();
264 } 264 }
265 265
266 NavigationItem* NavigationManagerImpl::GetItemAtIndex(size_t index) const { 266 NavigationItem* NavigationManagerImpl::GetItemAtIndex(size_t index) const {
267 return [session_controller_ itemAtIndex:index]; 267 return [session_controller_ itemAtIndex:index];
268 } 268 }
269 269
270 int NavigationManagerImpl::GetIndexOfItem(
271 const web::NavigationItem* item) const {
272 return [session_controller_ indexOfItem:item];
273 }
274
270 int NavigationManagerImpl::GetPendingItemIndex() const { 275 int NavigationManagerImpl::GetPendingItemIndex() const {
271 if (GetPendingItem()) { 276 if (GetPendingItem()) {
272 if ([session_controller_ pendingItemIndex] != -1) { 277 if ([session_controller_ pendingItemIndex] != -1) {
273 return [session_controller_ pendingItemIndex]; 278 return [session_controller_ pendingItemIndex];
274 } 279 }
275 // TODO(crbug.com/665189): understand why last committed item index is 280 // TODO(crbug.com/665189): understand why last committed item index is
276 // returned here. 281 // returned here.
277 return GetLastCommittedItemIndex(); 282 return GetLastCommittedItemIndex();
278 } 283 }
279 return -1; 284 return -1;
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after
443 const ScopedNavigationItemImplList& items = [session_controller_ items]; 448 const ScopedNavigationItemImplList& items = [session_controller_ items];
444 while (index >= 0) { 449 while (index >= 0) {
445 NavigationItem* item = items[index--].get(); 450 NavigationItem* item = items[index--].get();
446 if (!client->IsAppSpecificURL(item->GetVirtualURL())) 451 if (!client->IsAppSpecificURL(item->GetVirtualURL()))
447 return item; 452 return item;
448 } 453 }
449 return nullptr; 454 return nullptr;
450 } 455 }
451 456
452 } // namespace web 457 } // 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