OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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 #include "chrome/browser/history/url_index_private_data.h" | 5 #include "chrome/browser/history/url_index_private_data.h" |
6 | 6 |
7 #include <functional> | 7 #include <functional> |
8 #include <iterator> | 8 #include <iterator> |
9 #include <limits> | 9 #include <limits> |
10 #include <numeric> | 10 #include <numeric> |
(...skipping 1164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1175 url_row.set_title(title); | 1175 url_row.set_title(title); |
1176 } | 1176 } |
1177 history_info_map_[history_id].url_row = url_row; | 1177 history_info_map_[history_id].url_row = url_row; |
1178 | 1178 |
1179 // Restore visits list. | 1179 // Restore visits list. |
1180 VisitInfoVector visits; | 1180 VisitInfoVector visits; |
1181 visits.reserve(iter->visits_size()); | 1181 visits.reserve(iter->visits_size()); |
1182 for (int i = 0; i < iter->visits_size(); ++i) { | 1182 for (int i = 0; i < iter->visits_size(); ++i) { |
1183 visits.push_back(std::make_pair( | 1183 visits.push_back(std::make_pair( |
1184 base::Time::FromInternalValue(iter->visits(i).visit_time()), | 1184 base::Time::FromInternalValue(iter->visits(i).visit_time()), |
1185 static_cast<content::PageTransition>(iter->visits(i). | 1185 ui::PageTransitionFromInt(iter->visits(i).transition_type()))); |
1186 transition_type()))); | |
1187 } | 1186 } |
1188 history_info_map_[history_id].visits = visits; | 1187 history_info_map_[history_id].visits = visits; |
1189 } | 1188 } |
1190 return true; | 1189 return true; |
1191 } | 1190 } |
1192 | 1191 |
1193 bool URLIndexPrivateData::RestoreWordStartsMap( | 1192 bool URLIndexPrivateData::RestoreWordStartsMap( |
1194 const InMemoryURLIndexCacheItem& cache, | 1193 const InMemoryURLIndexCacheItem& cache, |
1195 const std::string& languages) { | 1194 const std::string& languages) { |
1196 // Note that this function must be called after RestoreHistoryInfoMap() has | 1195 // Note that this function must be called after RestoreHistoryInfoMap() has |
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1341 // recently visited (within the last 12/24 hours) as highly important. Get | 1340 // recently visited (within the last 12/24 hours) as highly important. Get |
1342 // input from mpearson. | 1341 // input from mpearson. |
1343 if (r1.typed_count() != r2.typed_count()) | 1342 if (r1.typed_count() != r2.typed_count()) |
1344 return (r1.typed_count() > r2.typed_count()); | 1343 return (r1.typed_count() > r2.typed_count()); |
1345 if (r1.visit_count() != r2.visit_count()) | 1344 if (r1.visit_count() != r2.visit_count()) |
1346 return (r1.visit_count() > r2.visit_count()); | 1345 return (r1.visit_count() > r2.visit_count()); |
1347 return (r1.last_visit() > r2.last_visit()); | 1346 return (r1.last_visit() > r2.last_visit()); |
1348 } | 1347 } |
1349 | 1348 |
1350 } // namespace history | 1349 } // namespace history |
OLD | NEW |