| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "ui/gfx/render_text.h" | 5 #include "ui/gfx/render_text.h" |
| 6 | 6 |
| 7 #include <limits.h> | 7 #include <limits.h> |
| 8 | 8 |
| 9 #include <algorithm> | 9 #include <algorithm> |
| 10 #include <climits> | 10 #include <climits> |
| (...skipping 30 matching lines...) Expand all Loading... |
| 41 #include "ui/gfx/render_text_mac.h" | 41 #include "ui/gfx/render_text_mac.h" |
| 42 #endif // defined(OS_MACOSX) | 42 #endif // defined(OS_MACOSX) |
| 43 | 43 |
| 44 namespace gfx { | 44 namespace gfx { |
| 45 | 45 |
| 46 namespace { | 46 namespace { |
| 47 | 47 |
| 48 // All chars are replaced by this char when the password style is set. | 48 // All chars are replaced by this char when the password style is set. |
| 49 // TODO(benrg): GTK uses the first of U+25CF, U+2022, U+2731, U+273A, '*' | 49 // TODO(benrg): GTK uses the first of U+25CF, U+2022, U+2731, U+273A, '*' |
| 50 // that's available in the font (find_invisible_char() in gtkentry.c). | 50 // that's available in the font (find_invisible_char() in gtkentry.c). |
| 51 // Use a bullet character on Mac. |
| 52 #if defined(OS_MACOSX) |
| 53 const base::char16 kPasswordReplacementChar = 0x2022; |
| 54 #else |
| 51 const base::char16 kPasswordReplacementChar = '*'; | 55 const base::char16 kPasswordReplacementChar = '*'; |
| 56 #endif |
| 52 | 57 |
| 53 // Default color used for the text and cursor. | 58 // Default color used for the text and cursor. |
| 54 const SkColor kDefaultColor = SK_ColorBLACK; | 59 const SkColor kDefaultColor = SK_ColorBLACK; |
| 55 | 60 |
| 56 // Default color used for drawing selection background. | 61 // Default color used for drawing selection background. |
| 57 const SkColor kDefaultSelectionBackgroundColor = SK_ColorGRAY; | 62 const SkColor kDefaultSelectionBackgroundColor = SK_ColorGRAY; |
| 58 | 63 |
| 59 // Fraction of the text size to lower a strike through below the baseline. | 64 // Fraction of the text size to lower a strike through below the baseline. |
| 60 const SkScalar kStrikeThroughOffset = (-SK_Scalar1 * 6 / 21); | 65 const SkScalar kStrikeThroughOffset = (-SK_Scalar1 * 6 / 21); |
| 61 // Fraction of the text size to lower an underline below the baseline. | 66 // Fraction of the text size to lower an underline below the baseline. |
| (...skipping 1622 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1684 | 1689 |
| 1685 for (; range_max < length; ++range_max) | 1690 for (; range_max < length; ++range_max) |
| 1686 if (iter.IsEndOfWord(range_max) || iter.IsStartOfWord(range_max)) | 1691 if (iter.IsEndOfWord(range_max) || iter.IsStartOfWord(range_max)) |
| 1687 break; | 1692 break; |
| 1688 | 1693 |
| 1689 return range.is_reversed() ? Range(range_max, range_min) | 1694 return range.is_reversed() ? Range(range_max, range_min) |
| 1690 : Range(range_min, range_max); | 1695 : Range(range_min, range_max); |
| 1691 } | 1696 } |
| 1692 | 1697 |
| 1693 } // namespace gfx | 1698 } // namespace gfx |
| OLD | NEW |