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 16 matching lines...) Expand all Loading... |
27 void DiscardSnippet(JNIEnv* env, | 27 void DiscardSnippet(JNIEnv* env, |
28 const base::android::JavaParamRef<jobject>& obj, | 28 const base::android::JavaParamRef<jobject>& obj, |
29 const base::android::JavaParamRef<jstring>& url); | 29 const base::android::JavaParamRef<jstring>& url); |
30 | 30 |
31 static bool Register(JNIEnv* env); | 31 static bool Register(JNIEnv* env); |
32 | 32 |
33 private: | 33 private: |
34 ~NTPSnippetsBridge() override; | 34 ~NTPSnippetsBridge() override; |
35 | 35 |
36 // NTPSnippetsServiceObserver overrides | 36 // NTPSnippetsServiceObserver overrides |
37 void NTPSnippetsServiceLoaded( | 37 void NTPSnippetsServiceLoaded() override; |
38 ntp_snippets::NTPSnippetsService* service) override; | 38 void NTPSnippetsServiceShutdown() override; |
39 void NTPSnippetsServiceShutdown( | |
40 ntp_snippets::NTPSnippetsService* service) override; | |
41 | 39 |
42 ntp_snippets::NTPSnippetsService* ntp_snippets_service_; | 40 ntp_snippets::NTPSnippetsService* ntp_snippets_service_; |
43 | 41 |
44 // Used to notify the Java side when new snippets have been fetched. | 42 // Used to notify the Java side when new snippets have been fetched. |
45 base::android::ScopedJavaGlobalRef<jobject> observer_; | 43 base::android::ScopedJavaGlobalRef<jobject> observer_; |
46 ScopedObserver<ntp_snippets::NTPSnippetsService, | 44 ScopedObserver<ntp_snippets::NTPSnippetsService, |
47 ntp_snippets::NTPSnippetsServiceObserver> | 45 ntp_snippets::NTPSnippetsServiceObserver> |
48 snippet_service_observer_; | 46 snippet_service_observer_; |
49 | 47 |
50 DISALLOW_COPY_AND_ASSIGN(NTPSnippetsBridge); | 48 DISALLOW_COPY_AND_ASSIGN(NTPSnippetsBridge); |
51 }; | 49 }; |
52 | 50 |
53 #endif // CHROME_BROWSER_ANDROID_NTP_NTP_SNIPPETS_BRIDGE_H_ | 51 #endif // CHROME_BROWSER_ANDROID_NTP_NTP_SNIPPETS_BRIDGE_H_ |
OLD | NEW |