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

Unified Diff: chrome/browser/android/omnibox/autocomplete_controller_android.h

Issue 319813002: Add a method to retrieve the top synchronous suggestion. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Style fixes Created 6 years, 6 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/browser/android/omnibox/autocomplete_controller_android.h
diff --git a/chrome/browser/android/omnibox/autocomplete_controller_android.h b/chrome/browser/android/omnibox/autocomplete_controller_android.h
index d961068e7b302c550b47c06a54b3d3c814ff2912..582a3503e98e8ead8fa136250174f4c90db81214 100644
--- a/chrome/browser/android/omnibox/autocomplete_controller_android.h
+++ b/chrome/browser/android/omnibox/autocomplete_controller_android.h
@@ -67,6 +67,11 @@ class AutocompleteControllerAndroid : public AutocompleteControllerDelegate,
jint selected_index,
jlong elapsed_time_since_input_change);
+ base::android::ScopedJavaLocalRef<jobject> GetTopSynchronousMatch(
+ JNIEnv* env,
+ jobject obj,
+ jstring query);
+
// KeyedService:
virtual void Shutdown() OVERRIDE;
@@ -119,13 +124,23 @@ class AutocompleteControllerAndroid : public AutocompleteControllerDelegate,
// e.g. http://xn--6q8b.kr/ --> 한.kr
base::string16 FormatURLUsingAcceptLanguages(GURL url);
+ // A helper method for fetching the top synchronous autocomplete result.
+ // The |prevent_inline_autocomplete| flag is passed to the AutocompleteInput
+ // object, see documentation there for its description.
+ base::android::ScopedJavaLocalRef<jobject> GetTopSynchronousResult(
+ JNIEnv* env,
+ jobject obj,
+ jstring j_text,
+ bool prevent_inline_autocomplete);
+
scoped_ptr<AutocompleteController> autocomplete_controller_;
// Last input we sent to the autocomplete controller.
AutocompleteInput input_;
- // Whether we're currently inside a call to Classify().
- bool inside_classify_;
+ // Whether we're currently inside a call to Start() that's called
+ // from GetTopSynchronousResult().
+ bool inside_synchronous_start_;
JavaObjectWeakGlobalRef weak_java_autocomplete_controller_android_;
Profile* profile_;

Powered by Google App Engine
This is Rietveld 408576698