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

Unified Diff: third_party/WebKit/Source/web/WebLocalFrameImpl.cpp

Issue 1959183002: Multi-Process Find-in-Page. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/web/WebLocalFrameImpl.cpp
diff --git a/third_party/WebKit/Source/web/WebLocalFrameImpl.cpp b/third_party/WebKit/Source/web/WebLocalFrameImpl.cpp
index 074ddd83efbbd192e16f1e4075ad0b34eecd2604..65b23207223c5d5063c1a0055239a6afe1616c90 100644
--- a/third_party/WebKit/Source/web/WebLocalFrameImpl.cpp
+++ b/third_party/WebKit/Source/web/WebLocalFrameImpl.cpp
@@ -1553,11 +1553,8 @@ LocalFrame* WebLocalFrameImpl::createChildFrame(const FrameLoadRequest& request,
void WebLocalFrameImpl::didChangeContentsSize(const IntSize& size)
{
- // This is only possible on the main frame.
- if (m_textFinder && m_textFinder->totalMatchCount() > 0) {
- DCHECK(!parent());
+ if (m_textFinder && m_textFinder->totalMatchCount() > 0)
m_textFinder->increaseMarkerVersion();
- }
}
void WebLocalFrameImpl::createFrameView()
@@ -1625,12 +1622,7 @@ WebDataSourceImpl* WebLocalFrameImpl::provisionalDataSourceImpl() const
void WebLocalFrameImpl::setFindEndstateFocusAndSelection()
{
- WebLocalFrameImpl* mainFrameImpl = viewImpl()->mainFrameImpl();
-
- // Main frame should already have a textFinder at this point of time.
- DCHECK(mainFrameImpl->textFinder());
-
- if (this != mainFrameImpl->textFinder()->activeMatchFrame())
+ if (!m_textFinder || !m_textFinder->activeMatchFrame())
return;
if (Range* activeMatch = m_textFinder->activeMatch()) {
@@ -1811,6 +1803,11 @@ void WebLocalFrameImpl::setFrameOwnerProperties(const WebFrameOwnerProperties& f
toRemoteFrameOwner(owner)->setMarginHeight(frameOwnerProperties.marginHeight);
}
+bool WebLocalFrameImpl::isFocused() const
+{
+ return this == WebFrame::fromFrame(viewImpl()->page()->focusController().focusedFrame());
+}
+
WebLocalFrameImpl* WebLocalFrameImpl::localRoot()
{
// This can't use the LocalFrame::localFrameRoot, since it may be called
@@ -2001,8 +1998,6 @@ void WebLocalFrameImpl::cancelPendingScopingEffort()
void WebLocalFrameImpl::increaseMatchCount(int count, int identifier)
{
- // This function should only be called on the mainframe.
- DCHECK(!parent());
ensureTextFinder().increaseMatchCount(identifier, count);
}
@@ -2019,8 +2014,6 @@ void WebLocalFrameImpl::dispatchMessageEventWithOriginCheck(const WebSecurityOri
int WebLocalFrameImpl::findMatchMarkersVersion() const
{
- DCHECK(!parent());
-
if (m_textFinder)
return m_textFinder->findMatchMarkersVersion();
return 0;
@@ -2028,14 +2021,18 @@ int WebLocalFrameImpl::findMatchMarkersVersion() const
int WebLocalFrameImpl::selectNearestFindMatch(const WebFloatPoint& point, WebRect* selectionRect)
{
- DCHECK(!parent());
return ensureTextFinder().selectNearestFindMatch(point, selectionRect);
}
-WebFloatRect WebLocalFrameImpl::activeFindMatchRect()
+float WebLocalFrameImpl::nearestFindMatch(const WebFloatPoint& point)
{
- DCHECK(!parent());
+ float nearestDistance;
+ ensureTextFinder().nearestFindMatch(point, &nearestDistance);
+ return nearestDistance;
+}
+WebFloatRect WebLocalFrameImpl::activeFindMatchRect()
+{
if (m_textFinder)
return m_textFinder->activeFindMatchRect();
return WebFloatRect();
@@ -2043,7 +2040,6 @@ WebFloatRect WebLocalFrameImpl::activeFindMatchRect()
void WebLocalFrameImpl::findMatchRects(WebVector<WebFloatRect>& outputRects)
{
- DCHECK(!parent());
ensureTextFinder().findMatchRects(outputRects);
}
@@ -2112,4 +2108,9 @@ void WebLocalFrameImpl::forceSandboxFlags(WebSandboxFlags flags)
frame()->loader().forceSandboxFlags(static_cast<SandboxFlags>(flags));
}
+void WebLocalFrameImpl::clearActiveFindMatch()
+{
+ ensureTextFinder().clearActiveFindMatch();
+}
+
} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698