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 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
179 // (e.g. "ftp" or "view-source") but I'll wait to spend the effort on that | 179 // (e.g. "ftp" or "view-source") but I'll wait to spend the effort on that |
180 // until I run into some cases that really need it. | 180 // until I run into some cases that really need it. |
181 if (parts->scheme.is_nonempty() && | 181 if (parts->scheme.is_nonempty() && |
182 !LowerCaseEqualsASCII(parsed_scheme, content::kHttpScheme) && | 182 !LowerCaseEqualsASCII(parsed_scheme, content::kHttpScheme) && |
183 !LowerCaseEqualsASCII(parsed_scheme, content::kHttpsScheme)) { | 183 !LowerCaseEqualsASCII(parsed_scheme, content::kHttpsScheme)) { |
184 // See if we know how to handle the URL internally. There are some schemes | 184 // See if we know how to handle the URL internally. There are some schemes |
185 // that we convert to other things before they reach the renderer or else | 185 // that we convert to other things before they reach the renderer or else |
186 // the renderer handles internally without reaching the net::URLRequest | 186 // the renderer handles internally without reaching the net::URLRequest |
187 // logic. They thus won't be listed as "handled protocols", but we should | 187 // logic. They thus won't be listed as "handled protocols", but we should |
188 // still claim to handle them. | 188 // still claim to handle them. |
189 if (ProfileIOData::IsHandledProtocol(UTF16ToASCII(parsed_scheme)) || | 189 if (ProfileIOData::IsHandledProtocol(base::UTF16ToASCII(parsed_scheme)) || |
190 LowerCaseEqualsASCII(parsed_scheme, content::kViewSourceScheme) || | 190 LowerCaseEqualsASCII(parsed_scheme, content::kViewSourceScheme) || |
191 LowerCaseEqualsASCII(parsed_scheme, content::kJavaScriptScheme) || | 191 LowerCaseEqualsASCII(parsed_scheme, content::kJavaScriptScheme) || |
192 LowerCaseEqualsASCII(parsed_scheme, content::kDataScheme)) | 192 LowerCaseEqualsASCII(parsed_scheme, content::kDataScheme)) |
193 return return_value_for_non_http_url; | 193 return return_value_for_non_http_url; |
194 | 194 |
195 // Not an internal protocol. Check and see if the user has explicitly | 195 // Not an internal protocol. Check and see if the user has explicitly |
196 // opened this scheme as a URL before, or if the "scheme" is actually a | 196 // opened this scheme as a URL before, or if the "scheme" is actually a |
197 // username. We need to do this after the check above because some | 197 // username. We need to do this after the check above because some |
198 // handlable schemes (e.g. "javascript") may be treated as "blocked" by the | 198 // handlable schemes (e.g. "javascript") may be treated as "blocked" by the |
199 // external protocol handler because we don't want pages to open them, but | 199 // external protocol handler because we don't want pages to open them, but |
(...skipping 330 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 |