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

Unified Diff: ui/views/controls/textfield/textfield.cc

Issue 2358463002: Views::Textfield: Prevent revealing password text. (Closed)
Patch Set: Address review comments. Created 4 years, 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/views/controls/textfield/textfield.h ('k') | ui/views/controls/textfield/textfield_model.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/controls/textfield/textfield.cc
diff --git a/ui/views/controls/textfield/textfield.cc b/ui/views/controls/textfield/textfield.cc
index 14736697771bda755ab2e7e08f2ad70cc1fee919..c2d9eb4e71b36ffb157ff4db4a17d36576adf312 100644
--- a/ui/views/controls/textfield/textfield.cc
+++ b/ui/views/controls/textfield/textfield.cc
@@ -1574,7 +1574,7 @@ void Textfield::ExecuteTextEditCommand(ui::TextEditCommand command) {
case ui::TextEditCommand::DELETE_TO_BEGINNING_OF_PARAGRAPH:
case ui::TextEditCommand::DELETE_TO_END_OF_LINE:
case ui::TextEditCommand::DELETE_TO_END_OF_PARAGRAPH:
- add_to_kill_buffer = true;
+ add_to_kill_buffer = text_input_type_ != ui::TEXT_INPUT_TYPE_PASSWORD;
// Fall through.
case ui::TextEditCommand::DELETE_WORD_BACKWARD:
case ui::TextEditCommand::DELETE_WORD_FORWARD:
@@ -2007,7 +2007,8 @@ void Textfield::CreateTouchSelectionControllerAndNotifyIt() {
void Textfield::UpdateSelectionClipboard() const {
#if defined(OS_LINUX) && !defined(OS_CHROMEOS)
- if (performing_user_action_ && HasSelection()) {
+ if (performing_user_action_ && HasSelection() &&
+ text_input_type_ != ui::TEXT_INPUT_TYPE_PASSWORD) {
ui::ScopedClipboardWriter(
ui::CLIPBOARD_TYPE_SELECTION).WriteText(GetSelectedText());
if (controller_)
« no previous file with comments | « ui/views/controls/textfield/textfield.h ('k') | ui/views/controls/textfield/textfield_model.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698