| 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 <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/android/jni_weak_ref.h" | 10 #include "base/android/jni_weak_ref.h" |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 60 jboolean focused_from_fakebox, | 60 jboolean focused_from_fakebox, |
| 61 jlong elapsed_time_since_first_modified, | 61 jlong elapsed_time_since_first_modified, |
| 62 jobject j_web_contents); | 62 jobject j_web_contents); |
| 63 void DeleteSuggestion(JNIEnv* env, jobject obj, int selected_index); | 63 void DeleteSuggestion(JNIEnv* env, jobject obj, int selected_index); |
| 64 base::android::ScopedJavaLocalRef<jstring> UpdateMatchDestinationURL( | 64 base::android::ScopedJavaLocalRef<jstring> UpdateMatchDestinationURL( |
| 65 JNIEnv* env, | 65 JNIEnv* env, |
| 66 jobject obj, | 66 jobject obj, |
| 67 jint selected_index, | 67 jint selected_index, |
| 68 jlong elapsed_time_since_input_change); | 68 jlong elapsed_time_since_input_change); |
| 69 | 69 |
| 70 base::android::ScopedJavaLocalRef<jobject> GetTopSynchronousMatch( |
| 71 JNIEnv* env, |
| 72 jobject obj, |
| 73 jstring query); |
| 74 |
| 70 // KeyedService: | 75 // KeyedService: |
| 71 virtual void Shutdown() OVERRIDE; | 76 virtual void Shutdown() OVERRIDE; |
| 72 | 77 |
| 73 class Factory : public BrowserContextKeyedServiceFactory { | 78 class Factory : public BrowserContextKeyedServiceFactory { |
| 74 public: | 79 public: |
| 75 static AutocompleteControllerAndroid* GetForProfile(Profile* profile, | 80 static AutocompleteControllerAndroid* GetForProfile(Profile* profile, |
| 76 JNIEnv* env, | 81 JNIEnv* env, |
| 77 jobject obj); | 82 jobject obj); |
| 78 | 83 |
| 79 static Factory* GetInstance(); | 84 static Factory* GetInstance(); |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 117 // Converts destination_url (which is in its canonical form or punycode) to a | 122 // Converts destination_url (which is in its canonical form or punycode) to a |
| 118 // user-friendly URL by looking up accept languages of the current profile. | 123 // user-friendly URL by looking up accept languages of the current profile. |
| 119 // e.g. http://xn--6q8b.kr/ --> 한.kr | 124 // e.g. http://xn--6q8b.kr/ --> 한.kr |
| 120 base::string16 FormatURLUsingAcceptLanguages(GURL url); | 125 base::string16 FormatURLUsingAcceptLanguages(GURL url); |
| 121 | 126 |
| 122 scoped_ptr<AutocompleteController> autocomplete_controller_; | 127 scoped_ptr<AutocompleteController> autocomplete_controller_; |
| 123 | 128 |
| 124 // Last input we sent to the autocomplete controller. | 129 // Last input we sent to the autocomplete controller. |
| 125 AutocompleteInput input_; | 130 AutocompleteInput input_; |
| 126 | 131 |
| 127 // Whether we're currently inside a call to Classify(). | 132 // Whether we're currently inside a call to Start() that's called |
| 128 bool inside_classify_; | 133 // for Classify() or GetTopSynchronousMatch() |
| 134 bool inside_synchronous_start_; |
| 129 | 135 |
| 130 JavaObjectWeakGlobalRef weak_java_autocomplete_controller_android_; | 136 JavaObjectWeakGlobalRef weak_java_autocomplete_controller_android_; |
| 131 Profile* profile_; | 137 Profile* profile_; |
| 132 | 138 |
| 133 DISALLOW_COPY_AND_ASSIGN(AutocompleteControllerAndroid); | 139 DISALLOW_COPY_AND_ASSIGN(AutocompleteControllerAndroid); |
| 134 }; | 140 }; |
| 135 | 141 |
| 136 // Registers the LocationBar native method. | 142 // Registers the LocationBar native method. |
| 137 bool RegisterAutocompleteControllerAndroid(JNIEnv* env); | 143 bool RegisterAutocompleteControllerAndroid(JNIEnv* env); |
| 138 | 144 |
| 139 #endif // CHROME_BROWSER_ANDROID_OMNIBOX_AUTOCOMPLETE_CONTROLLER_ANDROID_H_ | 145 #endif // CHROME_BROWSER_ANDROID_OMNIBOX_AUTOCOMPLETE_CONTROLLER_ANDROID_H_ |
| OLD | NEW |