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

Unified Diff: chrome/browser/sync/sessions/status_controller.h

Issue 1294002: Fix for negative routing info problem. We were replacing tokens after (Closed)
Patch Set: Comment fixes. Created 10 years, 9 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/status_controller.h
diff --git a/chrome/browser/sync/sessions/status_controller.h b/chrome/browser/sync/sessions/status_controller.h
index 87d30df33d11e2de13d707b37e79c5623a843b0a..ebb633082852b1769149a61a33d4c029a22a283b 100644
--- a/chrome/browser/sync/sessions/status_controller.h
+++ b/chrome/browser/sync/sessions/status_controller.h
@@ -151,9 +151,10 @@ class StatusController {
int64 CountUpdates() const;
// Returns true iff any of the commit ids added during this session are
- // bookmark related.
+ // bookmark related, and the bookmark group restriction is in effect.
bool HasBookmarkCommitActivity() const {
- return shared_.commit_set.HasBookmarkCommitId();
+ return ActiveGroupRestrictionIncludesModel(syncable::BOOKMARKS) &&
+ shared_.commit_set.HasBookmarkCommitId();
}
// Returns true if the last download_updates_command received a valid
@@ -178,6 +179,16 @@ class StatusController {
return group_restriction_;
}
+ // Check whether a particular model is included by the active group
+ // restriction.
+ bool ActiveGroupRestrictionIncludesModel(syncable::ModelType model) const {
+ DCHECK(group_restriction_in_effect_);
+ ModelSafeRoutingInfo::const_iterator it = routing_info_.find(model);
+ if (it == routing_info_.end())
+ return false;
+ return group_restriction() == it->second;
+ }
+
// A toolbelt full of methods for updating counters and flags.
void increment_num_conflicting_commits_by(int value);
void reset_num_conflicting_commits();

Powered by Google App Engine
This is Rietveld 408576698