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

Side by Side Diff: third_party/WebKit/Source/core/frame/FrameView.cpp

Issue 2230993002: Refactor composited selection code out of WebViewImpl. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix PDF print dialog tests. Created 4 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) 1998, 1999 Torben Weis <weis@kde.org> 2 * Copyright (C) 1998, 1999 Torben Weis <weis@kde.org>
3 * 1999 Lars Knoll <knoll@kde.org> 3 * 1999 Lars Knoll <knoll@kde.org>
4 * 1999 Antti Koivisto <koivisto@kde.org> 4 * 1999 Antti Koivisto <koivisto@kde.org>
5 * 2000 Dirk Mueller <mueller@kde.org> 5 * 2000 Dirk Mueller <mueller@kde.org>
6 * Copyright (C) 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved. 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved.
7 * (C) 2006 Graham Dennis (graham.dennis@gmail.com) 7 * (C) 2006 Graham Dennis (graham.dennis@gmail.com)
8 * (C) 2006 Alexey Proskuryakov (ap@nypop.com) 8 * (C) 2006 Alexey Proskuryakov (ap@nypop.com)
9 * Copyright (C) 2009 Google Inc. All rights reserved. 9 * Copyright (C) 2009 Google Inc. All rights reserved.
10 * 10 *
(...skipping 1700 matching lines...) Expand 10 before | Expand all | Expand 10 after
1711 return; 1711 return;
1712 1712
1713 TRACE_EVENT0("blink", "FrameView::updateCompositedSelectionIfNeeded"); 1713 TRACE_EVENT0("blink", "FrameView::updateCompositedSelectionIfNeeded");
1714 1714
1715 Page* page = frame().page(); 1715 Page* page = frame().page();
1716 ASSERT(page); 1716 ASSERT(page);
1717 1717
1718 CompositedSelection selection; 1718 CompositedSelection selection;
1719 LocalFrame* focusedFrame = page->focusController().focusedFrame(); 1719 LocalFrame* focusedFrame = page->focusController().focusedFrame();
1720 LocalFrame* localFrame = (focusedFrame && (focusedFrame->localFrameRoot() == m_frame->localFrameRoot())) ? focusedFrame : nullptr; 1720 LocalFrame* localFrame = (focusedFrame && (focusedFrame->localFrameRoot() == m_frame->localFrameRoot())) ? focusedFrame : nullptr;
1721 if (!localFrame || !computeCompositedSelection(*localFrame, selection)) { 1721 if (!localFrame || !computeCompositedSelection(*localFrame, selection)) {
bokan 2016/08/11 14:14:06 These `if` statements can be simplified to: if (l
wjmaclean 2016/08/11 14:35:06 Done. Sorry, I had thought about doing this, then
1722 page->chromeClient().clearCompositedSelection(); 1722 if (localFrame) {
1723 page->chromeClient().clearCompositedSelection(localFrame);
1724 } else {
1725 // Clearing the mainframe when there is no focused frame (and hence
1726 // no localFrame) is legacy behaviour, and implemented here to
1727 // satisfy ParameterizedWebFrameTest.CompositedSelectionBoundsCleare d's
1728 // first check that the composited selection has been cleared even
1729 // though no frame has focus yet. If this is not desired, then the
1730 // expectation needs to be removed from the test.
1731 auto mainLocalFrame = m_frame->localFrameRoot();
bokan 2016/08/11 14:14:06 IMO, readability is a bit better with s/auto/Local
wjmaclean 2016/08/11 14:35:06 Done.
1732 if (mainLocalFrame)
1733 page->chromeClient().clearCompositedSelection(mainLocalFrame);
1734 }
1723 return; 1735 return;
1724 } 1736 }
1725 1737
1726 page->chromeClient().updateCompositedSelection(selection); 1738 page->chromeClient().updateCompositedSelection(localFrame, selection);
1727 } 1739 }
1728 1740
1729 HostWindow* FrameView::getHostWindow() const 1741 HostWindow* FrameView::getHostWindow() const
1730 { 1742 {
1731 Page* page = frame().page(); 1743 Page* page = frame().page();
1732 if (!page) 1744 if (!page)
1733 return nullptr; 1745 return nullptr;
1734 return &page->chromeClient(); 1746 return &page->chromeClient();
1735 } 1747 }
1736 1748
(...skipping 2510 matching lines...) Expand 10 before | Expand all | Expand 10 after
4247 } 4259 }
4248 4260
4249 bool FrameView::canThrottleRendering() const 4261 bool FrameView::canThrottleRendering() const
4250 { 4262 {
4251 if (!RuntimeEnabledFeatures::renderingPipelineThrottlingEnabled()) 4263 if (!RuntimeEnabledFeatures::renderingPipelineThrottlingEnabled())
4252 return false; 4264 return false;
4253 return m_subtreeThrottled || (m_hiddenForThrottling && m_crossOriginForThrot tling); 4265 return m_subtreeThrottled || (m_hiddenForThrottling && m_crossOriginForThrot tling);
4254 } 4266 }
4255 4267
4256 } // namespace blink 4268 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/page/ChromeClient.h » ('j') | third_party/WebKit/Source/web/ChromeClientImpl.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698