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 789 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 800 | 800 |
| 801 // Insert the text | 801 // Insert the text |
| 802 TypingCommand::Options options = 0; | 802 TypingCommand::Options options = 0; |
| 803 if (selectInsertedText) | 803 if (selectInsertedText) |
| 804 options |= TypingCommand::SelectInsertedText; | 804 options |= TypingCommand::SelectInsertedText; |
| 805 TypingCommand::insertText(*document.get(), text, selection, options, triggeringEvent && triggeringEvent->isComposition() ? TypingCommand::TextCompos itionConfirm : TypingCommand::TextCompositionNone); | 805 TypingCommand::insertText(*document.get(), text, selection, options, triggeringEvent && triggeringEvent->isComposition() ? TypingCommand::TextCompos itionConfirm : TypingCommand::TextCompositionNone); |
| 806 | 806 |
| 807 // Reveal the current selection | 807 // Reveal the current selection |
| 808 if (LocalFrame* editedFrame = document->frame()) { | 808 if (LocalFrame* editedFrame = document->frame()) { |
| 809 if (Page* page = editedFrame->page()) | 809 if (Page* page = editedFrame->page()) |
| 810 page->focusController().focusedOrMainFrame()->selection().re vealSelection(ScrollAlignment::alignCenterIfNeeded); | 810 toLocalFrame(page->focusController().focusedOrMainFrame())-> selection().revealSelection(ScrollAlignment::alignCenterIfNeeded); |
|
dcheng
2014/03/17 18:17:44
Is this always guaranteed to be a local frame? Tha
kenrb
2014/03/18 20:01:19
I was thinking a selected frame would have to be l
dcheng
2014/03/19 20:50:03
Thinking about this more, I'm not 100% sure what t
kenrb
2014/03/20 15:56:57
Ok. If this is wrong, we should see ASSERTs after
| |
| 811 } | 811 } |
| 812 } | 812 } |
| 813 } | 813 } |
| 814 | 814 |
| 815 return true; | 815 return true; |
| 816 } | 816 } |
| 817 | 817 |
| 818 bool Editor::insertLineBreak() | 818 bool Editor::insertLineBreak() |
| 819 { | 819 { |
| 820 if (!canEdit()) | 820 if (!canEdit()) |
| (...skipping 410 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1231 return m_frame.spellChecker(); | 1231 return m_frame.spellChecker(); |
| 1232 } | 1232 } |
| 1233 | 1233 |
| 1234 void Editor::toggleOverwriteModeEnabled() | 1234 void Editor::toggleOverwriteModeEnabled() |
| 1235 { | 1235 { |
| 1236 m_overwriteModeEnabled = !m_overwriteModeEnabled; | 1236 m_overwriteModeEnabled = !m_overwriteModeEnabled; |
| 1237 frame().selection().setShouldShowBlockCursor(m_overwriteModeEnabled); | 1237 frame().selection().setShouldShowBlockCursor(m_overwriteModeEnabled); |
| 1238 } | 1238 } |
| 1239 | 1239 |
| 1240 } // namespace WebCore | 1240 } // namespace WebCore |
| OLD | NEW |