OLD | NEW |
1 /* | 1 /* |
2 * (C) 1999 Lars Knoll (knoll@kde.org) | 2 * (C) 1999 Lars Knoll (knoll@kde.org) |
3 * (C) 2000 Dirk Mueller (mueller@kde.org) | 3 * (C) 2000 Dirk Mueller (mueller@kde.org) |
4 * Copyright (C) 2004, 2005, 2006, 2007 Apple Inc. All rights reserved. | 4 * Copyright (C) 2004, 2005, 2006, 2007 Apple Inc. All rights reserved. |
5 * Copyright (C) 2006 Andrew Wellington (proton@wiretapped.net) | 5 * Copyright (C) 2006 Andrew Wellington (proton@wiretapped.net) |
6 * Copyright (C) 2006 Graham Dennis (graham.dennis@gmail.com) | 6 * Copyright (C) 2006 Graham Dennis (graham.dennis@gmail.com) |
7 * | 7 * |
8 * This library is free software; you can redistribute it and/or | 8 * This library is free software; you can redistribute it and/or |
9 * modify it under the terms of the GNU Library General Public | 9 * modify it under the terms of the GNU Library General Public |
10 * License as published by the Free Software Foundation; either | 10 * License as published by the Free Software Foundation; either |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
59 String text; | 59 String text; |
60 void* pointers[2]; | 60 void* pointers[2]; |
61 }; | 61 }; |
62 | 62 |
63 COMPILE_ASSERT(sizeof(RenderText) == sizeof(SameSizeAsRenderText), RenderText_sh
ould_stay_small); | 63 COMPILE_ASSERT(sizeof(RenderText) == sizeof(SameSizeAsRenderText), RenderText_sh
ould_stay_small); |
64 | 64 |
65 class SecureTextTimer; | 65 class SecureTextTimer; |
66 typedef HashMap<RenderText*, SecureTextTimer*> SecureTextTimerMap; | 66 typedef HashMap<RenderText*, SecureTextTimer*> SecureTextTimerMap; |
67 static SecureTextTimerMap* gSecureTextTimers = 0; | 67 static SecureTextTimerMap* gSecureTextTimers = 0; |
68 | 68 |
69 class SecureTextTimer : public TimerBase { | 69 class SecureTextTimer FINAL : public TimerBase { |
70 public: | 70 public: |
71 SecureTextTimer(RenderText* renderText) | 71 SecureTextTimer(RenderText* renderText) |
72 : m_renderText(renderText) | 72 : m_renderText(renderText) |
73 , m_lastTypedCharacterOffset(-1) | 73 , m_lastTypedCharacterOffset(-1) |
74 { | 74 { |
75 } | 75 } |
76 | 76 |
77 void restartWithNewText(unsigned lastTypedCharacterOffset) | 77 void restartWithNewText(unsigned lastTypedCharacterOffset) |
78 { | 78 { |
79 m_lastTypedCharacterOffset = lastTypedCharacterOffset; | 79 m_lastTypedCharacterOffset = lastTypedCharacterOffset; |
80 if (Settings* settings = m_renderText->document().settings()) | 80 if (Settings* settings = m_renderText->document().settings()) |
81 startOneShot(settings->passwordEchoDurationInSeconds()); | 81 startOneShot(settings->passwordEchoDurationInSeconds()); |
82 } | 82 } |
83 void invalidate() { m_lastTypedCharacterOffset = -1; } | 83 void invalidate() { m_lastTypedCharacterOffset = -1; } |
84 unsigned lastTypedCharacterOffset() { return m_lastTypedCharacterOffset; } | 84 unsigned lastTypedCharacterOffset() { return m_lastTypedCharacterOffset; } |
85 | 85 |
86 private: | 86 private: |
87 virtual void fired() | 87 virtual void fired() OVERRIDE |
88 { | 88 { |
89 ASSERT(gSecureTextTimers->contains(m_renderText)); | 89 ASSERT(gSecureTextTimers->contains(m_renderText)); |
90 m_renderText->setText(m_renderText->text().impl(), true /* forcing setti
ng text as it may be masked later */); | 90 m_renderText->setText(m_renderText->text().impl(), true /* forcing setti
ng text as it may be masked later */); |
91 } | 91 } |
92 | 92 |
93 RenderText* m_renderText; | 93 RenderText* m_renderText; |
94 int m_lastTypedCharacterOffset; | 94 int m_lastTypedCharacterOffset; |
95 }; | 95 }; |
96 | 96 |
97 static void makeCapitalized(String* string, UChar previous) | 97 static void makeCapitalized(String* string, UChar previous) |
(...skipping 1763 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1861 } | 1861 } |
1862 secureTextTimer->restartWithNewText(lastTypedCharacterOffset); | 1862 secureTextTimer->restartWithNewText(lastTypedCharacterOffset); |
1863 } | 1863 } |
1864 | 1864 |
1865 PassRefPtr<AbstractInlineTextBox> RenderText::firstAbstractInlineTextBox() | 1865 PassRefPtr<AbstractInlineTextBox> RenderText::firstAbstractInlineTextBox() |
1866 { | 1866 { |
1867 return AbstractInlineTextBox::getOrCreate(this, m_firstTextBox); | 1867 return AbstractInlineTextBox::getOrCreate(this, m_firstTextBox); |
1868 } | 1868 } |
1869 | 1869 |
1870 } // namespace WebCore | 1870 } // namespace WebCore |
OLD | NEW |