| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "chrome/browser/sync/sessions/status_controller.h" | 5 #include "chrome/browser/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 "chrome/browser/sync/protocol/sync_protocol_error.h" | 10 #include "chrome/browser/sync/protocol/sync_protocol_error.h" |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 55 true, group_restriction_)->conflict_progress; | 55 true, group_restriction_)->conflict_progress; |
| 56 } | 56 } |
| 57 | 57 |
| 58 const ConflictProgress* StatusController::GetUnrestrictedConflictProgress( | 58 const ConflictProgress* StatusController::GetUnrestrictedConflictProgress( |
| 59 ModelSafeGroup group) const { | 59 ModelSafeGroup group) const { |
| 60 const PerModelSafeGroupState* state = | 60 const PerModelSafeGroupState* state = |
| 61 GetModelSafeGroupState(false, group); | 61 GetModelSafeGroupState(false, group); |
| 62 return state ? &state->conflict_progress : NULL; | 62 return state ? &state->conflict_progress : NULL; |
| 63 } | 63 } |
| 64 | 64 |
| 65 ConflictProgress* |
| 66 StatusController::GetUnrestrictedMutableConflictProgressForTest( |
| 67 ModelSafeGroup group) { |
| 68 return &GetOrCreateModelSafeGroupState(false, group)->conflict_progress; |
| 69 } |
| 70 |
| 65 const UpdateProgress* StatusController::GetUnrestrictedUpdateProgress( | 71 const UpdateProgress* StatusController::GetUnrestrictedUpdateProgress( |
| 66 ModelSafeGroup group) const { | 72 ModelSafeGroup group) const { |
| 67 const PerModelSafeGroupState* state = | 73 const PerModelSafeGroupState* state = |
| 68 GetModelSafeGroupState(false, group); | 74 GetModelSafeGroupState(false, group); |
| 69 return state ? &state->update_progress : NULL; | 75 return state ? &state->update_progress : NULL; |
| 70 } | 76 } |
| 71 | 77 |
| 78 UpdateProgress* |
| 79 StatusController::GetUnrestrictedMutableUpdateProgressForTest( |
| 80 ModelSafeGroup group) { |
| 81 return &GetOrCreateModelSafeGroupState(false, group)->update_progress; |
| 82 } |
| 83 |
| 72 const PerModelSafeGroupState* StatusController::GetModelSafeGroupState( | 84 const PerModelSafeGroupState* StatusController::GetModelSafeGroupState( |
| 73 bool restrict, ModelSafeGroup group) const { | 85 bool restrict, ModelSafeGroup group) const { |
| 74 DCHECK_EQ(restrict, group_restriction_in_effect_); | 86 DCHECK_EQ(restrict, group_restriction_in_effect_); |
| 75 std::map<ModelSafeGroup, PerModelSafeGroupState*>::const_iterator it = | 87 std::map<ModelSafeGroup, PerModelSafeGroupState*>::const_iterator it = |
| 76 per_model_group_.find(group); | 88 per_model_group_.find(group); |
| 77 return (it == per_model_group_.end()) ? NULL : it->second; | 89 return (it == per_model_group_.end()) ? NULL : it->second; |
| 78 } | 90 } |
| 79 | 91 |
| 80 PerModelSafeGroupState* StatusController::GetOrCreateModelSafeGroupState( | 92 PerModelSafeGroupState* StatusController::GetOrCreateModelSafeGroupState( |
| 81 bool restrict, ModelSafeGroup group) { | 93 bool restrict, ModelSafeGroup group) { |
| (...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 290 void StatusController::set_debug_info_sent() { | 302 void StatusController::set_debug_info_sent() { |
| 291 shared_.control_params.debug_info_sent = true; | 303 shared_.control_params.debug_info_sent = true; |
| 292 } | 304 } |
| 293 | 305 |
| 294 bool StatusController::debug_info_sent() const { | 306 bool StatusController::debug_info_sent() const { |
| 295 return shared_.control_params.debug_info_sent; | 307 return shared_.control_params.debug_info_sent; |
| 296 } | 308 } |
| 297 | 309 |
| 298 } // namespace sessions | 310 } // namespace sessions |
| 299 } // namespace browser_sync | 311 } // namespace browser_sync |
| OLD | NEW |