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

Unified Diff: ui/gfx/render_text.cc

Issue 2439693002: MacViews: Use bullets for displaying obscured text. (Closed)
Patch Set: Make kPasswordReplacementChar constexpr. Created 4 years, 2 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/gfx/render_text.h ('k') | ui/gfx/render_text_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gfx/render_text.cc
diff --git a/ui/gfx/render_text.cc b/ui/gfx/render_text.cc
index 7ccaaa6131a5ece76f65603b9c3cc7f5450b4248..14c646bd5a75a69beaf9cae9a3a9b0e2db99d154 100644
--- a/ui/gfx/render_text.cc
+++ b/ui/gfx/render_text.cc
@@ -45,11 +45,6 @@ namespace gfx {
namespace {
-// All chars are replaced by this char when the password style is set.
-// TODO(benrg): GTK uses the first of U+25CF, U+2022, U+2731, U+273A, '*'
-// that's available in the font (find_invisible_char() in gtkentry.c).
-const base::char16 kPasswordReplacementChar = '*';
-
// Default color used for the text and cursor.
const SkColor kDefaultColor = SK_ColorBLACK;
@@ -426,6 +421,9 @@ void ApplyRenderParams(const FontRenderParams& params,
} // namespace internal
+// static
+constexpr base::char16 RenderText::kPasswordReplacementChar;
sky 2016/10/25 16:40:16 Are you sure this is still needed?
tapted 2016/10/25 23:09:39 drive-by: It's needed if the address is ever taken
karandeepb 2016/10/26 00:02:44 Yeah the standard calls these usages "odr-used".
+
RenderText::~RenderText() {
}
@@ -1406,7 +1404,8 @@ void RenderText::OnTextAttributeChanged() {
if (obscured_) {
size_t obscured_text_length =
static_cast<size_t>(UTF16IndexToOffset(text_, 0, text_.length()));
- layout_text_.assign(obscured_text_length, kPasswordReplacementChar);
+ layout_text_.assign(obscured_text_length,
+ RenderText::kPasswordReplacementChar);
if (obscured_reveal_index_ >= 0 &&
obscured_reveal_index_ < static_cast<int>(text_.length())) {
« no previous file with comments | « ui/gfx/render_text.h ('k') | ui/gfx/render_text_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698