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

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

Issue 1980033002: [NTP Snippets] Clear the snippets when the user signs out (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix and add test, address comments Created 4 years, 7 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 9e7a1717a423045b086f85130b03b627df9030ba..9f23b2d0fbea253d630fc38b0ac5976854caf286 100644
--- a/chrome/browser/android/ntp/ntp_snippets_bridge.cc
+++ b/chrome/browser/android/ntp/ntp_snippets_bridge.cc
@@ -168,6 +168,13 @@ void NTPSnippetsBridge::NTPSnippetsServiceShutdown() {
snippet_service_observer_.Remove(ntp_snippets_service_);
}
+void NTPSnippetsBridge::NTPSnippetsServiceCleared() {
+ // The user signed out or disabled sync. Since snippets rely on those, we
Bernhard Bauer 2016/05/17 12:24:39 Nit: double "we".
dgn 2016/05/17 13:18:22 Done.
+ // we clear them to be consistent with the initially signed out state.
+ JNIEnv* env = base::android::AttachCurrentThread();
+ Java_SnippetsBridge_onSnippetsCleared(env, observer_.obj());
+}
+
void NTPSnippetsBridge::OnImageFetched(ScopedJavaGlobalRef<jobject> callback,
const std::string& snippet_id,
const SkBitmap* bitmap) {
« no previous file with comments | « chrome/browser/android/ntp/ntp_snippets_bridge.h ('k') | chrome/browser/ui/webui/snippets_internals_message_handler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698