Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 /* | 1 /* |
| 2 * Copyright (C) 2006, 2007, 2008, 2011 Apple Inc. All rights reserved. | 2 * Copyright (C) 2006, 2007, 2008, 2011 Apple Inc. All rights reserved. |
| 3 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies) | 3 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies) |
| 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 | 6 * modification, are permitted provided that the following conditions |
| 7 * are met: | 7 * are met: |
| 8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
| (...skipping 307 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 318 if (!isHTMLImageElement(node)) | 318 if (!isHTMLImageElement(node)) |
| 319 return 0; | 319 return 0; |
| 320 return toHTMLImageElement(node); | 320 return toHTMLImageElement(node); |
| 321 } | 321 } |
| 322 | 322 |
| 323 bool Editor::canCopy() const { | 323 bool Editor::canCopy() const { |
| 324 if (imageElementFromImageDocument(frame().document())) | 324 if (imageElementFromImageDocument(frame().document())) |
| 325 return true; | 325 return true; |
| 326 FrameSelection& selection = frame().selection(); | 326 FrameSelection& selection = frame().selection(); |
| 327 return selection.computeVisibleSelectionInDOMTreeDeprecated().isRange() && | 327 return selection.computeVisibleSelectionInDOMTreeDeprecated().isRange() && |
| 328 !isInPasswordField( | 328 !isInPasswordFieldWithUnrevealedPassword( |
|
yosin_UTC9
2017/03/10 03:48:52
Could you add test in "EditorTest.cpp" for Editor:
kolos1
2017/03/10 12:50:55
Done.
| |
| 329 frame().selection().computeVisibleSelectionInDOMTree().start()); | 329 frame().selection().computeVisibleSelectionInDOMTree().start()); |
| 330 } | 330 } |
| 331 | 331 |
| 332 bool Editor::canPaste() const { | 332 bool Editor::canPaste() const { |
| 333 return canEdit(); | 333 return canEdit(); |
| 334 } | 334 } |
| 335 | 335 |
| 336 bool Editor::canDelete() const { | 336 bool Editor::canDelete() const { |
| 337 FrameSelection& selection = frame().selection(); | 337 FrameSelection& selection = frame().selection(); |
| 338 return selection.computeVisibleSelectionInDOMTreeDeprecated().isRange() && | 338 return selection.computeVisibleSelectionInDOMTreeDeprecated().isRange() && |
| (...skipping 1437 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1776 | 1776 |
| 1777 DEFINE_TRACE(Editor) { | 1777 DEFINE_TRACE(Editor) { |
| 1778 visitor->trace(m_frame); | 1778 visitor->trace(m_frame); |
| 1779 visitor->trace(m_lastEditCommand); | 1779 visitor->trace(m_lastEditCommand); |
| 1780 visitor->trace(m_undoStack); | 1780 visitor->trace(m_undoStack); |
| 1781 visitor->trace(m_mark); | 1781 visitor->trace(m_mark); |
| 1782 visitor->trace(m_typingStyle); | 1782 visitor->trace(m_typingStyle); |
| 1783 } | 1783 } |
| 1784 | 1784 |
| 1785 } // namespace blink | 1785 } // namespace blink |
| OLD | NEW |