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 "components/omnibox/browser/url_index_private_data.h" | 5 #include "components/omnibox/browser/url_index_private_data.h" |
6 | 6 |
7 #include <stdint.h> | 7 #include <stdint.h> |
8 | 8 |
9 #include <functional> | 9 #include <functional> |
10 #include <iterator> | 10 #include <iterator> |
(...skipping 12 matching lines...) Expand all Loading... |
23 #include "base/strings/utf_string_conversions.h" | 23 #include "base/strings/utf_string_conversions.h" |
24 #include "base/time/time.h" | 24 #include "base/time/time.h" |
25 #include "components/bookmarks/browser/bookmark_model.h" | 25 #include "components/bookmarks/browser/bookmark_model.h" |
26 #include "components/bookmarks/browser/bookmark_utils.h" | 26 #include "components/bookmarks/browser/bookmark_utils.h" |
27 #include "components/history/core/browser/history_database.h" | 27 #include "components/history/core/browser/history_database.h" |
28 #include "components/history/core/browser/history_db_task.h" | 28 #include "components/history/core/browser/history_db_task.h" |
29 #include "components/history/core/browser/history_service.h" | 29 #include "components/history/core/browser/history_service.h" |
30 #include "components/omnibox/browser/in_memory_url_index.h" | 30 #include "components/omnibox/browser/in_memory_url_index.h" |
31 #include "components/search_engines/template_url_service.h" | 31 #include "components/search_engines/template_url_service.h" |
32 #include "components/url_formatter/url_formatter.h" | 32 #include "components/url_formatter/url_formatter.h" |
33 | |
34 #if defined(USE_SYSTEM_PROTOBUF) | |
35 #include <google/protobuf/repeated_field.h> | |
36 #else | |
37 #include "third_party/protobuf/src/google/protobuf/repeated_field.h" | 33 #include "third_party/protobuf/src/google/protobuf/repeated_field.h" |
38 #endif | |
39 | 34 |
40 namespace { | 35 namespace { |
41 | 36 |
42 using google::protobuf::RepeatedField; | 37 using google::protobuf::RepeatedField; |
43 using google::protobuf::RepeatedPtrField; | 38 using google::protobuf::RepeatedPtrField; |
44 using in_memory_url_index::InMemoryURLIndexCacheItem; | 39 using in_memory_url_index::InMemoryURLIndexCacheItem; |
45 | 40 |
46 typedef in_memory_url_index::InMemoryURLIndexCacheItem_WordListItem | 41 typedef in_memory_url_index::InMemoryURLIndexCacheItem_WordListItem |
47 WordListItem; | 42 WordListItem; |
48 typedef in_memory_url_index::InMemoryURLIndexCacheItem_WordMapItem_WordMapEntry | 43 typedef in_memory_url_index::InMemoryURLIndexCacheItem_WordMapItem_WordMapEntry |
(...skipping 1219 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1268 // First cut: typed count, visit count, recency. | 1263 // First cut: typed count, visit count, recency. |
1269 // TODO(mrossetti): This is too simplistic. Consider an approach which ranks | 1264 // TODO(mrossetti): This is too simplistic. Consider an approach which ranks |
1270 // recently visited (within the last 12/24 hours) as highly important. Get | 1265 // recently visited (within the last 12/24 hours) as highly important. Get |
1271 // input from mpearson. | 1266 // input from mpearson. |
1272 if (r1.typed_count() != r2.typed_count()) | 1267 if (r1.typed_count() != r2.typed_count()) |
1273 return (r1.typed_count() > r2.typed_count()); | 1268 return (r1.typed_count() > r2.typed_count()); |
1274 if (r1.visit_count() != r2.visit_count()) | 1269 if (r1.visit_count() != r2.visit_count()) |
1275 return (r1.visit_count() > r2.visit_count()); | 1270 return (r1.visit_count() > r2.visit_count()); |
1276 return (r1.last_visit() > r2.last_visit()); | 1271 return (r1.last_visit() > r2.last_visit()); |
1277 } | 1272 } |
OLD | NEW |