| 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 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 42 void DiscardSnippet(JNIEnv* env, | 42 void DiscardSnippet(JNIEnv* env, |
| 43 const base::android::JavaParamRef<jobject>& obj, | 43 const base::android::JavaParamRef<jobject>& obj, |
| 44 const base::android::JavaParamRef<jstring>& snippet_id); | 44 const base::android::JavaParamRef<jstring>& snippet_id); |
| 45 | 45 |
| 46 // Checks if the URL has been visited. | 46 // Checks if the URL has been visited. |
| 47 void SnippetVisited(JNIEnv* env, | 47 void SnippetVisited(JNIEnv* env, |
| 48 const base::android::JavaParamRef<jobject>& obj, | 48 const base::android::JavaParamRef<jobject>& obj, |
| 49 const base::android::JavaParamRef<jobject>& callback, | 49 const base::android::JavaParamRef<jobject>& callback, |
| 50 const base::android::JavaParamRef<jstring>& jurl); | 50 const base::android::JavaParamRef<jstring>& jurl); |
| 51 | 51 |
| 52 // Returns the status of the ARTICLES category. | 52 // Returns the status of |category|. |
| 53 // See ContentSuggestionsCategoryStatus for more info. | 53 // See ContentSuggestionsCategoryStatus for more info. |
| 54 int GetCategoryStatus(JNIEnv* env, | 54 int GetCategoryStatus(JNIEnv* env, |
| 55 const base::android::JavaParamRef<jobject>& obj); | 55 const base::android::JavaParamRef<jobject>& obj, |
| 56 jint category); |
| 56 | 57 |
| 57 static bool Register(JNIEnv* env); | 58 static bool Register(JNIEnv* env); |
| 58 | 59 |
| 59 private: | 60 private: |
| 60 ~NTPSnippetsBridge() override; | 61 ~NTPSnippetsBridge() override; |
| 61 | 62 |
| 62 // ContentSuggestionsService::Observer overrides | 63 // ContentSuggestionsService::Observer overrides |
| 63 void OnNewSuggestions() override; | 64 void OnNewSuggestions() override; |
| 64 void OnCategoryStatusChanged( | 65 void OnCategoryStatusChanged( |
| 65 ntp_snippets::ContentSuggestionsCategory category, | 66 ntp_snippets::ContentSuggestionsCategory category, |
| (...skipping 14 matching lines...) Expand all Loading... |
| 80 | 81 |
| 81 // Used to notify the Java side when new snippets have been fetched. | 82 // Used to notify the Java side when new snippets have been fetched. |
| 82 base::android::ScopedJavaGlobalRef<jobject> observer_; | 83 base::android::ScopedJavaGlobalRef<jobject> observer_; |
| 83 | 84 |
| 84 base::WeakPtrFactory<NTPSnippetsBridge> weak_ptr_factory_; | 85 base::WeakPtrFactory<NTPSnippetsBridge> weak_ptr_factory_; |
| 85 | 86 |
| 86 DISALLOW_COPY_AND_ASSIGN(NTPSnippetsBridge); | 87 DISALLOW_COPY_AND_ASSIGN(NTPSnippetsBridge); |
| 87 }; | 88 }; |
| 88 | 89 |
| 89 #endif // CHROME_BROWSER_ANDROID_NTP_NTP_SNIPPETS_BRIDGE_H_ | 90 #endif // CHROME_BROWSER_ANDROID_NTP_NTP_SNIPPETS_BRIDGE_H_ |
| OLD | NEW |