Chromium Code Reviews| 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 300 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 311 | 311 |
| 312 void AutofillAgent::FormControlElementClicked( | 312 void AutofillAgent::FormControlElementClicked( |
| 313 const WebFormControlElement& element, | 313 const WebFormControlElement& element, |
| 314 bool was_focused) { | 314 bool was_focused) { |
| 315 const WebInputElement* input_element = toWebInputElement(&element); | 315 const WebInputElement* input_element = toWebInputElement(&element); |
| 316 if (!input_element && !IsTextAreaElement(element)) | 316 if (!input_element && !IsTextAreaElement(element)) |
| 317 return; | 317 return; |
| 318 | 318 |
| 319 bool show_full_suggestion_list = element.isAutofilled() || was_focused; | 319 bool show_full_suggestion_list = element.isAutofilled() || was_focused; |
| 320 bool show_password_suggestions_only = !was_focused; | 320 bool show_password_suggestions_only = !was_focused; |
| 321 ShowSuggestions(element, | 321 |
| 322 true, | 322 // TODO(gcasto): Remove after crbug.com/423464 has been fixed. |
| 323 false, | 323 bool show_suggestions = true; |
| 324 true, | 324 #if defined(OS_ANDROID) |
| 325 false, | 325 show_suggestions = was_focused; |
| 326 show_full_suggestion_list, | 326 #endif |
| 327 show_password_suggestions_only); | 327 |
| 328 if (show_suggestions) | |
|
please use gerrit instead
2014/11/03 23:23:12
nit: please use curly braces for the body of the i
Garrett Casto
2014/11/03 23:59:02
Done.
| |
| 329 ShowSuggestions(element, | |
| 330 true, | |
| 331 false, | |
| 332 true, | |
| 333 false, | |
| 334 show_full_suggestion_list, | |
| 335 show_password_suggestions_only); | |
| 328 } | 336 } |
| 329 | 337 |
| 330 void AutofillAgent::textFieldDidEndEditing(const WebInputElement& element) { | 338 void AutofillAgent::textFieldDidEndEditing(const WebInputElement& element) { |
| 331 password_autofill_agent_->TextFieldDidEndEditing(element); | 339 password_autofill_agent_->TextFieldDidEndEditing(element); |
| 332 has_shown_autofill_popup_for_current_edit_ = false; | 340 has_shown_autofill_popup_for_current_edit_ = false; |
| 333 Send(new AutofillHostMsg_DidEndTextFieldEditing(routing_id())); | 341 Send(new AutofillHostMsg_DidEndTextFieldEditing(routing_id())); |
| 334 } | 342 } |
| 335 | 343 |
| 336 void AutofillAgent::textFieldDidChange(const WebFormControlElement& element) { | 344 void AutofillAgent::textFieldDidChange(const WebFormControlElement& element) { |
| 337 if (ignore_text_changes_) | 345 if (ignore_text_changes_) |
| (...skipping 399 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 737 ProcessForms(*frame); | 745 ProcessForms(*frame); |
| 738 password_autofill_agent_->OnDynamicFormsSeen(frame); | 746 password_autofill_agent_->OnDynamicFormsSeen(frame); |
| 739 if (password_generation_agent_) | 747 if (password_generation_agent_) |
| 740 password_generation_agent_->OnDynamicFormsSeen(frame); | 748 password_generation_agent_->OnDynamicFormsSeen(frame); |
| 741 return; | 749 return; |
| 742 } | 750 } |
| 743 } | 751 } |
| 744 } | 752 } |
| 745 | 753 |
| 746 } // namespace autofill | 754 } // namespace autofill |
| OLD | NEW |