OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/clipboard_url_provider.h" | 5 #include "components/omnibox/browser/clipboard_url_provider.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "base/strings/utf_string_conversions.h" | 8 #include "base/strings/utf_string_conversions.h" |
9 #include "components/omnibox/browser/autocomplete_input.h" | 9 #include "components/omnibox/browser/autocomplete_input.h" |
10 #include "components/omnibox/browser/autocomplete_provider_client.h" | 10 #include "components/omnibox/browser/autocomplete_provider_client.h" |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
59 nullptr, nullptr, nullptr)); | 59 nullptr, nullptr, nullptr)); |
60 AutocompleteMatch::ClassifyLocationInString( | 60 AutocompleteMatch::ClassifyLocationInString( |
61 base::string16::npos, 0, match.contents.length(), | 61 base::string16::npos, 0, match.contents.length(), |
62 ACMatchClassification::URL, &match.contents_class); | 62 ACMatchClassification::URL, &match.contents_class); |
63 | 63 |
64 match.description.assign(l10n_util::GetStringUTF16(IDS_LINK_FROM_CLIPBOARD)); | 64 match.description.assign(l10n_util::GetStringUTF16(IDS_LINK_FROM_CLIPBOARD)); |
65 AutocompleteMatch::ClassifyLocationInString( | 65 AutocompleteMatch::ClassifyLocationInString( |
66 base::string16::npos, 0, match.description.length(), | 66 base::string16::npos, 0, match.description.length(), |
67 ACMatchClassification::NONE, &match.description_class); | 67 ACMatchClassification::NONE, &match.description_class); |
68 | 68 |
69 // At least one match must be default, so if verbatim_match was invalid, | |
70 // the clipboard match is allowed to be default. | |
71 match.allowed_to_be_default_match = matches_.empty(); | |
72 matches_.push_back(match); | 69 matches_.push_back(match); |
73 } | 70 } |
OLD | NEW |