| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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_NTP_NTP_SNIPPETS_BRIDGE_H_ | 5 #ifndef CHROME_BROWSER_ANDROID_NTP_NTP_SNIPPETS_BRIDGE_H_ |
| 6 #define CHROME_BROWSER_ANDROID_NTP_NTP_SNIPPETS_BRIDGE_H_ | 6 #define CHROME_BROWSER_ANDROID_NTP_NTP_SNIPPETS_BRIDGE_H_ |
| 7 | 7 |
| 8 #include <jni.h> | 8 #include <jni.h> |
| 9 | 9 |
| 10 #include "base/android/scoped_java_ref.h" | 10 #include "base/android/scoped_java_ref.h" |
| (...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 120 void OnMoreButtonShown(JNIEnv* env, | 120 void OnMoreButtonShown(JNIEnv* env, |
| 121 const base::android::JavaParamRef<jobject>& obj, | 121 const base::android::JavaParamRef<jobject>& obj, |
| 122 jint j_category_id, | 122 jint j_category_id, |
| 123 jint position); | 123 jint position); |
| 124 | 124 |
| 125 void OnMoreButtonClicked(JNIEnv* env, | 125 void OnMoreButtonClicked(JNIEnv* env, |
| 126 const base::android::JavaParamRef<jobject>& obj, | 126 const base::android::JavaParamRef<jobject>& obj, |
| 127 jint j_category_id, | 127 jint j_category_id, |
| 128 jint position); | 128 jint position); |
| 129 | 129 |
| 130 void OnNTPOpened(JNIEnv* env, |
| 131 const base::android::JavaParamRef<jobject>& obj); |
| 132 |
| 130 static bool Register(JNIEnv* env); | 133 static bool Register(JNIEnv* env); |
| 131 | 134 |
| 132 private: | 135 private: |
| 133 ~NTPSnippetsBridge() override; | 136 ~NTPSnippetsBridge() override; |
| 134 | 137 |
| 135 // ContentSuggestionsService::Observer overrides | 138 // ContentSuggestionsService::Observer overrides |
| 136 void OnNewSuggestions(ntp_snippets::Category category) override; | 139 void OnNewSuggestions(ntp_snippets::Category category) override; |
| 137 void OnCategoryStatusChanged( | 140 void OnCategoryStatusChanged( |
| 138 ntp_snippets::Category category, | 141 ntp_snippets::Category category, |
| 139 ntp_snippets::CategoryStatus new_status) override; | 142 ntp_snippets::CategoryStatus new_status) override; |
| (...skipping 19 matching lines...) Expand all Loading... |
| 159 | 162 |
| 160 // Used to notify the Java side when new snippets have been fetched. | 163 // Used to notify the Java side when new snippets have been fetched. |
| 161 base::android::ScopedJavaGlobalRef<jobject> observer_; | 164 base::android::ScopedJavaGlobalRef<jobject> observer_; |
| 162 | 165 |
| 163 base::WeakPtrFactory<NTPSnippetsBridge> weak_ptr_factory_; | 166 base::WeakPtrFactory<NTPSnippetsBridge> weak_ptr_factory_; |
| 164 | 167 |
| 165 DISALLOW_COPY_AND_ASSIGN(NTPSnippetsBridge); | 168 DISALLOW_COPY_AND_ASSIGN(NTPSnippetsBridge); |
| 166 }; | 169 }; |
| 167 | 170 |
| 168 #endif // CHROME_BROWSER_ANDROID_NTP_NTP_SNIPPETS_BRIDGE_H_ | 171 #endif // CHROME_BROWSER_ANDROID_NTP_NTP_SNIPPETS_BRIDGE_H_ |
| OLD | NEW |