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

Unified Diff: chrome/renderer/chrome_render_frame_observer.cc

Issue 1774663002: Teach CRFO:CapturePageText to recognize page refreshes with long delays. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Added interval. Created 4 years, 9 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: chrome/renderer/chrome_render_frame_observer.cc
diff --git a/chrome/renderer/chrome_render_frame_observer.cc b/chrome/renderer/chrome_render_frame_observer.cc
index b49f1beea218117dbbd65ff3815aed22b42ed47e..65edde330b6458f30f8016a3f335ffaf0d8a88f6 100644
--- a/chrome/renderer/chrome_render_frame_observer.cc
+++ b/chrome/renderer/chrome_render_frame_observer.cc
@@ -64,6 +64,10 @@ static const size_t kMaxIndexChars = 65535;
// Constants for UMA statistic collection.
static const char kTranslateCaptureText[] = "Translate.CaptureText";
+// For a page that auto-refreshes, we still show the bubble, if
+// the refresh delay is less than this value (in seconds).
+static const double kLocationChangeInterval = 10;
jochen (gone - plz use gerrit) 2016/03/08 05:11:01 Please add InSeconds
+
namespace {
// If the source image is null or occupies less area than
@@ -338,7 +342,7 @@ void ChromeRenderFrameObserver::CapturePageText(TextCaptureType capture_type) {
return;
// Don't capture pages that have pending redirect or location change.
- if (frame->isNavigationScheduled())
+ if (frame->isNavigationScheduledWithin(kLocationChangeInterval))
return;
// Don't index/capture pages that are in view source mode.

Powered by Google App Engine
This is Rietveld 408576698