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 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
176 !LowerCaseEqualsASCII(parsed_scheme, chrome::kHttpsScheme)) { | 176 !LowerCaseEqualsASCII(parsed_scheme, chrome::kHttpsScheme)) { |
177 // See if we know how to handle the URL internally. | 177 // See if we know how to handle the URL internally. |
178 if (ProfileIOData::IsHandledProtocol(UTF16ToASCII(parsed_scheme))) | 178 if (ProfileIOData::IsHandledProtocol(UTF16ToASCII(parsed_scheme))) |
179 return URL; | 179 return URL; |
180 | 180 |
181 // There are also some schemes that we convert to other things before they | 181 // There are also some schemes that we convert to other things before they |
182 // reach the renderer or else the renderer handles internally without | 182 // reach the renderer or else the renderer handles internally without |
183 // reaching the net::URLRequest logic. We thus won't catch these above, but | 183 // reaching the net::URLRequest logic. We thus won't catch these above, but |
184 // we should still claim to handle them. | 184 // we should still claim to handle them. |
185 if (LowerCaseEqualsASCII(parsed_scheme, content::kViewSourceScheme) || | 185 if (LowerCaseEqualsASCII(parsed_scheme, content::kViewSourceScheme) || |
186 LowerCaseEqualsASCII(parsed_scheme, chrome::kJavaScriptScheme) || | 186 LowerCaseEqualsASCII(parsed_scheme, content::kJavaScriptScheme) || |
187 LowerCaseEqualsASCII(parsed_scheme, chrome::kDataScheme)) | 187 LowerCaseEqualsASCII(parsed_scheme, chrome::kDataScheme)) |
188 return URL; | 188 return URL; |
189 | 189 |
190 // Finally, check and see if the user has explicitly opened this scheme as | 190 // Finally, check and see if the user has explicitly opened this scheme as |
191 // a URL before, or if the "scheme" is actually a username. We need to do | 191 // a URL before, or if the "scheme" is actually a username. We need to do |
192 // this last because some schemes (e.g. "javascript") may be treated as | 192 // this last because some schemes (e.g. "javascript") may be treated as |
193 // "blocked" by the external protocol handler because we don't want pages to | 193 // "blocked" by the external protocol handler because we don't want pages to |
194 // open them, but users still can. | 194 // open them, but users still can. |
195 // TODO(viettrungluu): get rid of conversion. | 195 // TODO(viettrungluu): get rid of conversion. |
196 ExternalProtocolHandler::BlockState block_state = | 196 ExternalProtocolHandler::BlockState block_state = |
(...skipping 317 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
514 current_page_classification_ = AutocompleteInput::INVALID_SPEC; | 514 current_page_classification_ = AutocompleteInput::INVALID_SPEC; |
515 type_ = INVALID; | 515 type_ = INVALID; |
516 parts_ = url_parse::Parsed(); | 516 parts_ = url_parse::Parsed(); |
517 scheme_.clear(); | 517 scheme_.clear(); |
518 canonicalized_url_ = GURL(); | 518 canonicalized_url_ = GURL(); |
519 prevent_inline_autocomplete_ = false; | 519 prevent_inline_autocomplete_ = false; |
520 prefer_keyword_ = false; | 520 prefer_keyword_ = false; |
521 allow_exact_keyword_match_ = false; | 521 allow_exact_keyword_match_ = false; |
522 matches_requested_ = ALL_MATCHES; | 522 matches_requested_ = ALL_MATCHES; |
523 } | 523 } |
OLD | NEW |