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 "chrome/browser/ui/webui/sync_setup_handler.h" | 5 #include "chrome/browser/ui/webui/sync_setup_handler.h" |
6 | 6 |
7 #include "base/basictypes.h" | 7 #include "base/basictypes.h" |
8 #include "base/bind.h" | 8 #include "base/bind.h" |
9 #include "base/bind_helpers.h" | 9 #include "base/bind_helpers.h" |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
80 "preferences", | 80 "preferences", |
81 "passwords", | 81 "passwords", |
82 "autofill", | 82 "autofill", |
83 "themes", | 83 "themes", |
84 "typedUrls", | 84 "typedUrls", |
85 "extensions", | 85 "extensions", |
86 "apps", | 86 "apps", |
87 "tabs" | 87 "tabs" |
88 }; | 88 }; |
89 | 89 |
90 COMPILE_ASSERT(26 == syncer::MODEL_TYPE_COUNT, | 90 COMPILE_ASSERT(27 == syncer::MODEL_TYPE_COUNT, |
91 update_kDataTypeNames_to_match_UserSelectableTypes); | 91 update_kDataTypeNames_to_match_UserSelectableTypes); |
92 | 92 |
93 typedef std::map<syncer::ModelType, const char*> ModelTypeNameMap; | 93 typedef std::map<syncer::ModelType, const char*> ModelTypeNameMap; |
94 | 94 |
95 ModelTypeNameMap GetSelectableTypeNameMap() { | 95 ModelTypeNameMap GetSelectableTypeNameMap() { |
96 ModelTypeNameMap type_names; | 96 ModelTypeNameMap type_names; |
97 syncer::ModelTypeSet type_set = syncer::UserSelectableTypes(); | 97 syncer::ModelTypeSet type_set = syncer::UserSelectableTypes(); |
98 syncer::ModelTypeSet::Iterator it = type_set.First(); | 98 syncer::ModelTypeSet::Iterator it = type_set.First(); |
99 DCHECK_EQ(arraysize(kDataTypeNames), type_set.Size()); | 99 DCHECK_EQ(arraysize(kDataTypeNames), type_set.Size()); |
100 for (size_t i = 0; i < arraysize(kDataTypeNames) && it.Good(); | 100 for (size_t i = 0; i < arraysize(kDataTypeNames) && it.Good(); |
(...skipping 1226 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1327 if (i != current_profile_index && AreUserNamesEqual( | 1327 if (i != current_profile_index && AreUserNamesEqual( |
1328 cache.GetUserNameOfProfileAtIndex(i), username_utf16)) { | 1328 cache.GetUserNameOfProfileAtIndex(i), username_utf16)) { |
1329 *error_message = l10n_util::GetStringUTF16( | 1329 *error_message = l10n_util::GetStringUTF16( |
1330 IDS_SYNC_USER_NAME_IN_USE_ERROR); | 1330 IDS_SYNC_USER_NAME_IN_USE_ERROR); |
1331 return false; | 1331 return false; |
1332 } | 1332 } |
1333 } | 1333 } |
1334 | 1334 |
1335 return true; | 1335 return true; |
1336 } | 1336 } |
OLD | NEW |