OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2010 Google Inc. All rights reserved. | 2 * Copyright (C) 2010 Google Inc. All rights reserved. |
3 * Copyright (C) 2011 Apple Inc. All rights reserved. | 3 * Copyright (C) 2011 Apple Inc. All rights reserved. |
4 * | 4 * |
5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
6 * modification, are permitted provided that the following conditions are | 6 * modification, are permitted provided that the following conditions are |
7 * met: | 7 * met: |
8 * | 8 * |
9 * * Redistributions of source code must retain the above copyright | 9 * * Redistributions of source code must retain the above copyright |
10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
69 ASSERT_NOT_REACHED(); | 69 ASSERT_NOT_REACHED(); |
70 return FormControlState(); | 70 return FormControlState(); |
71 } | 71 } |
72 | 72 |
73 void PasswordInputType::restoreFormControlState(const FormControlState&) | 73 void PasswordInputType::restoreFormControlState(const FormControlState&) |
74 { | 74 { |
75 // Should never save/restore password fields. | 75 // Should never save/restore password fields. |
76 ASSERT_NOT_REACHED(); | 76 ASSERT_NOT_REACHED(); |
77 } | 77 } |
78 | 78 |
79 bool PasswordInputType::shouldUseInputMethod() const | |
80 { | |
81 // Input methods are disabled for the password field because otherwise | |
82 // anyone can access the underlying password and display it in clear text. | |
83 return false; | |
84 } | |
85 | |
86 bool PasswordInputType::shouldRespectListAttribute() | 79 bool PasswordInputType::shouldRespectListAttribute() |
87 { | 80 { |
88 return false; | 81 return false; |
89 } | 82 } |
90 | 83 |
91 bool PasswordInputType::shouldRespectSpeechAttribute() | 84 bool PasswordInputType::shouldRespectSpeechAttribute() |
92 { | 85 { |
93 return true; | 86 return true; |
94 } | 87 } |
95 | 88 |
96 bool PasswordInputType::isPasswordField() const | 89 bool PasswordInputType::isPasswordField() const |
97 { | 90 { |
98 return true; | 91 return true; |
99 } | 92 } |
100 | 93 |
101 void PasswordInputType::enableSecureTextInput() | 94 void PasswordInputType::enableSecureTextInput() |
102 { | 95 { |
103 if (element().document().frame()) | 96 if (element().document().frame()) |
104 element().document().setUseSecureKeyboardEntryWhenActive(true); | 97 element().document().setUseSecureKeyboardEntryWhenActive(true); |
105 } | 98 } |
106 | 99 |
107 void PasswordInputType::disableSecureTextInput() | 100 void PasswordInputType::disableSecureTextInput() |
108 { | 101 { |
109 if (element().document().frame()) | 102 if (element().document().frame()) |
110 element().document().setUseSecureKeyboardEntryWhenActive(false); | 103 element().document().setUseSecureKeyboardEntryWhenActive(false); |
111 } | 104 } |
112 | 105 |
113 } // namespace blink | 106 } // namespace blink |
OLD | NEW |