OLD | NEW |
---|---|
(Empty) | |
1 // Copyright (c) 2016 The Chromium Authors. All rights reserved. | |
Peter Kasting
2016/04/12 00:55:08
Nit: Wrong copyright header (no (c))
Alexander Yashkin
2016/04/12 09:09:20
Done.
| |
2 // Use of this source code is governed by a BSD-style license that can be | |
3 // found in the LICENSE file. | |
4 | |
5 #ifndef COMPONENTS_OMNIBOX_BROWSER_SHORTCUT_MATCH_H_ | |
6 #define COMPONENTS_OMNIBOX_BROWSER_SHORTCUT_MATCH_H_ | |
7 | |
8 #include <vector> | |
9 | |
10 #include "base/strings/string16.h" | |
11 #include "components/omnibox/browser/shortcuts_backend.h" | |
12 #include "url/gurl.h" | |
13 | |
14 // Structure that describes match from shortcut database. It holds only | |
15 // information necessary for shortcut deduplication and relevance sort. | |
16 // It is converted to AutocompleteMatch at final stage of shortcuts provider | |
17 // processing. | |
Peter Kasting
2016/04/12 00:55:08
Nit: How about:
ShortcutMatch holds sufficient in
Alexander Yashkin
2016/04/12 09:09:20
Done, thanks.
| |
18 struct ShortcutMatch { | |
19 ShortcutMatch(int relevance, | |
20 const GURL& stripped_destination_url, | |
21 const ShortcutsDatabase::Shortcut* shortcut); | |
22 static bool DestinationsEqual(const ShortcutMatch& elem1, | |
Peter Kasting
2016/04/12 00:55:08
Why are these next two methods static on this clas
Alexander Yashkin
2016/04/12 09:09:20
I agree that DedupShortcutMatchesByDestination is
| |
23 const ShortcutMatch& elem2); | |
24 static void DedupShortcutMatchesByDestination( | |
25 metrics::OmniboxEventProto::PageClassification page_classification, | |
26 std::vector<ShortcutMatch>* matches); | |
27 | |
28 int relevance; | |
29 GURL stripped_destination_url; | |
30 const ShortcutsDatabase::Shortcut* shortcut; | |
31 base::string16 contents; | |
32 AutocompleteMatch::Type type; | |
33 }; | |
34 | |
35 typedef std::vector<ShortcutMatch> ShortcutMatches; | |
36 | |
37 #endif // COMPONENTS_YANDEX_OMNIBOX_BROWSER_SHORTCUT_MATCH_H_ | |
OLD | NEW |