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 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 |
200 // users still can. | 200 // users still can. |
201 ExternalProtocolHandler::ScopedUserGesture user_gesture; | |
not at google - send to devlin
2014/03/28 18:54:23
why does autocomplete state imply a user gesture?
meacer
2014/03/28 19:53:11
It doesn't imply a user gesture. GetBlockState tak
not at google - send to devlin
2014/03/28 20:48:51
could you rename this variable like "skip_user_ges
meacer
2014/03/28 20:57:43
Done.
| |
201 ExternalProtocolHandler::BlockState block_state = | 202 ExternalProtocolHandler::BlockState block_state = |
202 ExternalProtocolHandler::GetBlockState( | 203 ExternalProtocolHandler::GetBlockState( |
203 base::UTF16ToUTF8(parsed_scheme)); | 204 base::UTF16ToUTF8(parsed_scheme)); |
204 switch (block_state) { | 205 switch (block_state) { |
205 case ExternalProtocolHandler::DONT_BLOCK: | 206 case ExternalProtocolHandler::DONT_BLOCK: |
206 return return_value_for_non_http_url; | 207 return return_value_for_non_http_url; |
207 | 208 |
208 case ExternalProtocolHandler::BLOCK: | 209 case ExternalProtocolHandler::BLOCK: |
209 // If we don't want the user to open the URL, don't let it be navigated | 210 // If we don't want the user to open the URL, don't let it be navigated |
210 // to at all. | 211 // to at all. |
(...skipping 319 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
530 current_page_classification_ = AutocompleteInput::INVALID_SPEC; | 531 current_page_classification_ = AutocompleteInput::INVALID_SPEC; |
531 type_ = INVALID; | 532 type_ = INVALID; |
532 parts_ = url_parse::Parsed(); | 533 parts_ = url_parse::Parsed(); |
533 scheme_.clear(); | 534 scheme_.clear(); |
534 canonicalized_url_ = GURL(); | 535 canonicalized_url_ = GURL(); |
535 prevent_inline_autocomplete_ = false; | 536 prevent_inline_autocomplete_ = false; |
536 prefer_keyword_ = false; | 537 prefer_keyword_ = false; |
537 allow_exact_keyword_match_ = false; | 538 allow_exact_keyword_match_ = false; |
538 matches_requested_ = ALL_MATCHES; | 539 matches_requested_ = ALL_MATCHES; |
539 } | 540 } |
OLD | NEW |