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

Unified Diff: chrome/browser/sync/sessions/sync_sessions_web_contents_router.cc

Issue 2824073002: [sync] Prevent sessions flare on startup (Closed)
Patch Set: Created 3 years, 8 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/sync/sessions/sync_sessions_web_contents_router.cc
diff --git a/chrome/browser/sync/sessions/sync_sessions_web_contents_router.cc b/chrome/browser/sync/sessions/sync_sessions_web_contents_router.cc
index cc5ecea9384ddd638c5c96be25352ec1b5bd32e4..e682c0493d7f48ef8605057e76c78bd6185a049d 100644
--- a/chrome/browser/sync/sessions/sync_sessions_web_contents_router.cc
+++ b/chrome/browser/sync/sessions/sync_sessions_web_contents_router.cc
@@ -14,6 +14,7 @@
#include "chrome/browser/ui/sync/tab_contents_synced_tab_delegate.h"
#include "chrome/browser/ui/tabs/tab_strip_model.h"
#include "components/history/core/browser/history_service.h"
+#include "components/sync_sessions/sync_sessions_client.h"
#include "components/sync_sessions/synced_tab_delegate.h"
namespace sync_sessions {
@@ -56,13 +57,16 @@ void SyncSessionsWebContentsRouter::NotifyTabModified(
if (handler_ && web_contents) {
SyncedTabDelegate* delegate =
GetSyncedTabDelegateFromWebContents(web_contents);
- if (delegate)
+ if (delegate) {
handler_->OnLocalTabModified(delegate);
- }
-
- if (!flare_.is_null()) {
- flare_.Run(syncer::SESSIONS);
- flare_.Reset();
+ if (sessions_client_ && !delegate->ShouldSync(sessions_client_))
+ return;
skym 2017/04/18 15:50:51 This early return feels really oddly structured.
Patrick Noland 2017/04/18 22:37:41 Done.
+ }
+
+ if (!flare_.is_null()) {
skym 2017/04/18 15:50:51 This looks broken to me. My understanding is that
Patrick Noland 2017/04/18 22:37:41 Done.
+ flare_.Run(syncer::SESSIONS);
+ flare_.Reset();
+ }
}
}

Powered by Google App Engine
This is Rietveld 408576698