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 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
191 return URL; | 191 return URL; |
192 | 192 |
193 // Finally, check and see if the user has explicitly opened this scheme as | 193 // Finally, check and see if the user has explicitly opened this scheme as |
194 // a URL before, or if the "scheme" is actually a username. We need to do | 194 // a URL before, or if the "scheme" is actually a username. We need to do |
195 // this last because some schemes (e.g. "javascript") may be treated as | 195 // this last because some schemes (e.g. "javascript") may be treated as |
196 // "blocked" by the external protocol handler because we don't want pages to | 196 // "blocked" by the external protocol handler because we don't want pages to |
197 // open them, but users still can. | 197 // open them, but users still can. |
198 // TODO(viettrungluu): get rid of conversion. | 198 // TODO(viettrungluu): get rid of conversion. |
199 ExternalProtocolHandler::BlockState block_state = | 199 ExternalProtocolHandler::BlockState block_state = |
200 ExternalProtocolHandler::GetBlockState( | 200 ExternalProtocolHandler::GetBlockState( |
201 base::UTF16ToUTF8(parsed_scheme)); | 201 base::UTF16ToUTF8(parsed_scheme), true); |
202 switch (block_state) { | 202 switch (block_state) { |
203 case ExternalProtocolHandler::DONT_BLOCK: | 203 case ExternalProtocolHandler::DONT_BLOCK: |
204 return URL; | 204 return URL; |
205 | 205 |
206 case ExternalProtocolHandler::BLOCK: | 206 case ExternalProtocolHandler::BLOCK: |
207 // If we don't want the user to open the URL, don't let it be navigated | 207 // If we don't want the user to open the URL, don't let it be navigated |
208 // to at all. | 208 // to at all. |
209 return QUERY; | 209 return QUERY; |
210 | 210 |
211 default: { | 211 default: { |
(...skipping 318 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 |