OLD | NEW |
---|---|
(Empty) | |
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 | |
3 // found in the LICENSE file. | |
4 | |
5 #ifndef CHROME_BROWSER_ANDROID_NTP_SNIPPETS_BRIDGE_H_ | |
6 #define CHROME_BROWSER_ANDROID_NTP_SNIPPETS_BRIDGE_H_ | |
7 | |
8 #include <jni.h> | |
9 | |
10 #include "base/android/scoped_java_ref.h" | |
11 #include "components/ntp_snippets/ntp_snippets_service.h" | |
12 | |
13 namespace ntp_snippets { | |
Bernhard Bauer
2016/02/08 18:19:26
Why the namespace? (For things in //chrome, you do
May
2016/02/09 17:38:53
Done.
| |
14 | |
15 class NTPSnippetsService; | |
Bernhard Bauer
2016/02/08 18:19:26
This isn't necessary if you include the header fil
May
2016/02/09 17:38:53
Done.
| |
16 | |
17 // The C++ counterpart to NTPSnippetsBridge.java. Enables Java code to access | |
18 // the list of snippets to show on the NTP | |
19 class NTPSnippetsBridge : public NTPSnippetsServiceObserver { | |
20 public: | |
21 explicit NTPSnippetsBridge(jobject j_profile); | |
22 void Destroy(JNIEnv* env, const base::android::JavaParamRef<jobject>& obj); | |
23 void SetSnippetsObserver( | |
24 JNIEnv* env, | |
25 const base::android::JavaParamRef<jobject>& obj, | |
26 const base::android::JavaParamRef<jobject>& j_observer); | |
27 | |
28 // NTPSnippetsServiceObserver overrides | |
29 void NTPSnippetsServiceLoaded(NTPSnippetsService* service) override; | |
30 void NTPSnippetsServiceShutdown(NTPSnippetsService* service) override; | |
Marc Treib
2016/02/09 09:17:54
I think these can be private
May
2016/02/09 17:38:53
Done.
| |
31 | |
32 private: | |
33 ~NTPSnippetsBridge(); | |
34 | |
35 NTPSnippetsService* ntp_snippets_service_; | |
36 | |
37 base::android::ScopedJavaGlobalRef<jobject> observer_; | |
38 | |
39 DISALLOW_COPY_AND_ASSIGN(NTPSnippetsBridge); | |
40 }; | |
41 | |
42 bool RegisterNTPSnippetsBridge(JNIEnv* env); | |
Bernhard Bauer
2016/02/08 18:19:26
Make this a static class method?
May
2016/02/09 17:38:53
Done.
| |
43 | |
44 } // namespace ntp_snippets | |
45 | |
46 #endif // CHROME_BROWSER_ANDROID_NTP_SNIPPETS_BRIDGE_H_ | |
OLD | NEW |