| 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 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 68 jobject obj, | 68 jobject obj, |
| 69 jint selected_index, | 69 jint selected_index, |
| 70 jlong elapsed_time_since_input_change); | 70 jlong elapsed_time_since_input_change); |
| 71 | 71 |
| 72 base::android::ScopedJavaLocalRef<jobject> GetTopSynchronousMatch( | 72 base::android::ScopedJavaLocalRef<jobject> GetTopSynchronousMatch( |
| 73 JNIEnv* env, | 73 JNIEnv* env, |
| 74 jobject obj, | 74 jobject obj, |
| 75 jstring query); | 75 jstring query); |
| 76 | 76 |
| 77 // KeyedService: | 77 // KeyedService: |
| 78 virtual void Shutdown() OVERRIDE; | 78 virtual void Shutdown() override; |
| 79 | 79 |
| 80 class Factory : public BrowserContextKeyedServiceFactory { | 80 class Factory : public BrowserContextKeyedServiceFactory { |
| 81 public: | 81 public: |
| 82 static AutocompleteControllerAndroid* GetForProfile(Profile* profile, | 82 static AutocompleteControllerAndroid* GetForProfile(Profile* profile, |
| 83 JNIEnv* env, | 83 JNIEnv* env, |
| 84 jobject obj); | 84 jobject obj); |
| 85 | 85 |
| 86 static Factory* GetInstance(); | 86 static Factory* GetInstance(); |
| 87 | 87 |
| 88 protected: | 88 protected: |
| 89 virtual content::BrowserContext* GetBrowserContextToUse( | 89 virtual content::BrowserContext* GetBrowserContextToUse( |
| 90 content::BrowserContext* context) const OVERRIDE; | 90 content::BrowserContext* context) const override; |
| 91 | 91 |
| 92 private: | 92 private: |
| 93 friend struct DefaultSingletonTraits<Factory>; | 93 friend struct DefaultSingletonTraits<Factory>; |
| 94 | 94 |
| 95 Factory(); | 95 Factory(); |
| 96 virtual ~Factory(); | 96 virtual ~Factory(); |
| 97 | 97 |
| 98 // BrowserContextKeyedServiceFactory | 98 // BrowserContextKeyedServiceFactory |
| 99 virtual KeyedService* BuildServiceInstanceFor( | 99 virtual KeyedService* BuildServiceInstanceFor( |
| 100 content::BrowserContext* profile) const OVERRIDE; | 100 content::BrowserContext* profile) const override; |
| 101 }; | 101 }; |
| 102 | 102 |
| 103 private: | 103 private: |
| 104 virtual ~AutocompleteControllerAndroid(); | 104 virtual ~AutocompleteControllerAndroid(); |
| 105 void InitJNI(JNIEnv* env, jobject obj); | 105 void InitJNI(JNIEnv* env, jobject obj); |
| 106 | 106 |
| 107 // AutocompleteControllerDelegate implementation. | 107 // AutocompleteControllerDelegate implementation. |
| 108 virtual void OnResultChanged(bool default_match_changed) OVERRIDE; | 108 virtual void OnResultChanged(bool default_match_changed) override; |
| 109 | 109 |
| 110 // Notifies the Java AutocompleteController that suggestions were received | 110 // Notifies the Java AutocompleteController that suggestions were received |
| 111 // based on the text the user typed in last. | 111 // based on the text the user typed in last. |
| 112 void NotifySuggestionsReceived( | 112 void NotifySuggestionsReceived( |
| 113 const AutocompleteResult& autocomplete_result); | 113 const AutocompleteResult& autocomplete_result); |
| 114 | 114 |
| 115 // Classifies the type of page we are on. | 115 // Classifies the type of page we are on. |
| 116 metrics::OmniboxEventProto::PageClassification ClassifyPage( | 116 metrics::OmniboxEventProto::PageClassification ClassifyPage( |
| 117 const GURL& gurl, | 117 const GURL& gurl, |
| 118 bool is_query_in_omnibox, | 118 bool is_query_in_omnibox, |
| (...skipping 28 matching lines...) Expand all Loading... |
| 147 JavaObjectWeakGlobalRef weak_java_autocomplete_controller_android_; | 147 JavaObjectWeakGlobalRef weak_java_autocomplete_controller_android_; |
| 148 Profile* profile_; | 148 Profile* profile_; |
| 149 | 149 |
| 150 DISALLOW_COPY_AND_ASSIGN(AutocompleteControllerAndroid); | 150 DISALLOW_COPY_AND_ASSIGN(AutocompleteControllerAndroid); |
| 151 }; | 151 }; |
| 152 | 152 |
| 153 // Registers the LocationBar native method. | 153 // Registers the LocationBar native method. |
| 154 bool RegisterAutocompleteControllerAndroid(JNIEnv* env); | 154 bool RegisterAutocompleteControllerAndroid(JNIEnv* env); |
| 155 | 155 |
| 156 #endif // CHROME_BROWSER_ANDROID_OMNIBOX_AUTOCOMPLETE_CONTROLLER_ANDROID_H_ | 156 #endif // CHROME_BROWSER_ANDROID_OMNIBOX_AUTOCOMPLETE_CONTROLLER_ANDROID_H_ |
| OLD | NEW |