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

Side by Side Diff: third_party/WebKit/Source/core/editing/EditingUtilities.cpp

Issue 2740823003: [PasswordGeneration] Makes generated passwords copyable (Closed)
Patch Set: Created 3 years, 9 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2004, 2005, 2006, 2007 Apple Inc. All rights reserved. 2 * Copyright (C) 2004, 2005, 2006, 2007 Apple Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 2063 matching lines...) Expand 10 before | Expand all | Expand 10 after
2074 // instead of possibly at the end of the last node before the selection 2074 // instead of possibly at the end of the last node before the selection
2075 return mostForwardCaretPosition(visiblePosition.deepEquivalent()); 2075 return mostForwardCaretPosition(visiblePosition.deepEquivalent());
2076 } 2076 }
2077 2077
2078 bool isInPasswordField(const Position& position) { 2078 bool isInPasswordField(const Position& position) {
2079 TextControlElement* textControl = enclosingTextControl(position); 2079 TextControlElement* textControl = enclosingTextControl(position);
2080 return isHTMLInputElement(textControl) && 2080 return isHTMLInputElement(textControl) &&
2081 toHTMLInputElement(textControl)->type() == InputTypeNames::password; 2081 toHTMLInputElement(textControl)->type() == InputTypeNames::password;
2082 } 2082 }
2083 2083
2084 bool isInPasswordFieldWithUnrevealedPassword(const Position& position) {
yosin_UTC9 2017/03/10 03:48:52 Could you implement this function in Editor.cpp as
kolos1 2017/03/10 12:50:55 Done.
2085 TextControlElement* textControl = enclosingTextControl(position);
2086 if (!isHTMLInputElement(textControl))
2087 return false;
2088 HTMLInputElement* input = toHTMLInputElement(textControl);
2089 return (input->type() == InputTypeNames::password) &&
2090 !input->shouldRevealPassword();
2091 }
2092
2084 bool isTextSecurityNode(const Node* node) { 2093 bool isTextSecurityNode(const Node* node) {
2085 return node && node->layoutObject() && 2094 return node && node->layoutObject() &&
2086 node->layoutObject()->style()->textSecurity() != TSNONE; 2095 node->layoutObject()->style()->textSecurity() != TSNONE;
2087 } 2096 }
2088 2097
2089 const StaticRangeVector* targetRangesForInputEvent(const Node& node) { 2098 const StaticRangeVector* targetRangesForInputEvent(const Node& node) {
2090 if (!hasRichlyEditableStyle(node)) 2099 if (!hasRichlyEditableStyle(node))
2091 return nullptr; 2100 return nullptr;
2092 Range* range = createRange( 2101 Range* range = createRange(
2093 firstEphemeralRangeOf(node.document() 2102 firstEphemeralRangeOf(node.document()
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
2179 return InputType::DeleteWordBackward; 2188 return InputType::DeleteWordBackward;
2180 if (granularity == LineBoundary) 2189 if (granularity == LineBoundary)
2181 return InputType::DeleteLineBackward; 2190 return InputType::DeleteLineBackward;
2182 return InputType::DeleteContentBackward; 2191 return InputType::DeleteContentBackward;
2183 default: 2192 default:
2184 return InputType::None; 2193 return InputType::None;
2185 } 2194 }
2186 } 2195 }
2187 2196
2188 } // namespace blink 2197 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698