| 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" |
| 11 #include "components/omnibox/browser/verbatim_match.h" | 11 #include "components/omnibox/browser/verbatim_match.h" |
| 12 #include "components/open_from_clipboard/clipboard_recent_content.h" | 12 #include "components/open_from_clipboard/clipboard_recent_content.h" |
| 13 #include "components/strings/grit/components_strings.h" |
| 13 #include "components/url_formatter/url_formatter.h" | 14 #include "components/url_formatter/url_formatter.h" |
| 14 #include "grit/components_strings.h" | |
| 15 #include "ui/base/l10n/l10n_util.h" | 15 #include "ui/base/l10n/l10n_util.h" |
| 16 | 16 |
| 17 ClipboardURLProvider::ClipboardURLProvider( | 17 ClipboardURLProvider::ClipboardURLProvider( |
| 18 AutocompleteProviderClient* client, | 18 AutocompleteProviderClient* client, |
| 19 HistoryURLProvider* history_url_provider, | 19 HistoryURLProvider* history_url_provider, |
| 20 ClipboardRecentContent* clipboard_content) | 20 ClipboardRecentContent* clipboard_content) |
| 21 : AutocompleteProvider(AutocompleteProvider::TYPE_CLIPBOARD_URL), | 21 : AutocompleteProvider(AutocompleteProvider::TYPE_CLIPBOARD_URL), |
| 22 client_(client), | 22 client_(client), |
| 23 clipboard_content_(clipboard_content), | 23 clipboard_content_(clipboard_content), |
| 24 history_url_provider_(history_url_provider) { | 24 history_url_provider_(history_url_provider) { |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 matches_.push_back(match); | 69 matches_.push_back(match); |
| 70 } | 70 } |
| OLD | NEW |