OLD | NEW |
---|---|
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "components/autofill/content/renderer/autofill_agent.h" | 5 #include "components/autofill/content/renderer/autofill_agent.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "base/message_loop/message_loop.h" | 9 #include "base/message_loop/message_loop.h" |
10 #include "base/strings/string_split.h" | 10 #include "base/strings/string_split.h" |
(...skipping 291 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
302 | 302 |
303 const WebInputElement* input_element = toWebInputElement(&element); | 303 const WebInputElement* input_element = toWebInputElement(&element); |
304 if (!input_element && !IsTextAreaElement(element)) | 304 if (!input_element && !IsTextAreaElement(element)) |
305 return; | 305 return; |
306 | 306 |
307 ShowSuggestionsOptions options; | 307 ShowSuggestionsOptions options; |
308 options.autofill_on_empty_values = true; | 308 options.autofill_on_empty_values = true; |
309 options.display_warning_if_disabled = true; | 309 options.display_warning_if_disabled = true; |
310 options.show_full_suggestion_list = element.isAutofilled(); | 310 options.show_full_suggestion_list = element.isAutofilled(); |
311 | 311 |
312 if (!base::CommandLine::ForCurrentProcess()->HasSwitch( | 312 #if defined(OS_ANDROID) |
brettw
2015/01/22 01:43:48
Can you add a quick comment about why the default
Evan Stade
2015/01/22 23:09:46
added link to bug and description in bug
| |
313 switches::kEnableSingleClickAutofill)) { | 313 bool single_click_autofill = |
314 !base::CommandLine::ForCurrentProcess()->HasSwitch( | |
315 switches::kDisableSingleClickAutofill); | |
316 #else | |
317 bool single_click_autofill = | |
318 base::CommandLine::ForCurrentProcess()->HasSwitch( | |
319 switches::kEnableSingleClickAutofill); | |
320 #endif | |
321 | |
322 if (!single_click_autofill) { | |
314 // Show full suggestions when clicking on an already-focused form field. On | 323 // Show full suggestions when clicking on an already-focused form field. On |
315 // the initial click (not focused yet), only show password suggestions. | 324 // the initial click (not focused yet), only show password suggestions. |
316 #if defined(OS_ANDROID) | 325 #if defined(OS_ANDROID) |
317 // TODO(gcasto): Remove after crbug.com/430318 has been fixed. | 326 // TODO(gcasto): Remove after crbug.com/430318 has been fixed. |
318 if (!was_focused) | 327 if (!was_focused) |
319 return; | 328 return; |
320 #endif | 329 #endif |
321 | 330 |
322 options.show_full_suggestion_list = | 331 options.show_full_suggestion_list = |
323 options.show_full_suggestion_list || was_focused; | 332 options.show_full_suggestion_list || was_focused; |
(...skipping 453 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
777 void AutofillAgent::LegacyAutofillAgent::OnDestruct() { | 786 void AutofillAgent::LegacyAutofillAgent::OnDestruct() { |
778 // No-op. Don't delete |this|. | 787 // No-op. Don't delete |this|. |
779 } | 788 } |
780 | 789 |
781 void AutofillAgent::LegacyAutofillAgent::FocusedNodeChanged( | 790 void AutofillAgent::LegacyAutofillAgent::FocusedNodeChanged( |
782 const WebNode& node) { | 791 const WebNode& node) { |
783 agent_->FocusedNodeChanged(node); | 792 agent_->FocusedNodeChanged(node); |
784 } | 793 } |
785 | 794 |
786 } // namespace autofill | 795 } // namespace autofill |
OLD | NEW |