| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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/autocomplete/history_url_provider.h" | 5 #include "chrome/browser/autocomplete/history_url_provider.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
| 10 #include "base/histogram.h" | 10 #include "base/histogram.h" |
| (...skipping 566 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 577 } | 577 } |
| 578 | 578 |
| 579 // No entry, so create one. | 579 // No entry, so create one. |
| 580 HistoryMatch match(info, input_location, match_in_scheme, true); | 580 HistoryMatch match(info, input_location, match_in_scheme, true); |
| 581 if (promote) | 581 if (promote) |
| 582 matches->push_front(match); | 582 matches->push_front(match); |
| 583 else | 583 else |
| 584 matches->push_back(match); | 584 matches->push_back(match); |
| 585 } | 585 } |
| 586 | 586 |
| 587 void HistoryURLProvider::RunAutocompletePasses(const AutocompleteInput& input, | 587 void HistoryURLProvider::RunAutocompletePasses( |
| 588 bool fixup_input_and_run_pass_1)
{ | 588 const AutocompleteInput& input, |
| 589 bool fixup_input_and_run_pass_1) { |
| 589 matches_.clear(); | 590 matches_.clear(); |
| 590 | 591 |
| 591 if ((input.type() != AutocompleteInput::UNKNOWN) && | 592 if ((input.type() != AutocompleteInput::UNKNOWN) && |
| 592 (input.type() != AutocompleteInput::REQUESTED_URL) && | 593 (input.type() != AutocompleteInput::REQUESTED_URL) && |
| 593 (input.type() != AutocompleteInput::URL)) | 594 (input.type() != AutocompleteInput::URL)) |
| 594 return; | 595 return; |
| 595 | 596 |
| 596 // Create a match for exactly what the user typed. This will always be one | 597 // Create a match for exactly what the user typed. This will always be one |
| 597 // of the top two results we return. | 598 // of the top two results we return. |
| 598 const bool trim_http = !url_util::FindAndCompareScheme( | 599 const bool trim_http = !url_util::FindAndCompareScheme( |
| (...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 832 history_match.input_location - offset, params->input.text().length(), | 833 history_match.input_location - offset, params->input.text().length(), |
| 833 match.contents.length(), ACMatchClassification::URL, | 834 match.contents.length(), ACMatchClassification::URL, |
| 834 &match.contents_class); | 835 &match.contents_class); |
| 835 match.description = info.title(); | 836 match.description = info.title(); |
| 836 AutocompleteMatch::ClassifyMatchInString(params->input.text(), info.title(), | 837 AutocompleteMatch::ClassifyMatchInString(params->input.text(), info.title(), |
| 837 ACMatchClassification::NONE, | 838 ACMatchClassification::NONE, |
| 838 &match.description_class); | 839 &match.description_class); |
| 839 | 840 |
| 840 return match; | 841 return match; |
| 841 } | 842 } |
| OLD | NEW |