Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(216)

Side by Side Diff: components/omnibox/browser/clipboard_url_provider.cc

Issue 2266083002: Avoid DCHECK failure for chrome:// URLs in autocomplete suggestions (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: changes for pkasting@ Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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 }
OLDNEW
« no previous file with comments | « components/omnibox/browser/autocomplete_result_unittest.cc ('k') | components/omnibox/browser/physical_web_provider.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698