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/internal_api/sync_manager.h" | 5 #include "chrome/browser/sync/internal_api/sync_manager.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/base64.h" | 10 #include "base/base64.h" |
(...skipping 959 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
970 DCHECK(thread_checker_.CalledOnValidThread()); | 970 DCHECK(thread_checker_.CalledOnValidThread()); |
971 ModelSafeRoutingInfo routes; | 971 ModelSafeRoutingInfo routes; |
972 registrar_->GetModelSafeRoutingInfo(&routes); | 972 registrar_->GetModelSafeRoutingInfo(&routes); |
973 syncable::ModelTypeSet enabled_types; | 973 syncable::ModelTypeSet enabled_types; |
974 for (ModelSafeRoutingInfo::const_iterator it = routes.begin(); | 974 for (ModelSafeRoutingInfo::const_iterator it = routes.begin(); |
975 it != routes.end(); ++it) { | 975 it != routes.end(); ++it) { |
976 enabled_types.insert(it->first); | 976 enabled_types.insert(it->first); |
977 } | 977 } |
978 sync_notifier_->UpdateEnabledTypes(enabled_types); | 978 sync_notifier_->UpdateEnabledTypes(enabled_types); |
979 if (CommandLine::ForCurrentProcess()->HasSwitch( | 979 if (CommandLine::ForCurrentProcess()->HasSwitch( |
980 switches::kEnableSyncSessionsForOtherClients)) { | 980 switches::kEnableSyncTabsForOtherClients)) { |
981 MaybeSetSyncTabsInNigoriNode(enabled_types); | 981 MaybeSetSyncTabsInNigoriNode(enabled_types); |
982 } | 982 } |
983 } | 983 } |
984 | 984 |
985 void SyncManager::SyncInternal::MaybeSetSyncTabsInNigoriNode( | 985 void SyncManager::SyncInternal::MaybeSetSyncTabsInNigoriNode( |
986 const syncable::ModelTypeSet enabled_types) { | 986 const syncable::ModelTypeSet enabled_types) { |
987 // The initialized_ check is to ensure that we don't CHECK in GetUserShare | 987 // The initialized_ check is to ensure that we don't CHECK in GetUserShare |
988 // when this is called on start-up. It's ok to ignore that case, since | 988 // when this is called on start-up. It's ok to ignore that case, since |
989 // presumably this would've run when the user originally enabled sessions. | 989 // presumably this would've run when the user originally enabled sessions. |
990 if (initialized_ && enabled_types.count(syncable::SESSIONS) > 0) { | 990 if (initialized_ && enabled_types.count(syncable::SESSIONS) > 0) { |
(...skipping 1129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2120 | 2120 |
2121 for (syncable::ModelTypeSet::const_iterator i = types.begin(); | 2121 for (syncable::ModelTypeSet::const_iterator i = types.begin(); |
2122 i != types.end(); ++i) { | 2122 i != types.end(); ++i) { |
2123 if (!lookup->initial_sync_ended_for_type(*i)) | 2123 if (!lookup->initial_sync_ended_for_type(*i)) |
2124 return false; | 2124 return false; |
2125 } | 2125 } |
2126 return true; | 2126 return true; |
2127 } | 2127 } |
2128 | 2128 |
2129 } // namespace sync_api | 2129 } // namespace sync_api |
OLD | NEW |