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

Unified Diff: Source/web/TextFinder.cpp

Issue 1231673007: Don't zoom in TextFinder if autosizing is disabled (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: removed frame() helper from test Created 5 years, 5 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
« no previous file with comments | « Source/core/layout/TextAutosizer.cpp ('k') | Source/web/tests/TextFinderTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/web/TextFinder.cpp
diff --git a/Source/web/TextFinder.cpp b/Source/web/TextFinder.cpp
index b280418d0399d52adcaf9a8c97f6917700c3fce5..e91df596fece53cd8090ec98dc7c17eb2768a8c3 100644
--- a/Source/web/TextFinder.cpp
+++ b/Source/web/TextFinder.cpp
@@ -41,6 +41,7 @@
#include "core/editing/iterators/CharacterIterator.h"
#include "core/frame/FrameView.h"
#include "core/layout/LayoutObject.h"
+#include "core/layout/TextAutosizer.h"
#include "core/page/Page.h"
#include "modules/accessibility/AXObject.h"
#include "modules/accessibility/AXObjectCacheImpl.h"
@@ -155,9 +156,12 @@ bool TextFinder::find(int identifier, const WebString& searchText, const WebFind
return false;
}
-#if OS(ANDROID)
- ownerFrame().viewImpl()->zoomToFindInPageRect(ownerFrame().frameView()->contentsToRootFrame(enclosingIntRect(LayoutObject::absoluteBoundingBoxRectForRange(m_activeMatch.get()))));
-#endif
+ // If the user is browsing a page with autosizing, adjust the zoom to the
+ // column where the next hit has been found. Doing this when autosizing is
+ // not set will result in a zoom reset on small devices.
+ if (ownerFrame().frame()->document()->textAutosizer()->pageNeedsAutosizing()) {
+ ownerFrame().viewImpl()->zoomToFindInPageRect(ownerFrame().frameView()->contentsToRootFrame(enclosingIntRect(LayoutObject::absoluteBoundingBoxRectForRange(m_activeMatch.get()))));
+ }
setMarkerActive(m_activeMatch.get(), true);
WebLocalFrameImpl* oldActiveFrame = mainFrameImpl->ensureTextFinder().m_currentActiveMatchFrame;
« no previous file with comments | « Source/core/layout/TextAutosizer.cpp ('k') | Source/web/tests/TextFinderTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698