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

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

Issue 1171333003: Move net::FormatUrl and friends outside of //net and into //components (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Compile fixes following rebase 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/autocomplete_input.h" 5 #include "components/omnibox/autocomplete_input.h"
6 6
7 #include "base/strings/string_util.h" 7 #include "base/strings/string_util.h"
8 #include "base/strings/utf_string_conversions.h" 8 #include "base/strings/utf_string_conversions.h"
9 #include "components/metrics/proto/omnibox_event.pb.h" 9 #include "components/metrics/proto/omnibox_event.pb.h"
10 #include "components/omnibox/autocomplete_scheme_classifier.h" 10 #include "components/omnibox/autocomplete_scheme_classifier.h"
11 #include "components/url_fixer/url_fixer.h" 11 #include "components/url_fixer/url_fixer.h"
12 #include "components/url_formatter/url_formatter.h"
12 #include "net/base/net_util.h" 13 #include "net/base/net_util.h"
13 #include "net/base/registry_controlled_domains/registry_controlled_domain.h" 14 #include "net/base/registry_controlled_domains/registry_controlled_domain.h"
14 #include "url/url_canon_ip.h" 15 #include "url/url_canon_ip.h"
15 #include "url/url_util.h" 16 #include "url/url_util.h"
16 17
17 namespace { 18 namespace {
18 19
19 // Hardcode constant to avoid any dependencies on content/. 20 // Hardcode constant to avoid any dependencies on content/.
20 const char kViewSourceScheme[] = "view-source"; 21 const char kViewSourceScheme[] = "view-source";
21 22
(...skipping 439 matching lines...) Expand 10 before | Expand all | Expand 10 after
461 parts.inner_parsed() && parts.inner_parsed()->scheme.is_valid()) { 462 parts.inner_parsed() && parts.inner_parsed()->scheme.is_valid()) {
462 *host = parts.inner_parsed()->host; 463 *host = parts.inner_parsed()->host;
463 } 464 }
464 } 465 }
465 466
466 // static 467 // static
467 base::string16 AutocompleteInput::FormattedStringWithEquivalentMeaning( 468 base::string16 AutocompleteInput::FormattedStringWithEquivalentMeaning(
468 const GURL& url, 469 const GURL& url,
469 const base::string16& formatted_url, 470 const base::string16& formatted_url,
470 const AutocompleteSchemeClassifier& scheme_classifier) { 471 const AutocompleteSchemeClassifier& scheme_classifier) {
471 if (!net::CanStripTrailingSlash(url)) 472 if (!url_formatter::CanStripTrailingSlash(url))
472 return formatted_url; 473 return formatted_url;
473 const base::string16 url_with_path(formatted_url + base::char16('/')); 474 const base::string16 url_with_path(formatted_url + base::char16('/'));
474 return (AutocompleteInput::Parse(formatted_url, std::string(), 475 return (AutocompleteInput::Parse(formatted_url, std::string(),
475 scheme_classifier, NULL, NULL, NULL) == 476 scheme_classifier, NULL, NULL, NULL) ==
476 AutocompleteInput::Parse(url_with_path, std::string(), 477 AutocompleteInput::Parse(url_with_path, std::string(),
477 scheme_classifier, NULL, NULL, NULL)) ? 478 scheme_classifier, NULL, NULL, NULL)) ?
478 formatted_url : url_with_path; 479 formatted_url : url_with_path;
479 } 480 }
480 481
481 // static 482 // static
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
526 current_page_classification_ = metrics::OmniboxEventProto::INVALID_SPEC; 527 current_page_classification_ = metrics::OmniboxEventProto::INVALID_SPEC;
527 type_ = metrics::OmniboxInputType::INVALID; 528 type_ = metrics::OmniboxInputType::INVALID;
528 parts_ = url::Parsed(); 529 parts_ = url::Parsed();
529 scheme_.clear(); 530 scheme_.clear();
530 canonicalized_url_ = GURL(); 531 canonicalized_url_ = GURL();
531 prevent_inline_autocomplete_ = false; 532 prevent_inline_autocomplete_ = false;
532 prefer_keyword_ = false; 533 prefer_keyword_ = false;
533 allow_exact_keyword_match_ = false; 534 allow_exact_keyword_match_ = false;
534 want_asynchronous_matches_ = true; 535 want_asynchronous_matches_ = true;
535 } 536 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698