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

Unified Diff: chrome/browser/extensions/api/synced_notifications_private/synced_notifications_shim.cc

Issue 411463003: [Sync] Trigger refresh for synced notifications on context change (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Self review Created 6 years, 5 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/extensions/api/synced_notifications_private/synced_notifications_shim.cc
diff --git a/chrome/browser/extensions/api/synced_notifications_private/synced_notifications_shim.cc b/chrome/browser/extensions/api/synced_notifications_private/synced_notifications_shim.cc
index 07fb3bebe23597a58c320e3e609c14a604a903d6..21361f1fa4d92b33bb371404caadec2147a6e6d1 100644
--- a/chrome/browser/extensions/api/synced_notifications_private/synced_notifications_shim.cc
+++ b/chrome/browser/extensions/api/synced_notifications_private/synced_notifications_shim.cc
@@ -129,8 +129,10 @@ bool PopulateJSDataListFromSync(
} // namespace
SyncedNotificationsShim::SyncedNotificationsShim(
- const EventLauncher& event_launcher)
- : event_launcher_(event_launcher) {
+ const EventLauncher& event_launcher,
+ const base::Closure& refresh_request)
+ : event_launcher_(event_launcher),
+ refresh_request_(refresh_request) {
}
SyncedNotificationsShim::~SyncedNotificationsShim() {
@@ -240,6 +242,12 @@ bool SyncedNotificationsShim::SetRenderContext(
syncer::SyncError error =
notifications_change_processor_->UpdateDataTypeContext(
syncer::SYNCED_NOTIFICATIONS, sync_refresh_status, new_context);
+
+ if (sync_refresh_status == syncer::SyncChangeProcessor::REFRESH_NEEDED &&
+ !refresh_request_.is_null()) {
+ refresh_request_.Run();
+ }
+
return !error.IsSet();
}

Powered by Google App Engine
This is Rietveld 408576698