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 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
124 void OnMoreButtonShown(JNIEnv* env, | 124 void OnMoreButtonShown(JNIEnv* env, |
125 const base::android::JavaParamRef<jobject>& obj, | 125 const base::android::JavaParamRef<jobject>& obj, |
126 jint j_category_id, | 126 jint j_category_id, |
127 jint position); | 127 jint position); |
128 | 128 |
129 void OnMoreButtonClicked(JNIEnv* env, | 129 void OnMoreButtonClicked(JNIEnv* env, |
130 const base::android::JavaParamRef<jobject>& obj, | 130 const base::android::JavaParamRef<jobject>& obj, |
131 jint j_category_id, | 131 jint j_category_id, |
132 jint position); | 132 jint position); |
133 | 133 |
| 134 void OnBrowserStarted(JNIEnv* env, |
| 135 const base::android::JavaParamRef<jobject>& obj); |
| 136 |
134 static bool Register(JNIEnv* env); | 137 static bool Register(JNIEnv* env); |
135 | 138 |
136 private: | 139 private: |
137 ~NTPSnippetsBridge() override; | 140 ~NTPSnippetsBridge() override; |
138 | 141 |
139 // ContentSuggestionsService::Observer overrides | 142 // ContentSuggestionsService::Observer overrides |
140 void OnNewSuggestions(ntp_snippets::Category category) override; | 143 void OnNewSuggestions(ntp_snippets::Category category) override; |
141 void OnCategoryStatusChanged( | 144 void OnCategoryStatusChanged( |
142 ntp_snippets::Category category, | 145 ntp_snippets::Category category, |
143 ntp_snippets::CategoryStatus new_status) override; | 146 ntp_snippets::CategoryStatus new_status) override; |
(...skipping 19 matching lines...) Expand all Loading... |
163 | 166 |
164 // Used to notify the Java side when new snippets have been fetched. | 167 // Used to notify the Java side when new snippets have been fetched. |
165 base::android::ScopedJavaGlobalRef<jobject> observer_; | 168 base::android::ScopedJavaGlobalRef<jobject> observer_; |
166 | 169 |
167 base::WeakPtrFactory<NTPSnippetsBridge> weak_ptr_factory_; | 170 base::WeakPtrFactory<NTPSnippetsBridge> weak_ptr_factory_; |
168 | 171 |
169 DISALLOW_COPY_AND_ASSIGN(NTPSnippetsBridge); | 172 DISALLOW_COPY_AND_ASSIGN(NTPSnippetsBridge); |
170 }; | 173 }; |
171 | 174 |
172 #endif // CHROME_BROWSER_ANDROID_NTP_NTP_SNIPPETS_BRIDGE_H_ | 175 #endif // CHROME_BROWSER_ANDROID_NTP_NTP_SNIPPETS_BRIDGE_H_ |
OLD | NEW |