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

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

Issue 317493002: Change FrameTree to return Frames instead of LocalFrames. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: dcheng's comment addressed Created 6 years, 6 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 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 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
89 if (m_spellCheckThisFieldStatus == SpellCheckForcedOn) 89 if (m_spellCheckThisFieldStatus == SpellCheckForcedOn)
90 return true; 90 return true;
91 return shouldSpellcheckByDefault(); 91 return shouldSpellcheckByDefault();
92 } 92 }
93 93
94 void SpellCheckerClientImpl::toggleContinuousSpellChecking() 94 void SpellCheckerClientImpl::toggleContinuousSpellChecking()
95 { 95 {
96 if (isContinuousSpellCheckingEnabled()) { 96 if (isContinuousSpellCheckingEnabled()) {
97 m_spellCheckThisFieldStatus = SpellCheckForcedOff; 97 m_spellCheckThisFieldStatus = SpellCheckForcedOff;
98 if (Page* page = m_webView->page()) { 98 if (Page* page = m_webView->page()) {
99 for (LocalFrame* frame = page->mainFrame(); frame && frame->document (); frame = frame->tree().traverseNext()) { 99 for (Frame* frame = page->mainFrame(); frame; frame = frame->tree(). traverseNext()) {
100 frame->document()->markers().removeMarkers(DocumentMarker::Missp ellingMarkers()); 100 if (!frame->isLocalFrame())
101 continue;
102 toLocalFrame(frame)->document()->markers().removeMarkers(Documen tMarker::MisspellingMarkers());
101 } 103 }
102 } 104 }
103 } else { 105 } else {
104 m_spellCheckThisFieldStatus = SpellCheckForcedOn; 106 m_spellCheckThisFieldStatus = SpellCheckForcedOn;
105 if (m_webView->focusedWebCoreFrame()->isLocalFrame()) { 107 if (m_webView->focusedWebCoreFrame()->isLocalFrame()) {
106 if (LocalFrame* frame = toLocalFrame(m_webView->focusedWebCoreFrame( ))) { 108 if (LocalFrame* frame = toLocalFrame(m_webView->focusedWebCoreFrame( ))) {
107 VisibleSelection frameSelection = frame->selection().selection() ; 109 VisibleSelection frameSelection = frame->selection().selection() ;
108 // If a selection is in an editable element spell check its cont ent. 110 // If a selection is in an editable element spell check its cont ent.
109 if (Element* rootEditableElement = frameSelection.rootEditableEl ement()) { 111 if (Element* rootEditableElement = frameSelection.rootEditableEl ement()) {
110 frame->spellChecker().didBeginEditing(rootEditableElement); 112 frame->spellChecker().didBeginEditing(rootEditableElement);
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after
224 } 226 }
225 227
226 bool SpellCheckerClientImpl::spellingUIIsShowing() 228 bool SpellCheckerClientImpl::spellingUIIsShowing()
227 { 229 {
228 if (m_webView->spellCheckClient()) 230 if (m_webView->spellCheckClient())
229 return m_webView->spellCheckClient()->isShowingSpellingUI(); 231 return m_webView->spellCheckClient()->isShowingSpellingUI();
230 return false; 232 return false;
231 } 233 }
232 234
233 } // namesace WebKit 235 } // namesace WebKit
OLDNEW
« no previous file with comments | « Source/modules/geolocation/testing/InternalsGeolocation.cpp ('k') | Source/web/WebLocalFrameImpl.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698