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

Unified Diff: ui/gfx/render_text_linux.cc

Issue 8747001: Reintroduce password support to NativeTextfieldViews (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: make password in RenderText an instance property and disable cut, copy, D&D, and word skipping Created 9 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 side-by-side diff with in-line comments
Download patch
Index: ui/gfx/render_text_linux.cc
diff --git a/ui/gfx/render_text_linux.cc b/ui/gfx/render_text_linux.cc
index e2f0d67b9294737cea244a7c11954c8515134553..3905b0f371e348e2fce0e0aeecb5c20785840b16 100644
--- a/ui/gfx/render_text_linux.cc
+++ b/ui/gfx/render_text_linux.cc
@@ -234,7 +234,7 @@ void RenderTextLinux::EnsureLayout() {
layout_ = pango_cairo_create_layout(cr);
SetupPangoLayout(
layout_,
- text(),
+ GetCensoredText(),
default_style().font,
display_rect().width(),
base::i18n::GetFirstStrongCharacterDirection(text()),
msw 2011/12/03 00:22:40 We should test this behavior with RTL passwords.
benrg 2011/12/08 21:40:55 What this is intended to do is display the whole *
@@ -468,7 +468,8 @@ SelectionModel RenderTextLinux::RightSelectionModel(
SelectionModel RenderTextLinux::LeftSelectionModelByWord(
const SelectionModel& selection) {
- base::i18n::BreakIterator iter(text(), base::i18n::BreakIterator::BREAK_WORD);
+ string16 txt = GetCensoredText();
+ base::i18n::BreakIterator iter(txt, base::i18n::BreakIterator::BREAK_WORD);
bool success = iter.Init();
DCHECK(success);
if (!success)
@@ -497,7 +498,8 @@ SelectionModel RenderTextLinux::LeftSelectionModelByWord(
SelectionModel RenderTextLinux::RightSelectionModelByWord(
const SelectionModel& selection) {
- base::i18n::BreakIterator iter(text(), base::i18n::BreakIterator::BREAK_WORD);
+ string16 txt = GetCensoredText();
+ base::i18n::BreakIterator iter(txt, base::i18n::BreakIterator::BREAK_WORD);
bool success = iter.Init();
DCHECK(success);
if (!success)

Powered by Google App Engine
This is Rietveld 408576698