Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(943)

Side by Side Diff: components/autofill/content/renderer/autofill_agent.cc

Issue 870833002: [android] Autofill popup behavior fixes. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Update expectations of old test and add a new test. Created 5 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 307 matching lines...) Expand 10 before | Expand all | Expand 10 after
318 switches::kDisableSingleClickAutofill); 318 switches::kDisableSingleClickAutofill);
319 #else 319 #else
320 bool single_click_autofill = 320 bool single_click_autofill =
321 base::CommandLine::ForCurrentProcess()->HasSwitch( 321 base::CommandLine::ForCurrentProcess()->HasSwitch(
322 switches::kEnableSingleClickAutofill); 322 switches::kEnableSingleClickAutofill);
323 #endif 323 #endif
324 324
325 if (!single_click_autofill) { 325 if (!single_click_autofill) {
326 // Show full suggestions when clicking on an already-focused form field. On 326 // Show full suggestions when clicking on an already-focused form field. On
327 // the initial click (not focused yet), only show password suggestions. 327 // the initial click (not focused yet), only show password suggestions.
328 #if defined(OS_ANDROID)
329 // TODO(gcasto): Remove after crbug.com/430318 has been fixed.
330 if (!was_focused)
331 return;
332 #endif
333
334 options.show_full_suggestion_list = 328 options.show_full_suggestion_list =
335 options.show_full_suggestion_list || was_focused; 329 options.show_full_suggestion_list || was_focused;
336 options.show_password_suggestions_only = !was_focused; 330 options.show_password_suggestions_only = !was_focused;
337 } 331 }
338 ShowSuggestions(element, options); 332 ShowSuggestions(element, options);
339 } 333 }
340 334
341 void AutofillAgent::textFieldDidEndEditing(const WebInputElement& element) { 335 void AutofillAgent::textFieldDidEndEditing(const WebInputElement& element) {
342 password_autofill_agent_->TextFieldDidEndEditing(element); 336 password_autofill_agent_->TextFieldDidEndEditing(element);
343 has_shown_autofill_popup_for_current_edit_ = false; 337 has_shown_autofill_popup_for_current_edit_ = false;
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
375 369
376 const WebInputElement* input_element = toWebInputElement(&element); 370 const WebInputElement* input_element = toWebInputElement(&element);
377 if (input_element) { 371 if (input_element) {
378 if (password_generation_agent_ && 372 if (password_generation_agent_ &&
379 password_generation_agent_->TextDidChangeInTextField(*input_element)) { 373 password_generation_agent_->TextDidChangeInTextField(*input_element)) {
380 is_popup_possibly_visible_ = true; 374 is_popup_possibly_visible_ = true;
381 return; 375 return;
382 } 376 }
383 377
384 if (password_autofill_agent_->TextDidChangeInTextField(*input_element)) { 378 if (password_autofill_agent_->TextDidChangeInTextField(*input_element)) {
379 is_popup_possibly_visible_ = true;
385 element_ = element; 380 element_ = element;
386 return; 381 return;
387 } 382 }
388 } 383 }
389 384
390 ShowSuggestionsOptions options; 385 ShowSuggestionsOptions options;
391 options.requires_caret_at_end = true; 386 options.requires_caret_at_end = true;
392 ShowSuggestions(element, options); 387 ShowSuggestions(element, options);
393 388
394 FormData form; 389 FormData form;
(...skipping 393 matching lines...) Expand 10 before | Expand all | Expand 10 after
788 783
789 void AutofillAgent::LegacyAutofillAgent::OnDestruct() { 784 void AutofillAgent::LegacyAutofillAgent::OnDestruct() {
790 // No-op. Don't delete |this|. 785 // No-op. Don't delete |this|.
791 } 786 }
792 787
793 void AutofillAgent::LegacyAutofillAgent::FocusChangeComplete() { 788 void AutofillAgent::LegacyAutofillAgent::FocusChangeComplete() {
794 agent_->FocusChangeComplete(); 789 agent_->FocusChangeComplete();
795 } 790 }
796 791
797 } // namespace autofill 792 } // namespace autofill
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698