Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(113)

Unified Diff: chrome/browser/android/ntp/ntp_snippets_bridge.cc

Issue 2061803002: 📰 The Status card reports disabled sync states (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@simplifyBridge
Patch Set: yolo: another big bag of changes Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/android/ntp/ntp_snippets_bridge.cc
diff --git a/chrome/browser/android/ntp/ntp_snippets_bridge.cc b/chrome/browser/android/ntp/ntp_snippets_bridge.cc
index 6f006fd80a7fc5c8b0af877601d5f9cf65c96c06..e6e9cddcabc6b6cd4be5747c33f3e1f74a292eb0 100644
--- a/chrome/browser/android/ntp/ntp_snippets_bridge.cc
+++ b/chrome/browser/android/ntp/ntp_snippets_bridge.cc
@@ -118,6 +118,11 @@ void NTPSnippetsBridge::SnippetVisited(JNIEnv* env,
&tracker_);
}
+int NTPSnippetsBridge::GetDisabledReason(JNIEnv* env,
+ const JavaParamRef<jobject>& obj) {
+ return static_cast<int>(ntp_snippets_service_->disabled_reason());
+}
+
NTPSnippetsBridge::~NTPSnippetsBridge() {}
void NTPSnippetsBridge::NTPSnippetsServiceLoaded() {
@@ -170,11 +175,13 @@ void NTPSnippetsBridge::NTPSnippetsServiceShutdown() {
snippet_service_observer_.Remove(ntp_snippets_service_);
}
-void NTPSnippetsBridge::NTPSnippetsServiceDisabled() {
+void NTPSnippetsBridge::NTPSnippetsServiceDisabledReasonChanged(
+ ntp_snippets::DisabledReason disabled_reason) {
// The user signed out or disabled sync. Since snippets rely on those, we
// clear them to be consistent with the initially signed out state.
JNIEnv* env = base::android::AttachCurrentThread();
- Java_SnippetsBridge_onSnippetsDisabled(env, observer_.obj());
+ Java_SnippetsBridge_onDisabledReasonChanged(
+ env, observer_.obj(), static_cast<int>(disabled_reason));
}
void NTPSnippetsBridge::OnImageFetched(ScopedJavaGlobalRef<jobject> callback,
« no previous file with comments | « chrome/browser/android/ntp/ntp_snippets_bridge.h ('k') | chrome/browser/ntp_snippets/ntp_snippets_service_factory.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698