OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "components/sync_driver/non_blocking_data_type_controller.h" | 5 #include "components/sync_driver/non_blocking_data_type_controller.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/bind_helpers.h" | 8 #include "base/bind_helpers.h" |
9 #include "base/location.h" | 9 #include "base/location.h" |
10 #include "sync/engine/model_type_sync_proxy_impl.h" | 10 #include "sync/engine/model_type_sync_proxy_impl.h" |
11 | 11 |
12 namespace browser_sync { | 12 namespace sync_driver { |
13 | 13 |
14 NonBlockingDataTypeController::NonBlockingDataTypeController( | 14 NonBlockingDataTypeController::NonBlockingDataTypeController( |
15 syncer::ModelType type, bool is_preferred) | 15 syncer::ModelType type, bool is_preferred) |
16 : type_(type), | 16 : type_(type), |
17 current_state_(DISCONNECTED), | 17 current_state_(DISCONNECTED), |
18 is_preferred_(is_preferred) {} | 18 is_preferred_(is_preferred) {} |
19 | 19 |
20 NonBlockingDataTypeController::~NonBlockingDataTypeController() {} | 20 NonBlockingDataTypeController::~NonBlockingDataTypeController() {} |
21 | 21 |
22 void NonBlockingDataTypeController::InitializeType( | 22 void NonBlockingDataTypeController::InitializeType( |
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
127 NonBlockingDataTypeController::GetDesiredState() const { | 127 NonBlockingDataTypeController::GetDesiredState() const { |
128 if (!IsPreferred()) { | 128 if (!IsPreferred()) { |
129 return DISABLED; | 129 return DISABLED; |
130 } else if (!IsSyncBackendConnected() || !IsSyncProxyConnected()) { | 130 } else if (!IsSyncBackendConnected() || !IsSyncProxyConnected()) { |
131 return DISCONNECTED; | 131 return DISCONNECTED; |
132 } else { | 132 } else { |
133 return ENABLED; | 133 return ENABLED; |
134 } | 134 } |
135 } | 135 } |
136 | 136 |
137 } // namespace browser_sync | 137 } // namespace sync_driver |
OLD | NEW |