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

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

Issue 2824073002: [sync] Prevent sessions flare on startup (Closed)
Patch Set: Disable test on android 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..fe19793b27b88c662b83f5dedadec37b0795edef 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 {
@@ -52,15 +53,17 @@ SyncSessionsWebContentsRouter::SyncSessionsWebContentsRouter(Profile* profile) {
SyncSessionsWebContentsRouter::~SyncSessionsWebContentsRouter() {}
void SyncSessionsWebContentsRouter::NotifyTabModified(
- content::WebContents* web_contents) {
- if (handler_ && web_contents) {
- SyncedTabDelegate* delegate =
- GetSyncedTabDelegateFromWebContents(web_contents);
- if (delegate)
- handler_->OnLocalTabModified(delegate);
+ content::WebContents* web_contents,
+ bool page_load_completed) {
+ SyncedTabDelegate* delegate = nullptr;
+ if (web_contents)
+ delegate = GetSyncedTabDelegateFromWebContents(web_contents);
+
+ if (handler_ && delegate) {
+ handler_->OnLocalTabModified(delegate);
}
- if (!flare_.is_null()) {
+ if (!flare_.is_null() && delegate && page_load_completed) {
flare_.Run(syncer::SESSIONS);
flare_.Reset();
}

Powered by Google App Engine
This is Rietveld 408576698