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

Side by Side Diff: Source/web/SpellCheckerClientImpl.cpp

Issue 181693003: Have Document::markers() return a reference (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 10 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 | Annotate | Revision Log
« no previous file with comments | « Source/web/ContextMenuClientImpl.cpp ('k') | Source/web/WebFrameImpl.cpp » ('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 Apple, Inc. All rights reserved. 2 * Copyright (C) 2006, 2007 Apple, Inc. All rights reserved.
3 * Copyright (C) 2012 Google, Inc. All rights reserved. 3 * Copyright (C) 2012 Google, Inc. All rights reserved.
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 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
88 return true; 88 return true;
89 return shouldSpellcheckByDefault(); 89 return shouldSpellcheckByDefault();
90 } 90 }
91 91
92 void SpellCheckerClientImpl::toggleContinuousSpellChecking() 92 void SpellCheckerClientImpl::toggleContinuousSpellChecking()
93 { 93 {
94 if (isContinuousSpellCheckingEnabled()) { 94 if (isContinuousSpellCheckingEnabled()) {
95 m_spellCheckThisFieldStatus = SpellCheckForcedOff; 95 m_spellCheckThisFieldStatus = SpellCheckForcedOff;
96 if (Page* page = m_webView->page()) { 96 if (Page* page = m_webView->page()) {
97 for (LocalFrame* frame = page->mainFrame(); frame && frame->document (); frame = frame->tree().traverseNext()) { 97 for (LocalFrame* frame = page->mainFrame(); frame && frame->document (); frame = frame->tree().traverseNext()) {
98 frame->document()->markers()->removeMarkers(DocumentMarker::Miss pellingMarkers()); 98 frame->document()->markers().removeMarkers(DocumentMarker::Missp ellingMarkers());
99 } 99 }
100 } 100 }
101 } else { 101 } else {
102 m_spellCheckThisFieldStatus = SpellCheckForcedOn; 102 m_spellCheckThisFieldStatus = SpellCheckForcedOn;
103 if (LocalFrame* frame = m_webView->focusedWebCoreFrame()) { 103 if (LocalFrame* frame = m_webView->focusedWebCoreFrame()) {
104 VisibleSelection frameSelection = frame->selection().selection(); 104 VisibleSelection frameSelection = frame->selection().selection();
105 // If a selection is in an editable element spell check its content. 105 // If a selection is in an editable element spell check its content.
106 if (Element* rootEditableElement = frameSelection.rootEditableElemen t()) { 106 if (Element* rootEditableElement = frameSelection.rootEditableElemen t()) {
107 frame->spellChecker().didBeginEditing(rootEditableElement); 107 frame->spellChecker().didBeginEditing(rootEditableElement);
108 } 108 }
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after
220 } 220 }
221 221
222 bool SpellCheckerClientImpl::spellingUIIsShowing() 222 bool SpellCheckerClientImpl::spellingUIIsShowing()
223 { 223 {
224 if (m_webView->spellCheckClient()) 224 if (m_webView->spellCheckClient())
225 return m_webView->spellCheckClient()->isShowingSpellingUI(); 225 return m_webView->spellCheckClient()->isShowingSpellingUI();
226 return false; 226 return false;
227 } 227 }
228 228
229 } // namesace WebKit 229 } // namesace WebKit
OLDNEW
« no previous file with comments | « Source/web/ContextMenuClientImpl.cpp ('k') | Source/web/WebFrameImpl.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698