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

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

Issue 2612903007: Migrate WTF::Vector::append() to ::push_back() [part 15 of N] (Closed)
Patch Set: Created 3 years, 11 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 283 matching lines...) Expand 10 before | Expand all | Expand 10 after
294 294
295 void WebView::updateVisitedLinkState(unsigned long long linkHash) { 295 void WebView::updateVisitedLinkState(unsigned long long linkHash) {
296 Page::visitedStateChanged(linkHash); 296 Page::visitedStateChanged(linkHash);
297 } 297 }
298 298
299 void WebView::resetVisitedLinkState(bool invalidateVisitedLinkHashes) { 299 void WebView::resetVisitedLinkState(bool invalidateVisitedLinkHashes) {
300 Page::allVisitedStateChanged(invalidateVisitedLinkHashes); 300 Page::allVisitedStateChanged(invalidateVisitedLinkHashes);
301 } 301 }
302 302
303 void WebView::willEnterModalLoop() { 303 void WebView::willEnterModalLoop() {
304 pageSuspenderStack().append(WTF::makeUnique<ScopedPageSuspender>()); 304 pageSuspenderStack().push_back(WTF::makeUnique<ScopedPageSuspender>());
305 } 305 }
306 306
307 void WebView::didExitModalLoop() { 307 void WebView::didExitModalLoop() {
308 DCHECK(pageSuspenderStack().size()); 308 DCHECK(pageSuspenderStack().size());
309 pageSuspenderStack().pop_back(); 309 pageSuspenderStack().pop_back();
310 } 310 }
311 311
312 void WebViewImpl::setMainFrame(WebFrame* frame) { 312 void WebViewImpl::setMainFrame(WebFrame* frame) {
313 frame->toImplBase()->initializeCoreFrame(&page()->frameHost(), 0, nullAtom, 313 frame->toImplBase()->initializeCoreFrame(&page()->frameHost(), 0, nullAtom,
314 nullAtom); 314 nullAtom);
(...skipping 1144 matching lines...) Expand 10 before | Expand all | Expand 10 after
1459 m_page->deprecatedLocalMainFrame())); 1459 m_page->deprecatedLocalMainFrame()));
1460 1460
1461 return bestTouchNode; 1461 return bestTouchNode;
1462 } 1462 }
1463 1463
1464 void WebViewImpl::enableTapHighlightAtPoint( 1464 void WebViewImpl::enableTapHighlightAtPoint(
1465 const GestureEventWithHitTestResults& targetedTapEvent) { 1465 const GestureEventWithHitTestResults& targetedTapEvent) {
1466 Node* touchNode = bestTapNode(targetedTapEvent); 1466 Node* touchNode = bestTapNode(targetedTapEvent);
1467 1467
1468 HeapVector<Member<Node>> highlightNodes; 1468 HeapVector<Member<Node>> highlightNodes;
1469 highlightNodes.append(touchNode); 1469 highlightNodes.push_back(touchNode);
1470 1470
1471 enableTapHighlights(highlightNodes); 1471 enableTapHighlights(highlightNodes);
1472 } 1472 }
1473 1473
1474 void WebViewImpl::enableTapHighlights( 1474 void WebViewImpl::enableTapHighlights(
1475 HeapVector<Member<Node>>& highlightNodes) { 1475 HeapVector<Member<Node>>& highlightNodes) {
1476 if (highlightNodes.isEmpty()) 1476 if (highlightNodes.isEmpty())
1477 return; 1477 return;
1478 1478
1479 // Always clear any existing highlight when this is invoked, even if we 1479 // Always clear any existing highlight when this is invoked, even if we
1480 // don't get a new target to highlight. 1480 // don't get a new target to highlight.
1481 m_linkHighlights.clear(); 1481 m_linkHighlights.clear();
1482 1482
1483 for (size_t i = 0; i < highlightNodes.size(); ++i) { 1483 for (size_t i = 0; i < highlightNodes.size(); ++i) {
1484 Node* node = highlightNodes[i]; 1484 Node* node = highlightNodes[i];
1485 1485
1486 if (!node || !node->layoutObject()) 1486 if (!node || !node->layoutObject())
1487 continue; 1487 continue;
1488 1488
1489 Color highlightColor = node->layoutObject()->style()->tapHighlightColor(); 1489 Color highlightColor = node->layoutObject()->style()->tapHighlightColor();
1490 // Safari documentation for -webkit-tap-highlight-color says if the 1490 // Safari documentation for -webkit-tap-highlight-color says if the
1491 // specified color has 0 alpha, then tap highlighting is disabled. 1491 // specified color has 0 alpha, then tap highlighting is disabled.
1492 // http://developer.apple.com/library/safari/#documentation/appleapplication s/reference/safaricssref/articles/standardcssproperties.html 1492 // http://developer.apple.com/library/safari/#documentation/appleapplication s/reference/safaricssref/articles/standardcssproperties.html
1493 if (!highlightColor.alpha()) 1493 if (!highlightColor.alpha())
1494 continue; 1494 continue;
1495 1495
1496 m_linkHighlights.append(LinkHighlightImpl::create(node, this)); 1496 m_linkHighlights.push_back(LinkHighlightImpl::create(node, this));
1497 } 1497 }
1498 1498
1499 updateAllLifecyclePhases(); 1499 updateAllLifecyclePhases();
1500 } 1500 }
1501 1501
1502 void WebViewImpl::animateDoubleTapZoom(const IntPoint& pointInRootFrame) { 1502 void WebViewImpl::animateDoubleTapZoom(const IntPoint& pointInRootFrame) {
1503 if (!mainFrameImpl()) 1503 if (!mainFrameImpl())
1504 return; 1504 return;
1505 1505
1506 WebRect blockBounds = computeBlockBound(pointInRootFrame, false); 1506 WebRect blockBounds = computeBlockBound(pointInRootFrame, false);
(...skipping 1874 matching lines...) Expand 10 before | Expand all | Expand 10 after
3381 3381
3382 void WebViewImpl::spellingMarkers(WebVector<uint32_t>* markers) { 3382 void WebViewImpl::spellingMarkers(WebVector<uint32_t>* markers) {
3383 Vector<uint32_t> result; 3383 Vector<uint32_t> result;
3384 for (Frame* frame = m_page->mainFrame(); frame; 3384 for (Frame* frame = m_page->mainFrame(); frame;
3385 frame = frame->tree().traverseNext()) { 3385 frame = frame->tree().traverseNext()) {
3386 if (!frame->isLocalFrame()) 3386 if (!frame->isLocalFrame())
3387 continue; 3387 continue;
3388 const DocumentMarkerVector& documentMarkers = 3388 const DocumentMarkerVector& documentMarkers =
3389 toLocalFrame(frame)->document()->markers().markers(); 3389 toLocalFrame(frame)->document()->markers().markers();
3390 for (size_t i = 0; i < documentMarkers.size(); ++i) 3390 for (size_t i = 0; i < documentMarkers.size(); ++i)
3391 result.append(documentMarkers[i]->hash()); 3391 result.push_back(documentMarkers[i]->hash());
3392 } 3392 }
3393 markers->assign(result); 3393 markers->assign(result);
3394 } 3394 }
3395 3395
3396 void WebViewImpl::removeSpellingMarkersUnderWords( 3396 void WebViewImpl::removeSpellingMarkersUnderWords(
3397 const WebVector<WebString>& words) { 3397 const WebVector<WebString>& words) {
3398 Vector<String> convertedWords; 3398 Vector<String> convertedWords;
3399 convertedWords.append(words.data(), words.size()); 3399 convertedWords.append(words.data(), words.size());
3400 3400
3401 for (Frame* frame = m_page->mainFrame(); frame; 3401 for (Frame* frame = m_page->mainFrame(); frame;
(...skipping 799 matching lines...) Expand 10 before | Expand all | Expand 10 after
4201 if (focusedFrame->localFrameRoot() != mainFrameImpl()->frame()) 4201 if (focusedFrame->localFrameRoot() != mainFrameImpl()->frame())
4202 return nullptr; 4202 return nullptr;
4203 return focusedFrame; 4203 return focusedFrame;
4204 } 4204 }
4205 4205
4206 LocalFrame* WebViewImpl::focusedLocalFrameAvailableForIme() const { 4206 LocalFrame* WebViewImpl::focusedLocalFrameAvailableForIme() const {
4207 return m_imeAcceptEvents ? focusedLocalFrameInWidget() : nullptr; 4207 return m_imeAcceptEvents ? focusedLocalFrameInWidget() : nullptr;
4208 } 4208 }
4209 4209
4210 } // namespace blink 4210 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/web/WebTextCheckingResult.cpp ('k') | third_party/WebKit/Source/web/tests/ActivityLoggerTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698