| OLD | NEW |
| 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/autocomplete_input.h" | 5 #include "chrome/browser/autocomplete/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 "chrome/browser/external_protocol/external_protocol_handler.h" | 9 #include "chrome/browser/external_protocol/external_protocol_handler.h" |
| 10 #include "chrome/browser/profiles/profile_io_data.h" | 10 #include "chrome/browser/profiles/profile_io_data.h" |
| (...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 146 if (!parts) | 146 if (!parts) |
| 147 parts = &local_parts; | 147 parts = &local_parts; |
| 148 const base::string16 parsed_scheme(URLFixerUpper::SegmentURL(text, parts)); | 148 const base::string16 parsed_scheme(URLFixerUpper::SegmentURL(text, parts)); |
| 149 if (scheme) | 149 if (scheme) |
| 150 *scheme = parsed_scheme; | 150 *scheme = parsed_scheme; |
| 151 if (canonicalized_url) { | 151 if (canonicalized_url) { |
| 152 *canonicalized_url = URLFixerUpper::FixupURL( | 152 *canonicalized_url = URLFixerUpper::FixupURL( |
| 153 base::UTF16ToUTF8(text), base::UTF16ToUTF8(desired_tld)); | 153 base::UTF16ToUTF8(text), base::UTF16ToUTF8(desired_tld)); |
| 154 } | 154 } |
| 155 | 155 |
| 156 if (LowerCaseEqualsASCII(parsed_scheme, chrome::kFileScheme)) { | 156 if (LowerCaseEqualsASCII(parsed_scheme, content::kFileScheme)) { |
| 157 // A user might or might not type a scheme when entering a file URL. In | 157 // A user might or might not type a scheme when entering a file URL. In |
| 158 // either case, |parsed_scheme| will tell us that this is a file URL, but | 158 // either case, |parsed_scheme| will tell us that this is a file URL, but |
| 159 // |parts->scheme| might be empty, e.g. if the user typed "C:\foo". | 159 // |parts->scheme| might be empty, e.g. if the user typed "C:\foo". |
| 160 return URL; | 160 return URL; |
| 161 } | 161 } |
| 162 | 162 |
| 163 if (LowerCaseEqualsASCII(parsed_scheme, content::kFileSystemScheme)) { | 163 if (LowerCaseEqualsASCII(parsed_scheme, content::kFileSystemScheme)) { |
| 164 // This could theoretically be a strange search, but let's check. | 164 // This could theoretically be a strange search, but let's check. |
| 165 // If it's got an inner_url with a scheme, it's a URL, whether it's valid or | 165 // If it's got an inner_url with a scheme, it's a URL, whether it's valid or |
| 166 // not. | 166 // not. |
| (...skipping 363 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 530 current_page_classification_ = AutocompleteInput::INVALID_SPEC; | 530 current_page_classification_ = AutocompleteInput::INVALID_SPEC; |
| 531 type_ = INVALID; | 531 type_ = INVALID; |
| 532 parts_ = url_parse::Parsed(); | 532 parts_ = url_parse::Parsed(); |
| 533 scheme_.clear(); | 533 scheme_.clear(); |
| 534 canonicalized_url_ = GURL(); | 534 canonicalized_url_ = GURL(); |
| 535 prevent_inline_autocomplete_ = false; | 535 prevent_inline_autocomplete_ = false; |
| 536 prefer_keyword_ = false; | 536 prefer_keyword_ = false; |
| 537 allow_exact_keyword_match_ = false; | 537 allow_exact_keyword_match_ = false; |
| 538 matches_requested_ = ALL_MATCHES; | 538 matches_requested_ = ALL_MATCHES; |
| 539 } | 539 } |
| OLD | NEW |