| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef CHROME_BROWSER_ANDROID_OMNIBOX_AUTOCOMPLETE_CONTROLLER_ANDROID_H_ | 5 #ifndef CHROME_BROWSER_ANDROID_OMNIBOX_AUTOCOMPLETE_CONTROLLER_ANDROID_H_ |
| 6 #define CHROME_BROWSER_ANDROID_OMNIBOX_AUTOCOMPLETE_CONTROLLER_ANDROID_H_ | 6 #define CHROME_BROWSER_ANDROID_OMNIBOX_AUTOCOMPLETE_CONTROLLER_ANDROID_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 45 bool best_match_only); | 45 bool best_match_only); |
| 46 base::android::ScopedJavaLocalRef<jobject> Classify( | 46 base::android::ScopedJavaLocalRef<jobject> Classify( |
| 47 JNIEnv* env, | 47 JNIEnv* env, |
| 48 const base::android::JavaParamRef<jobject>& obj, | 48 const base::android::JavaParamRef<jobject>& obj, |
| 49 const base::android::JavaParamRef<jstring>& j_text); | 49 const base::android::JavaParamRef<jstring>& j_text); |
| 50 void OnOmniboxFocused( | 50 void OnOmniboxFocused( |
| 51 JNIEnv* env, | 51 JNIEnv* env, |
| 52 const base::android::JavaParamRef<jobject>& obj, | 52 const base::android::JavaParamRef<jobject>& obj, |
| 53 const base::android::JavaParamRef<jstring>& j_omnibox_text, | 53 const base::android::JavaParamRef<jstring>& j_omnibox_text, |
| 54 const base::android::JavaParamRef<jstring>& j_current_url, | 54 const base::android::JavaParamRef<jstring>& j_current_url, |
| 55 jboolean is_query_in_omnibox, | |
| 56 jboolean focused_from_fakebox); | 55 jboolean focused_from_fakebox); |
| 57 void Stop(JNIEnv* env, | 56 void Stop(JNIEnv* env, |
| 58 const base::android::JavaParamRef<jobject>& obj, | 57 const base::android::JavaParamRef<jobject>& obj, |
| 59 bool clear_result); | 58 bool clear_result); |
| 60 void ResetSession(JNIEnv* env, | 59 void ResetSession(JNIEnv* env, |
| 61 const base::android::JavaParamRef<jobject>& obj); | 60 const base::android::JavaParamRef<jobject>& obj); |
| 62 void OnSuggestionSelected( | 61 void OnSuggestionSelected( |
| 63 JNIEnv* env, | 62 JNIEnv* env, |
| 64 const base::android::JavaParamRef<jobject>& obj, | 63 const base::android::JavaParamRef<jobject>& obj, |
| 65 jint selected_index, | 64 jint selected_index, |
| 66 const base::android::JavaParamRef<jstring>& j_current_url, | 65 const base::android::JavaParamRef<jstring>& j_current_url, |
| 67 jboolean is_query_in_omnibox, | |
| 68 jboolean focused_from_fakebox, | 66 jboolean focused_from_fakebox, |
| 69 jlong elapsed_time_since_first_modified, | 67 jlong elapsed_time_since_first_modified, |
| 70 jint completed_length, | 68 jint completed_length, |
| 71 const base::android::JavaParamRef<jobject>& j_web_contents); | 69 const base::android::JavaParamRef<jobject>& j_web_contents); |
| 72 void DeleteSuggestion(JNIEnv* env, | 70 void DeleteSuggestion(JNIEnv* env, |
| 73 const base::android::JavaParamRef<jobject>& obj, | 71 const base::android::JavaParamRef<jobject>& obj, |
| 74 int selected_index); | 72 int selected_index); |
| 75 base::android::ScopedJavaLocalRef<jstring> | 73 base::android::ScopedJavaLocalRef<jstring> |
| 76 UpdateMatchDestinationURLWithQueryFormulationTime( | 74 UpdateMatchDestinationURLWithQueryFormulationTime( |
| 77 JNIEnv* env, | 75 JNIEnv* env, |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 113 void OnResultChanged(bool default_match_changed) override; | 111 void OnResultChanged(bool default_match_changed) override; |
| 114 | 112 |
| 115 // Notifies the Java AutocompleteController that suggestions were received | 113 // Notifies the Java AutocompleteController that suggestions were received |
| 116 // based on the text the user typed in last. | 114 // based on the text the user typed in last. |
| 117 void NotifySuggestionsReceived( | 115 void NotifySuggestionsReceived( |
| 118 const AutocompleteResult& autocomplete_result); | 116 const AutocompleteResult& autocomplete_result); |
| 119 | 117 |
| 120 // Classifies the type of page we are on. | 118 // Classifies the type of page we are on. |
| 121 metrics::OmniboxEventProto::PageClassification ClassifyPage( | 119 metrics::OmniboxEventProto::PageClassification ClassifyPage( |
| 122 const GURL& gurl, | 120 const GURL& gurl, |
| 123 bool is_query_in_omnibox, | |
| 124 bool focused_from_fakebox) const; | 121 bool focused_from_fakebox) const; |
| 125 | 122 |
| 126 base::android::ScopedJavaLocalRef<jobject> BuildOmniboxSuggestion( | 123 base::android::ScopedJavaLocalRef<jobject> BuildOmniboxSuggestion( |
| 127 JNIEnv* env, const AutocompleteMatch& match); | 124 JNIEnv* env, const AutocompleteMatch& match); |
| 128 | 125 |
| 129 // A helper method for fetching the top synchronous autocomplete result. | 126 // A helper method for fetching the top synchronous autocomplete result. |
| 130 // The |prevent_inline_autocomplete| flag is passed to the AutocompleteInput | 127 // The |prevent_inline_autocomplete| flag is passed to the AutocompleteInput |
| 131 // object, see documentation there for its description. | 128 // object, see documentation there for its description. |
| 132 base::android::ScopedJavaLocalRef<jobject> GetTopSynchronousResult( | 129 base::android::ScopedJavaLocalRef<jobject> GetTopSynchronousResult( |
| 133 JNIEnv* env, | 130 JNIEnv* env, |
| (...skipping 13 matching lines...) Expand all Loading... |
| 147 JavaObjectWeakGlobalRef weak_java_autocomplete_controller_android_; | 144 JavaObjectWeakGlobalRef weak_java_autocomplete_controller_android_; |
| 148 Profile* profile_; | 145 Profile* profile_; |
| 149 | 146 |
| 150 DISALLOW_COPY_AND_ASSIGN(AutocompleteControllerAndroid); | 147 DISALLOW_COPY_AND_ASSIGN(AutocompleteControllerAndroid); |
| 151 }; | 148 }; |
| 152 | 149 |
| 153 // Registers the LocationBar native method. | 150 // Registers the LocationBar native method. |
| 154 bool RegisterAutocompleteControllerAndroid(JNIEnv* env); | 151 bool RegisterAutocompleteControllerAndroid(JNIEnv* env); |
| 155 | 152 |
| 156 #endif // CHROME_BROWSER_ANDROID_OMNIBOX_AUTOCOMPLETE_CONTROLLER_ANDROID_H_ | 153 #endif // CHROME_BROWSER_ANDROID_OMNIBOX_AUTOCOMPLETE_CONTROLLER_ANDROID_H_ |
| OLD | NEW |