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

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: Missed a null check 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
« no previous file with comments | « Source/core/dom/TreeScope.cpp ('k') | Source/core/frame/Frame.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 787 matching lines...) Expand 10 before | Expand all | Expand 10 after
798 798
799 // Insert the text 799 // Insert the text
800 TypingCommand::Options options = 0; 800 TypingCommand::Options options = 0;
801 if (selectInsertedText) 801 if (selectInsertedText)
802 options |= TypingCommand::SelectInsertedText; 802 options |= TypingCommand::SelectInsertedText;
803 TypingCommand::insertText(*document.get(), text, selection, options, triggeringEvent && triggeringEvent->isComposition() ? TypingCommand::TextCompos itionConfirm : TypingCommand::TextCompositionNone); 803 TypingCommand::insertText(*document.get(), text, selection, options, triggeringEvent && triggeringEvent->isComposition() ? TypingCommand::TextCompos itionConfirm : TypingCommand::TextCompositionNone);
804 804
805 // Reveal the current selection 805 // Reveal the current selection
806 if (LocalFrame* editedFrame = document->frame()) { 806 if (LocalFrame* editedFrame = document->frame()) {
807 if (Page* page = editedFrame->page()) 807 if (Page* page = editedFrame->page())
808 page->focusController().focusedOrMainFrame()->selection().re vealSelection(ScrollAlignment::alignCenterIfNeeded); 808 toLocalFrame(page->focusController().focusedOrMainFrame())-> selection().revealSelection(ScrollAlignment::alignCenterIfNeeded);
809 } 809 }
810 } 810 }
811 } 811 }
812 812
813 return true; 813 return true;
814 } 814 }
815 815
816 bool Editor::insertLineBreak() 816 bool Editor::insertLineBreak()
817 { 817 {
818 if (!canEdit()) 818 if (!canEdit())
(...skipping 410 matching lines...) Expand 10 before | Expand all | Expand 10 after
1229 return m_frame.spellChecker(); 1229 return m_frame.spellChecker();
1230 } 1230 }
1231 1231
1232 void Editor::toggleOverwriteModeEnabled() 1232 void Editor::toggleOverwriteModeEnabled()
1233 { 1233 {
1234 m_overwriteModeEnabled = !m_overwriteModeEnabled; 1234 m_overwriteModeEnabled = !m_overwriteModeEnabled;
1235 frame().selection().setShouldShowBlockCursor(m_overwriteModeEnabled); 1235 frame().selection().setShouldShowBlockCursor(m_overwriteModeEnabled);
1236 } 1236 }
1237 1237
1238 } // namespace WebCore 1238 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/dom/TreeScope.cpp ('k') | Source/core/frame/Frame.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698