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/history_url_provider.h" | 5 #include "components/omnibox/browser/history_url_provider.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 598 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
609 match.contents, | 609 match.contents, |
610 ACMatchClassification::URL, | 610 ACMatchClassification::URL, |
611 &match.contents_class); | 611 &match.contents_class); |
612 } else { | 612 } else { |
613 AutocompleteMatch::ClassifyLocationInString( | 613 AutocompleteMatch::ClassifyLocationInString( |
614 best_prefix->prefix.length() - offset, input.text().length(), | 614 best_prefix->prefix.length() - offset, input.text().length(), |
615 match.contents.length(), ACMatchClassification::URL, | 615 match.contents.length(), ACMatchClassification::URL, |
616 &match.contents_class); | 616 &match.contents_class); |
617 } | 617 } |
618 } | 618 } |
619 | |
620 return match; | 619 return match; |
Mark P
2017/04/12 17:58:46
nit: might as well keep the blank line here
(parti
gcomanici
2017/04/12 19:25:00
Done.
| |
621 } | 620 } |
622 | 621 |
623 void HistoryURLProvider::ExecuteWithDB(HistoryURLProviderParams* params, | 622 void HistoryURLProvider::ExecuteWithDB(HistoryURLProviderParams* params, |
624 history::HistoryBackend* backend, | 623 history::HistoryBackend* backend, |
625 history::URLDatabase* db) { | 624 history::URLDatabase* db) { |
626 // We may get called with a null database if it couldn't be properly | 625 // We may get called with a null database if it couldn't be properly |
627 // initialized. | 626 // initialized. |
628 if (!db) { | 627 if (!db) { |
629 params->failed = true; | 628 params->failed = true; |
630 } else if (!params->cancel_flag.IsSet()) { | 629 } else if (!params->cancel_flag.IsSet()) { |
(...skipping 556 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1187 AutocompleteMatch::ClassifyLocationInString(base::string16::npos, 0, | 1186 AutocompleteMatch::ClassifyLocationInString(base::string16::npos, 0, |
1188 match.contents.length(), ACMatchClassification::URL, | 1187 match.contents.length(), ACMatchClassification::URL, |
1189 &match.contents_class); | 1188 &match.contents_class); |
1190 } | 1189 } |
1191 match.description = info.title(); | 1190 match.description = info.title(); |
1192 match.description_class = | 1191 match.description_class = |
1193 ClassifyDescription(params.input.text(), match.description); | 1192 ClassifyDescription(params.input.text(), match.description); |
1194 RecordAdditionalInfoFromUrlRow(info, &match); | 1193 RecordAdditionalInfoFromUrlRow(info, &match); |
1195 return match; | 1194 return match; |
1196 } | 1195 } |
OLD | NEW |