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

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

Issue 33353003: Have Frame::tree() return a reference (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebase on master Created 7 years, 2 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/WebFrameImpl.cpp ('k') | no next file » | 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) 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 1525 matching lines...) Expand 10 before | Expand all | Expand 10 after
1536 ScrollGranularity scrollGranularity) 1536 ScrollGranularity scrollGranularity)
1537 { 1537 {
1538 Frame* frame = focusedWebCoreFrame(); 1538 Frame* frame = focusedWebCoreFrame();
1539 if (!frame) 1539 if (!frame)
1540 return false; 1540 return false;
1541 1541
1542 bool scrollHandled = frame->eventHandler()->scrollOverflow(scrollDirection, scrollGranularity); 1542 bool scrollHandled = frame->eventHandler()->scrollOverflow(scrollDirection, scrollGranularity);
1543 Frame* currentFrame = frame; 1543 Frame* currentFrame = frame;
1544 while (!scrollHandled && currentFrame) { 1544 while (!scrollHandled && currentFrame) {
1545 scrollHandled = currentFrame->view()->scroll(scrollDirection, scrollGran ularity); 1545 scrollHandled = currentFrame->view()->scroll(scrollDirection, scrollGran ularity);
1546 currentFrame = currentFrame->tree()->parent(); 1546 currentFrame = currentFrame->tree().parent();
1547 } 1547 }
1548 return scrollHandled; 1548 return scrollHandled;
1549 } 1549 }
1550 1550
1551 void WebViewImpl::popupOpened(WebCore::PopupContainer* popupContainer) 1551 void WebViewImpl::popupOpened(WebCore::PopupContainer* popupContainer)
1552 { 1552 {
1553 if (popupContainer->popupType() == WebCore::PopupContainer::Select) { 1553 if (popupContainer->popupType() == WebCore::PopupContainer::Select) {
1554 ASSERT(!m_selectPopup); 1554 ASSERT(!m_selectPopup);
1555 m_selectPopup = popupContainer; 1555 m_selectPopup = popupContainer;
1556 Document* document = mainFrameImpl()->frame()->document(); 1556 Document* document = mainFrameImpl()->frame()->document();
(...skipping 1014 matching lines...) Expand 10 before | Expand all | Expand 10 after
2571 { 2571 {
2572 return mainFrameImpl(); 2572 return mainFrameImpl();
2573 } 2573 }
2574 2574
2575 WebFrame* WebViewImpl::findFrameByName( 2575 WebFrame* WebViewImpl::findFrameByName(
2576 const WebString& name, WebFrame* relativeToFrame) 2576 const WebString& name, WebFrame* relativeToFrame)
2577 { 2577 {
2578 if (!relativeToFrame) 2578 if (!relativeToFrame)
2579 relativeToFrame = mainFrame(); 2579 relativeToFrame = mainFrame();
2580 Frame* frame = toWebFrameImpl(relativeToFrame)->frame(); 2580 Frame* frame = toWebFrameImpl(relativeToFrame)->frame();
2581 frame = frame->tree()->find(name); 2581 frame = frame->tree().find(name);
2582 return WebFrameImpl::fromFrame(frame); 2582 return WebFrameImpl::fromFrame(frame);
2583 } 2583 }
2584 2584
2585 WebFrame* WebViewImpl::focusedFrame() 2585 WebFrame* WebViewImpl::focusedFrame()
2586 { 2586 {
2587 return WebFrameImpl::fromFrame(focusedWebCoreFrame()); 2587 return WebFrameImpl::fromFrame(focusedWebCoreFrame());
2588 } 2588 }
2589 2589
2590 void WebViewImpl::setFocusedFrame(WebFrame* frame) 2590 void WebViewImpl::setFocusedFrame(WebFrame* frame)
2591 { 2591 {
(...skipping 696 matching lines...) Expand 10 before | Expand all | Expand 10 after
3288 3288
3289 m_page->dragController().performDrag(&dragData); 3289 m_page->dragController().performDrag(&dragData);
3290 3290
3291 m_dragOperation = WebDragOperationNone; 3291 m_dragOperation = WebDragOperationNone;
3292 m_currentDragData = 0; 3292 m_currentDragData = 0;
3293 } 3293 }
3294 3294
3295 void WebViewImpl::spellingMarkers(WebVector<uint32_t>* markers) 3295 void WebViewImpl::spellingMarkers(WebVector<uint32_t>* markers)
3296 { 3296 {
3297 Vector<uint32_t> result; 3297 Vector<uint32_t> result;
3298 for (Frame* frame = m_page->mainFrame(); frame; frame = frame->tree()->trave rseNext()) { 3298 for (Frame* frame = m_page->mainFrame(); frame; frame = frame->tree().traver seNext()) {
3299 const Vector<DocumentMarker*>& documentMarkers = frame->document()->mark ers()->markers(); 3299 const Vector<DocumentMarker*>& documentMarkers = frame->document()->mark ers()->markers();
3300 for (size_t i = 0; i < documentMarkers.size(); ++i) 3300 for (size_t i = 0; i < documentMarkers.size(); ++i)
3301 result.append(documentMarkers[i]->hash()); 3301 result.append(documentMarkers[i]->hash());
3302 } 3302 }
3303 markers->assign(result); 3303 markers->assign(result);
3304 } 3304 }
3305 3305
3306 WebDragOperation WebViewImpl::dragTargetDragEnterOrOver(const WebPoint& clientPo int, const WebPoint& screenPoint, DragAction dragAction, int keyModifiers) 3306 WebDragOperation WebViewImpl::dragTargetDragEnterOrOver(const WebPoint& clientPo int, const WebPoint& screenPoint, DragAction dragAction, int keyModifiers)
3307 { 3307 {
3308 ASSERT(m_currentDragData); 3308 ASSERT(m_currentDragData);
(...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after
3527 } 3527 }
3528 3528
3529 // WebView -------------------------------------------------------------------- 3529 // WebView --------------------------------------------------------------------
3530 3530
3531 void WebViewImpl::setIsTransparent(bool isTransparent) 3531 void WebViewImpl::setIsTransparent(bool isTransparent)
3532 { 3532 {
3533 // Set any existing frames to be transparent. 3533 // Set any existing frames to be transparent.
3534 Frame* frame = m_page->mainFrame(); 3534 Frame* frame = m_page->mainFrame();
3535 while (frame) { 3535 while (frame) {
3536 frame->view()->setTransparent(isTransparent); 3536 frame->view()->setTransparent(isTransparent);
3537 frame = frame->tree()->traverseNext(); 3537 frame = frame->tree().traverseNext();
3538 } 3538 }
3539 3539
3540 // Future frames check this to know whether to be transparent. 3540 // Future frames check this to know whether to be transparent.
3541 m_isTransparent = isTransparent; 3541 m_isTransparent = isTransparent;
3542 } 3542 }
3543 3543
3544 bool WebViewImpl::isTransparent() const 3544 bool WebViewImpl::isTransparent() const
3545 { 3545 {
3546 return m_isTransparent; 3546 return m_isTransparent;
3547 } 3547 }
(...skipping 586 matching lines...) Expand 10 before | Expand all | Expand 10 after
4134 const PageScaleConstraints& constraints = m_pageScaleConstraintsSet.pageDefi nedConstraints(); 4134 const PageScaleConstraints& constraints = m_pageScaleConstraintsSet.pageDefi nedConstraints();
4135 4135
4136 if (!mainFrameImpl() || !mainFrameImpl()->frameView()) 4136 if (!mainFrameImpl() || !mainFrameImpl()->frameView())
4137 return false; 4137 return false;
4138 4138
4139 return mainFrameImpl()->frameView()->layoutSize().width() == m_size.width 4139 return mainFrameImpl()->frameView()->layoutSize().width() == m_size.width
4140 || (constraints.minimumScale == constraints.maximumScale && constraints. minimumScale != -1); 4140 || (constraints.minimumScale == constraints.maximumScale && constraints. minimumScale != -1);
4141 } 4141 }
4142 4142
4143 } // namespace WebKit 4143 } // namespace WebKit
OLDNEW
« no previous file with comments | « Source/web/WebFrameImpl.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698