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

Unified Diff: components/omnibox/autocomplete_provider.h

Issue 985503002: Omnibox - Make Omnibox Extensions Ignore Stop() Calls Due to User Idleness (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: make unit tests compile Created 5 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: components/omnibox/autocomplete_provider.h
diff --git a/components/omnibox/autocomplete_provider.h b/components/omnibox/autocomplete_provider.h
index c86c274ed9f6ac8effe7671b674a1a46044979ae..255a33334de284781df743fd44c2f7ffeeb6563f 100644
--- a/components/omnibox/autocomplete_provider.h
+++ b/components/omnibox/autocomplete_provider.h
@@ -151,7 +151,8 @@ class AutocompleteProvider
// otherwise, starting each provider running would result in a flurry of
// notifications).
//
- // Once Stop() has been called, no more notifications should be sent.
+ // Once Stop() has been called, usually no more notifications should be sent.
+ // (See comments on Stop() below.)
//
// |minimal_changes| is an optimization that lets the provider do less work
// when the |input|'s text hasn't changed. See the body of
@@ -165,11 +166,21 @@ class AutocompleteProvider
bool minimal_changes,
bool called_due_to_focus) = 0;
- // Called when a provider must not make any more callbacks for the current
- // query. This will be called regardless of whether the provider is already
- // done. If the provider caches any results, it should clear the cache based
- // on the value of |clear_cached_results|.
- virtual void Stop(bool clear_cached_results);
+ // Advises the provider to stop processing. This may be called even if the
+ // provider is already done. If the provider caches any results, it should
+ // clear the cache based on the value of |clear_cached_results|. Normally,
+ // once this is called, the provider should not send more notifications to
+ // the controller.
+ //
+ // If |user_inactivity_timer| is true, Stop() is being called because it's
+ // been a long time since the user started the current query, and returning
+ // further asynchronous results would normally just be disruptive. Most
+ // providers should still stop processing in this case, but continuing is
+ // legal if there's a good reason the user is likely to want even long-
+ // delayed asynchronous results, e.g. the user has explicitly invoked a
+ // keyword extension and the extension is still processing the request.
+ virtual void Stop(bool clear_cached_results,
+ bool due_to_user_inactivity);
// Returns the enum equivalent to the name of this provider.
// TODO(derat): Make metrics use AutocompleteProvider::Type directly, or at
« no previous file with comments | « chrome/browser/autocomplete/zero_suggest_provider_unittest.cc ('k') | components/omnibox/autocomplete_provider.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698