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

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

Issue 1488093002: autofill: save pasted passwords on Mac (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: don't always quit the runloop on text changes Created 5 years 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 <tuple> 7 #include <tuple>
8 8
9 #include "base/auto_reset.h" 9 #include "base/auto_reset.h"
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 368 matching lines...) Expand 10 before | Expand all | Expand 10 after
379 } 379 }
380 380
381 void AutofillAgent::textFieldDidEndEditing(const WebInputElement& element) { 381 void AutofillAgent::textFieldDidEndEditing(const WebInputElement& element) {
382 password_autofill_agent_->TextFieldDidEndEditing(element); 382 password_autofill_agent_->TextFieldDidEndEditing(element);
383 has_shown_autofill_popup_for_current_edit_ = false; 383 has_shown_autofill_popup_for_current_edit_ = false;
384 Send(new AutofillHostMsg_DidEndTextFieldEditing(routing_id())); 384 Send(new AutofillHostMsg_DidEndTextFieldEditing(routing_id()));
385 } 385 }
386 386
387 void AutofillAgent::textFieldDidChange(const WebFormControlElement& element) { 387 void AutofillAgent::textFieldDidChange(const WebFormControlElement& element) {
388 DCHECK(toWebInputElement(&element) || form_util::IsTextAreaElement(element)); 388 DCHECK(toWebInputElement(&element) || form_util::IsTextAreaElement(element));
389
389 if (ignore_text_changes_) 390 if (ignore_text_changes_)
390 return; 391 return;
391 392
392 if (!IsUserGesture()) 393 // Disregard text changes that aren't caused by user gestures or pastes. Note
394 // that pastes aren't necessarily user gestures because Blink's conception of
395 // user gestures is centered around creating new windows/tabs.
396 if (!IsUserGesture() && !render_frame()->IsPasting())
393 return; 397 return;
394 398
395 // We post a task for doing the Autofill as the caret position is not set 399 // We post a task for doing the Autofill as the caret position is not set
396 // properly at this point (http://bugs.webkit.org/show_bug.cgi?id=16976) and 400 // properly at this point (http://bugs.webkit.org/show_bug.cgi?id=16976) and
397 // it is needed to trigger autofill. 401 // it is needed to trigger autofill.
398 weak_ptr_factory_.InvalidateWeakPtrs(); 402 weak_ptr_factory_.InvalidateWeakPtrs();
399 base::ThreadTaskRunnerHandle::Get()->PostTask( 403 base::ThreadTaskRunnerHandle::Get()->PostTask(
400 FROM_HERE, base::Bind(&AutofillAgent::TextFieldDidChangeImpl, 404 FROM_HERE, base::Bind(&AutofillAgent::TextFieldDidChangeImpl,
401 weak_ptr_factory_.GetWeakPtr(), element)); 405 weak_ptr_factory_.GetWeakPtr(), element));
402 } 406 }
(...skipping 412 matching lines...) Expand 10 before | Expand all | Expand 10 after
815 819
816 void AutofillAgent::LegacyAutofillAgent::OnDestruct() { 820 void AutofillAgent::LegacyAutofillAgent::OnDestruct() {
817 // No-op. Don't delete |this|. 821 // No-op. Don't delete |this|.
818 } 822 }
819 823
820 void AutofillAgent::LegacyAutofillAgent::FocusChangeComplete() { 824 void AutofillAgent::LegacyAutofillAgent::FocusChangeComplete() {
821 agent_->FocusChangeComplete(); 825 agent_->FocusChangeComplete();
822 } 826 }
823 827
824 } // namespace autofill 828 } // namespace autofill
OLDNEW
« no previous file with comments | « chrome/browser/autofill/autofill_interactive_uitest.cc ('k') | components/autofill/core/browser/autofill_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698