| OLD | NEW |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 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_item_impl_list.h" | 5 #import "ios/web/navigation/navigation_item_impl_list.h" |
| 6 | 6 |
| 7 #import "ios/web/navigation/navigation_item_impl.h" | 7 #import "ios/web/navigation/navigation_item_impl.h" |
| 8 | 8 |
| 9 namespace web { | 9 namespace web { |
| 10 | 10 |
| 11 ScopedNavigationItemImplList CreateScopedNavigationItemImplList( | 11 ScopedNavigationItemImplList CreateScopedNavigationItemImplList( |
| 12 ScopedNavigationItemList scoped_item_list) { | 12 ScopedNavigationItemList scoped_item_list) { |
| 13 ScopedNavigationItemImplList list(scoped_item_list.size()); | 13 ScopedNavigationItemImplList list(scoped_item_list.size()); |
| 14 for (size_t index = 0; index < scoped_item_list.size(); ++index) { | 14 for (size_t index = 0; index < scoped_item_list.size(); ++index) { |
| 15 std::unique_ptr<NavigationItemImpl> scoped_item_impl( | 15 std::unique_ptr<NavigationItemImpl> scoped_item_impl( |
| 16 static_cast<NavigationItemImpl*>(scoped_item_list[index].release())); | 16 static_cast<NavigationItemImpl*>(scoped_item_list[index].release())); |
| 17 list[index] = std::move(scoped_item_impl); | 17 list[index] = std::move(scoped_item_impl); |
| 18 } | 18 } |
| 19 return list; | 19 return list; |
| 20 } | 20 } |
| 21 | 21 |
| 22 NavigationItemList CreateNavigationItemList( |
| 23 ScopedNavigationItemImplList& scoped_item_list) { |
| 24 NavigationItemList list(scoped_item_list.size()); |
| 25 for (size_t index = 0; index < scoped_item_list.size(); ++index) { |
| 26 list[index] = scoped_item_list[index].get(); |
| 27 } |
| 28 return list; |
| 29 } |
| 30 |
| 22 } // namespace web | 31 } // namespace web |
| OLD | NEW |