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 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
88 const base::android::JavaParamRef<jstring>& id_within_category); | 88 const base::android::JavaParamRef<jstring>& id_within_category); |
89 | 89 |
90 void DismissCategory(JNIEnv* env, | 90 void DismissCategory(JNIEnv* env, |
91 const base::android::JavaParamRef<jobject>& obj, | 91 const base::android::JavaParamRef<jobject>& obj, |
92 jint j_category_id); | 92 jint j_category_id); |
93 | 93 |
94 void RestoreDismissedCategories( | 94 void RestoreDismissedCategories( |
95 JNIEnv* env, | 95 JNIEnv* env, |
96 const base::android::JavaParamRef<jobject>& obj); | 96 const base::android::JavaParamRef<jobject>& obj); |
97 | 97 |
98 void OnPageShown( | |
99 JNIEnv* env, | |
100 const base::android::JavaParamRef<jobject>& obj, | |
101 const base::android::JavaParamRef<jintArray>& jcategories, | |
102 const base::android::JavaParamRef<jintArray>& jsuggestions_per_category); | |
103 | |
104 void OnSuggestionShown(JNIEnv* env, | |
105 const base::android::JavaParamRef<jobject>& obj, | |
106 jint global_position, | |
107 jint j_category_id, | |
108 jint position_in_category, | |
109 jlong publish_timestamp_ms, | |
110 jfloat score, | |
111 jlong fetch_timestamp_ms); | |
112 | |
113 void OnSuggestionOpened(JNIEnv* env, | |
114 const base::android::JavaParamRef<jobject>& obj, | |
115 jint global_position, | |
116 jint j_category_id, | |
117 jint category_index, | |
118 jint position_in_category, | |
119 jlong publish_timestamp_ms, | |
120 jfloat score, | |
121 int windowOpenDisposition); | |
122 | |
123 void OnSuggestionMenuOpened(JNIEnv* env, | |
124 const base::android::JavaParamRef<jobject>& obj, | |
125 jint global_position, | |
126 jint j_category_id, | |
127 jint position_in_category, | |
128 jlong publish_timestamp_ms, | |
129 jfloat score); | |
130 | |
131 void OnMoreButtonShown(JNIEnv* env, | |
132 const base::android::JavaParamRef<jobject>& obj, | |
133 jint j_category_id, | |
134 jint position); | |
135 | |
136 void OnMoreButtonClicked(JNIEnv* env, | |
137 const base::android::JavaParamRef<jobject>& obj, | |
138 jint j_category_id, | |
139 jint position); | |
140 | |
141 void OnNTPInitialized(JNIEnv* env, | |
142 const base::android::JavaParamRef<jobject>& obj); | |
143 void OnColdStart(JNIEnv* env, | |
144 const base::android::JavaParamRef<jobject>& obj); | |
145 void OnActivityWarmResumed(JNIEnv* env, | |
146 const base::android::JavaParamRef<jobject>& obj); | |
147 | |
148 static bool Register(JNIEnv* env); | 98 static bool Register(JNIEnv* env); |
149 | 99 |
150 private: | 100 private: |
151 ~NTPSnippetsBridge() override; | 101 ~NTPSnippetsBridge() override; |
152 | 102 |
153 // ContentSuggestionsService::Observer overrides | 103 // ContentSuggestionsService::Observer overrides |
154 void OnNewSuggestions(ntp_snippets::Category category) override; | 104 void OnNewSuggestions(ntp_snippets::Category category) override; |
155 void OnCategoryStatusChanged( | 105 void OnCategoryStatusChanged( |
156 ntp_snippets::Category category, | 106 ntp_snippets::Category category, |
157 ntp_snippets::CategoryStatus new_status) override; | 107 ntp_snippets::CategoryStatus new_status) override; |
(...skipping 19 matching lines...) Expand all Loading... |
177 | 127 |
178 // The Java SnippetsBridge. | 128 // The Java SnippetsBridge. |
179 base::android::ScopedJavaGlobalRef<jobject> bridge_; | 129 base::android::ScopedJavaGlobalRef<jobject> bridge_; |
180 | 130 |
181 base::WeakPtrFactory<NTPSnippetsBridge> weak_ptr_factory_; | 131 base::WeakPtrFactory<NTPSnippetsBridge> weak_ptr_factory_; |
182 | 132 |
183 DISALLOW_COPY_AND_ASSIGN(NTPSnippetsBridge); | 133 DISALLOW_COPY_AND_ASSIGN(NTPSnippetsBridge); |
184 }; | 134 }; |
185 | 135 |
186 #endif // CHROME_BROWSER_ANDROID_NTP_NTP_SNIPPETS_BRIDGE_H_ | 136 #endif // CHROME_BROWSER_ANDROID_NTP_NTP_SNIPPETS_BRIDGE_H_ |
OLD | NEW |