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 221 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
232 bool Editor::canCopy() const | 232 bool Editor::canCopy() const |
233 { | 233 { |
234 if (imageElementFromImageDocument(m_frame.document())) | 234 if (imageElementFromImageDocument(m_frame.document())) |
235 return true; | 235 return true; |
236 FrameSelection& selection = m_frame.selection(); | 236 FrameSelection& selection = m_frame.selection(); |
237 return selection.isRange() && !selection.isInPasswordField(); | 237 return selection.isRange() && !selection.isInPasswordField(); |
238 } | 238 } |
239 | 239 |
240 bool Editor::canPaste() const | 240 bool Editor::canPaste() const |
241 { | 241 { |
242 return canEdit(); | 242 if (!canEdit()) |
243 return false; | |
244 String text = Pasteboard::generalPasteboard()->plainText(); | |
jamesr
2014/07/24 18:27:15
this is going to do a synchronous IPC to the brows
| |
245 return !text.isEmpty(); | |
243 } | 246 } |
244 | 247 |
245 bool Editor::canDelete() const | 248 bool Editor::canDelete() const |
246 { | 249 { |
247 FrameSelection& selection = m_frame.selection(); | 250 FrameSelection& selection = m_frame.selection(); |
248 return selection.isRange() && selection.rootEditableElement(); | 251 return selection.isRange() && selection.rootEditableElement(); |
249 } | 252 } |
250 | 253 |
251 bool Editor::canDeleteRange(Range* range) const | 254 bool Editor::canDeleteRange(Range* range) const |
252 { | 255 { |
(...skipping 1025 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1278 frame().selection().setShouldShowBlockCursor(m_overwriteModeEnabled); | 1281 frame().selection().setShouldShowBlockCursor(m_overwriteModeEnabled); |
1279 } | 1282 } |
1280 | 1283 |
1281 void Editor::trace(Visitor* visitor) | 1284 void Editor::trace(Visitor* visitor) |
1282 { | 1285 { |
1283 visitor->trace(m_lastEditCommand); | 1286 visitor->trace(m_lastEditCommand); |
1284 visitor->trace(m_mark); | 1287 visitor->trace(m_mark); |
1285 } | 1288 } |
1286 | 1289 |
1287 } // namespace blink | 1290 } // namespace blink |
OLD | NEW |