| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 #include "components/sessions/ios/ios_serialized_navigation_builder.h" | 5 #include "components/sessions/ios/ios_serialized_navigation_builder.h" |
| 6 | 6 |
| 7 #include "components/sessions/core/serialized_navigation_entry.h" | 7 #include "components/sessions/core/serialized_navigation_entry.h" |
| 8 #include "ios/web/public/favicon_status.h" | 8 #include "ios/web/public/favicon_status.h" |
| 9 #include "ios/web/public/navigation_item.h" | 9 #include "ios/web/public/navigation_item.h" |
| 10 #include "ios/web/public/referrer.h" | 10 #include "ios/web/public/referrer.h" |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 45 item->SetTimestamp(navigation->timestamp_); | 45 item->SetTimestamp(navigation->timestamp_); |
| 46 | 46 |
| 47 if (navigation->favicon_url_.is_valid()) { | 47 if (navigation->favicon_url_.is_valid()) { |
| 48 item->GetFavicon().url = navigation->favicon_url_; | 48 item->GetFavicon().url = navigation->favicon_url_; |
| 49 } | 49 } |
| 50 | 50 |
| 51 return item; | 51 return item; |
| 52 } | 52 } |
| 53 | 53 |
| 54 // static | 54 // static |
| 55 ScopedVector<web::NavigationItem> | 55 std::vector<std::unique_ptr<web::NavigationItem>> |
| 56 IOSSerializedNavigationBuilder::ToNavigationItems( | 56 IOSSerializedNavigationBuilder::ToNavigationItems( |
| 57 const std::vector<SerializedNavigationEntry>& navigations) { | 57 const std::vector<SerializedNavigationEntry>& navigations) { |
| 58 ScopedVector<web::NavigationItem> items; | 58 std::vector<std::unique_ptr<web::NavigationItem>> items; |
| 59 for (std::vector<SerializedNavigationEntry>::const_iterator it = | 59 for (const auto& navigation : navigations) |
| 60 navigations.begin(); | 60 items.push_back(ToNavigationItem(&navigation)); |
| 61 it != navigations.end(); ++it) { | 61 |
| 62 items.push_back(ToNavigationItem(&(*it)).release()); | |
| 63 } | |
| 64 return items; | 62 return items; |
| 65 } | 63 } |
| 66 | 64 |
| 67 } // namespace sessions | 65 } // namespace sessions |
| OLD | NEW |