OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "sync/sessions/status_controller.h" | 5 #include "sync/sessions/status_controller.h" |
6 | 6 |
7 #include <vector> | 7 #include <vector> |
8 | 8 |
9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
10 #include "sync/internal_api/public/base/model_type.h" | 10 #include "sync/internal_api/public/base/model_type.h" |
11 #include "sync/protocol/sync_protocol_error.h" | 11 #include "sync/protocol/sync_protocol_error.h" |
12 | 12 |
13 namespace syncer { | 13 namespace syncer { |
14 namespace sessions { | 14 namespace sessions { |
15 | 15 |
16 StatusController::StatusController() | 16 StatusController::StatusController() { |
17 : group_restriction_in_effect_(false), | |
18 group_restriction_(GROUP_PASSIVE) { | |
19 } | 17 } |
20 | 18 |
21 StatusController::~StatusController() {} | 19 StatusController::~StatusController() {} |
22 | 20 |
23 void StatusController::increment_num_updates_downloaded_by(int value) { | 21 void StatusController::increment_num_updates_downloaded_by(int value) { |
24 model_neutral_.num_updates_downloaded_total += value; | 22 model_neutral_.num_updates_downloaded_total += value; |
25 } | 23 } |
26 | 24 |
27 void StatusController::set_types_needing_local_migration(ModelTypeSet types) { | 25 void StatusController::set_types_needing_local_migration(ModelTypeSet types) { |
28 model_neutral_.types_needing_local_migration = types; | 26 model_neutral_.types_needing_local_migration = types; |
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
122 | 120 |
123 int StatusController::num_server_overwrites() const { | 121 int StatusController::num_server_overwrites() const { |
124 return model_neutral_.num_server_overwrites; | 122 return model_neutral_.num_server_overwrites; |
125 } | 123 } |
126 | 124 |
127 int StatusController::num_encryption_conflicts() const { | 125 int StatusController::num_encryption_conflicts() const { |
128 return model_neutral_.num_encryption_conflicts; | 126 return model_neutral_.num_encryption_conflicts; |
129 } | 127 } |
130 | 128 |
131 int StatusController::num_hierarchy_conflicts() const { | 129 int StatusController::num_hierarchy_conflicts() const { |
132 DCHECK(!group_restriction_in_effect_) | |
133 << "num_hierarchy_conflicts applies to all ModelSafeGroups"; | |
134 return model_neutral_.num_hierarchy_conflicts; | 130 return model_neutral_.num_hierarchy_conflicts; |
135 } | 131 } |
136 | 132 |
137 int StatusController::num_server_conflicts() const { | 133 int StatusController::num_server_conflicts() const { |
138 DCHECK(!group_restriction_in_effect_) | |
139 << "num_server_conflicts applies to all ModelSafeGroups"; | |
140 return model_neutral_.num_server_conflicts; | 134 return model_neutral_.num_server_conflicts; |
141 } | 135 } |
142 | 136 |
143 int StatusController::TotalNumConflictingItems() const { | 137 int StatusController::TotalNumConflictingItems() const { |
144 DCHECK(!group_restriction_in_effect_) | |
145 << "TotalNumConflictingItems applies to all ModelSafeGroups"; | |
146 int sum = 0; | 138 int sum = 0; |
147 sum += num_encryption_conflicts(); | 139 sum += num_encryption_conflicts(); |
148 sum += num_hierarchy_conflicts(); | 140 sum += num_hierarchy_conflicts(); |
149 sum += num_server_conflicts(); | 141 sum += num_server_conflicts(); |
150 return sum; | 142 return sum; |
151 } | 143 } |
152 | 144 |
153 bool StatusController::ServerSaysNothingMoreToDownload() const { | 145 bool StatusController::ServerSaysNothingMoreToDownload() const { |
154 if (!download_updates_succeeded()) | 146 if (!download_updates_succeeded()) |
155 return false; | 147 return false; |
(...skipping 10 matching lines...) Expand all Loading... |
166 void StatusController::set_debug_info_sent() { | 158 void StatusController::set_debug_info_sent() { |
167 model_neutral_.debug_info_sent = true; | 159 model_neutral_.debug_info_sent = true; |
168 } | 160 } |
169 | 161 |
170 bool StatusController::debug_info_sent() const { | 162 bool StatusController::debug_info_sent() const { |
171 return model_neutral_.debug_info_sent; | 163 return model_neutral_.debug_info_sent; |
172 } | 164 } |
173 | 165 |
174 } // namespace sessions | 166 } // namespace sessions |
175 } // namespace syncer | 167 } // namespace syncer |
OLD | NEW |