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

Side by Side Diff: components/omnibox/search_provider.cc

Issue 1098843004: Omnibox - Do Not Allow HTTP/HTTPS Equivalence if User Explicitly Entered A Scheme (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: use StartsWithASCII Created 5 years, 6 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 2012 The Chromium Authors. All rights reserved. 1 // Copyright 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/search_provider.h" 5 #include "components/omnibox/search_provider.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <cmath> 8 #include <cmath>
9 9
10 #include "base/base64.h" 10 #include "base/base64.h"
(...skipping 1417 matching lines...) Expand 10 before | Expand all | Expand 10 after
1428 // Finally, if we have an inlineable navsuggestion with an inline completion 1428 // Finally, if we have an inlineable navsuggestion with an inline completion
1429 // that we're not preventing, make sure we didn't trim any whitespace. 1429 // that we're not preventing, make sure we didn't trim any whitespace.
1430 // We don't want to claim http://foo.com/bar is inlineable against the 1430 // We don't want to claim http://foo.com/bar is inlineable against the
1431 // input "foo.com/b ". 1431 // input "foo.com/b ".
1432 match.allowed_to_be_default_match = 1432 match.allowed_to_be_default_match =
1433 (prefix != NULL) && 1433 (prefix != NULL) &&
1434 (providers_.GetKeywordProviderURL() == NULL) && 1434 (providers_.GetKeywordProviderURL() == NULL) &&
1435 !navigation.received_after_last_keystroke() && 1435 !navigation.received_after_last_keystroke() &&
1436 (match.inline_autocompletion.empty() || 1436 (match.inline_autocompletion.empty() ||
1437 (!input_.prevent_inline_autocomplete() && !trimmed_whitespace)); 1437 (!input_.prevent_inline_autocomplete() && !trimmed_whitespace));
1438 match.EnsureUWYTIsAllowedToBeDefault( 1438 match.EnsureUWYTIsAllowedToBeDefault(input_,
1439 input_.canonicalized_url(), providers_.template_url_service()); 1439 providers_.template_url_service());
1440 1440
1441 match.contents = navigation.match_contents(); 1441 match.contents = navigation.match_contents();
1442 match.contents_class = navigation.match_contents_class(); 1442 match.contents_class = navigation.match_contents_class();
1443 match.description = navigation.description(); 1443 match.description = navigation.description();
1444 AutocompleteMatch::ClassifyMatchInString(input, match.description, 1444 AutocompleteMatch::ClassifyMatchInString(input, match.description,
1445 ACMatchClassification::NONE, &match.description_class); 1445 ACMatchClassification::NONE, &match.description_class);
1446 1446
1447 match.RecordAdditionalInfo( 1447 match.RecordAdditionalInfo(
1448 kRelevanceFromServerKey, 1448 kRelevanceFromServerKey,
1449 navigation.relevance_from_server() ? kTrue : kFalse); 1449 navigation.relevance_from_server() ? kTrue : kFalse);
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
1511 for (MatchMap::const_iterator i(map.begin()); i != map.end(); ++i) 1511 for (MatchMap::const_iterator i(map.begin()); i != map.end(); ++i)
1512 matches.push_back(i->second); 1512 matches.push_back(i->second);
1513 std::sort(matches.begin(), matches.end(), &AutocompleteMatch::MoreRelevant); 1513 std::sort(matches.begin(), matches.end(), &AutocompleteMatch::MoreRelevant);
1514 1514
1515 // If there is a top scoring entry, find the corresponding answer. 1515 // If there is a top scoring entry, find the corresponding answer.
1516 if (!matches.empty()) 1516 if (!matches.empty())
1517 return answers_cache_.GetTopAnswerEntry(matches[0].contents); 1517 return answers_cache_.GetTopAnswerEntry(matches[0].contents);
1518 1518
1519 return AnswersQueryData(); 1519 return AnswersQueryData();
1520 } 1520 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698