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

Side by Side Diff: chrome/browser/autocomplete/history_url_provider.cc

Issue 23658056: content: Move kHttpScheme constant into content namespace. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 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 "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/bind.h" 10 #include "base/bind.h"
(...skipping 777 matching lines...) Expand 10 before | Expand all | Expand 10 after
788 } 788 }
789 789
790 bool HistoryURLProvider::CanFindIntranetURL( 790 bool HistoryURLProvider::CanFindIntranetURL(
791 history::URLDatabase* db, 791 history::URLDatabase* db,
792 const AutocompleteInput& input) const { 792 const AutocompleteInput& input) const {
793 // Normally passing the first two conditions below ought to guarantee the 793 // Normally passing the first two conditions below ought to guarantee the
794 // third condition, but because FixupUserInput() can run and modify the 794 // third condition, but because FixupUserInput() can run and modify the
795 // input's text and parts between Parse() and here, it seems better to be 795 // input's text and parts between Parse() and here, it seems better to be
796 // paranoid and check. 796 // paranoid and check.
797 if ((input.type() != AutocompleteInput::UNKNOWN) || 797 if ((input.type() != AutocompleteInput::UNKNOWN) ||
798 !LowerCaseEqualsASCII(input.scheme(), chrome::kHttpScheme) || 798 !LowerCaseEqualsASCII(input.scheme(), content::kHttpScheme) ||
799 !input.parts().host.is_nonempty()) 799 !input.parts().host.is_nonempty())
800 return false; 800 return false;
801 const std::string host(UTF16ToUTF8( 801 const std::string host(UTF16ToUTF8(
802 input.text().substr(input.parts().host.begin, input.parts().host.len))); 802 input.text().substr(input.parts().host.begin, input.parts().host.len)));
803 const size_t registry_length = 803 const size_t registry_length =
804 net::registry_controlled_domains::GetRegistryLength( 804 net::registry_controlled_domains::GetRegistryLength(
805 host, 805 host,
806 net::registry_controlled_domains::EXCLUDE_UNKNOWN_REGISTRIES, 806 net::registry_controlled_domains::EXCLUDE_UNKNOWN_REGISTRIES,
807 net::registry_controlled_domains::EXCLUDE_PRIVATE_REGISTRIES); 807 net::registry_controlled_domains::EXCLUDE_PRIVATE_REGISTRIES);
808 return registry_length == 0 && db->IsTypedHost(host); 808 return registry_length == 0 && db->IsTypedHost(host);
(...skipping 279 matching lines...) Expand 10 before | Expand all | Expand 10 after
1088 &match.contents_class); 1088 &match.contents_class);
1089 } 1089 }
1090 match.description = info.title(); 1090 match.description = info.title();
1091 AutocompleteMatch::ClassifyMatchInString(params->input.text(), 1091 AutocompleteMatch::ClassifyMatchInString(params->input.text(),
1092 info.title(), 1092 info.title(),
1093 ACMatchClassification::NONE, 1093 ACMatchClassification::NONE,
1094 &match.description_class); 1094 &match.description_class);
1095 RecordAdditionalInfoFromUrlRow(info, &match); 1095 RecordAdditionalInfoFromUrlRow(info, &match);
1096 return match; 1096 return match;
1097 } 1097 }
OLDNEW
« no previous file with comments | « chrome/browser/autocomplete/history_provider.cc ('k') | chrome/browser/autocomplete/search_provider.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698