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 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
142 void OnFullRefreshRequired() override; | 142 void OnFullRefreshRequired() override; |
143 void ContentSuggestionsServiceShutdown() override; | 143 void ContentSuggestionsServiceShutdown() override; |
144 | 144 |
145 void OnImageFetched(base::android::ScopedJavaGlobalRef<jobject> callback, | 145 void OnImageFetched(base::android::ScopedJavaGlobalRef<jobject> callback, |
146 const gfx::Image& image); | 146 const gfx::Image& image); |
147 void OnSuggestionsFetched( | 147 void OnSuggestionsFetched( |
148 ntp_snippets::Category category, | 148 ntp_snippets::Category category, |
149 ntp_snippets::Status status, | 149 ntp_snippets::Status status, |
150 std::vector<ntp_snippets::ContentSuggestion> suggestions); | 150 std::vector<ntp_snippets::ContentSuggestion> suggestions); |
151 | 151 |
152 ntp_snippets::Category CategoryFromIDValue(jint id); | |
153 | |
154 ntp_snippets::ContentSuggestionsService* content_suggestions_service_; | 152 ntp_snippets::ContentSuggestionsService* content_suggestions_service_; |
155 history::HistoryService* history_service_; | 153 history::HistoryService* history_service_; |
156 base::CancelableTaskTracker tracker_; | 154 base::CancelableTaskTracker tracker_; |
157 | 155 |
158 ScopedObserver<ntp_snippets::ContentSuggestionsService, | 156 ScopedObserver<ntp_snippets::ContentSuggestionsService, |
159 ntp_snippets::ContentSuggestionsService::Observer> | 157 ntp_snippets::ContentSuggestionsService::Observer> |
160 content_suggestions_service_observer_; | 158 content_suggestions_service_observer_; |
161 | 159 |
162 // Used to notify the Java side when new snippets have been fetched. | 160 // Used to notify the Java side when new snippets have been fetched. |
163 base::android::ScopedJavaGlobalRef<jobject> observer_; | 161 base::android::ScopedJavaGlobalRef<jobject> observer_; |
164 | 162 |
165 base::WeakPtrFactory<NTPSnippetsBridge> weak_ptr_factory_; | 163 base::WeakPtrFactory<NTPSnippetsBridge> weak_ptr_factory_; |
166 | 164 |
167 DISALLOW_COPY_AND_ASSIGN(NTPSnippetsBridge); | 165 DISALLOW_COPY_AND_ASSIGN(NTPSnippetsBridge); |
168 }; | 166 }; |
169 | 167 |
170 #endif // CHROME_BROWSER_ANDROID_NTP_NTP_SNIPPETS_BRIDGE_H_ | 168 #endif // CHROME_BROWSER_ANDROID_NTP_NTP_SNIPPETS_BRIDGE_H_ |
OLD | NEW |