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

Side by Side Diff: Source/core/editing/Editor.cpp

Issue 189573002: Convert HTMLFrameOwnerElement and FocusController to use Frame. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Added alias for LocalFrame downcast Created 6 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) 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
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);
eseidel 2014/03/24 16:12:48 This is always a LocalFrame?
kenrb 2014/03/24 16:27:40 Uncertain, one of my earlier patchsets had a check
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698