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

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

Issue 419563003: Adding a word to dictionary should remove spelling markers (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Addressed comment Created 6 years, 4 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) 2011, 2012 Google Inc. All rights reserved. 2 * Copyright (C) 2011, 2012 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * 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 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 3363 matching lines...) Expand 10 before | Expand all | Expand 10 after
3374 for (Frame* frame = m_page->mainFrame(); frame; frame = frame->tree().traver seNext()) { 3374 for (Frame* frame = m_page->mainFrame(); frame; frame = frame->tree().traver seNext()) {
3375 if (!frame->isLocalFrame()) 3375 if (!frame->isLocalFrame())
3376 continue; 3376 continue;
3377 const DocumentMarkerVector& documentMarkers = toLocalFrame(frame)->docum ent()->markers().markers(); 3377 const DocumentMarkerVector& documentMarkers = toLocalFrame(frame)->docum ent()->markers().markers();
3378 for (size_t i = 0; i < documentMarkers.size(); ++i) 3378 for (size_t i = 0; i < documentMarkers.size(); ++i)
3379 result.append(documentMarkers[i]->hash()); 3379 result.append(documentMarkers[i]->hash());
3380 } 3380 }
3381 markers->assign(result); 3381 markers->assign(result);
3382 } 3382 }
3383 3383
3384 void WebViewImpl::removeSpellingMarkersUnderWords(const WebVector<WebString>& wo rds)
3385 {
3386 for (Frame* frame = m_page->mainFrame(); frame; frame = frame->tree().traver seNext()) {
3387 if (!frame->isLocalFrame())
3388 continue;
3389
3390 auto localFrame = static_cast<LocalFrame *>(frame);
dcheng 2014/08/05 20:30:39 We can't use auto in Blink.
Klemen Forstnerič 2014/08/07 17:47:29 Done.
3391 auto webLocalFrame = WebLocalFrameImpl::fromFrame(localFrame);
3392 webLocalFrame->removeSpellingMarkersUnderWords(words);
3393 }
3394 }
3395
3384 WebDragOperation WebViewImpl::dragTargetDragEnterOrOver(const WebPoint& clientPo int, const WebPoint& screenPoint, DragAction dragAction, int keyModifiers) 3396 WebDragOperation WebViewImpl::dragTargetDragEnterOrOver(const WebPoint& clientPo int, const WebPoint& screenPoint, DragAction dragAction, int keyModifiers)
3385 { 3397 {
3386 ASSERT(m_currentDragData); 3398 ASSERT(m_currentDragData);
3387 3399
3388 m_currentDragData->setModifierKeyState(webInputEventKeyStateToPlatformEventK eyState(keyModifiers)); 3400 m_currentDragData->setModifierKeyState(webInputEventKeyStateToPlatformEventK eyState(keyModifiers));
3389 DragData dragData( 3401 DragData dragData(
3390 m_currentDragData.get(), 3402 m_currentDragData.get(),
3391 clientPoint, 3403 clientPoint,
3392 screenPoint, 3404 screenPoint,
3393 static_cast<DragOperation>(m_operationsAllowed)); 3405 static_cast<DragOperation>(m_operationsAllowed));
(...skipping 846 matching lines...) Expand 10 before | Expand all | Expand 10 after
4240 const PageScaleConstraints& constraints = m_pageScaleConstraintsSet.pageDefi nedConstraints(); 4252 const PageScaleConstraints& constraints = m_pageScaleConstraintsSet.pageDefi nedConstraints();
4241 4253
4242 if (!mainFrameImpl() || !mainFrameImpl()->frameView()) 4254 if (!mainFrameImpl() || !mainFrameImpl()->frameView())
4243 return false; 4255 return false;
4244 4256
4245 return mainFrameImpl()->frameView()->layoutSize().width() == m_size.width 4257 return mainFrameImpl()->frameView()->layoutSize().width() == m_size.width
4246 || (constraints.minimumScale == constraints.maximumScale && constraints. minimumScale != -1); 4258 || (constraints.minimumScale == constraints.maximumScale && constraints. minimumScale != -1);
4247 } 4259 }
4248 4260
4249 } // namespace blink 4261 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698