Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(110)

Side by Side Diff: chrome/browser/ui/webui/sync_setup_handler.cc

Issue 12286007: Revert "Revert 182527" ([Sync] Make SESSIONS an implicit type) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 7 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
76 // Note: The order of these types must match the ordering of 76 // Note: The order of these types must match the ordering of
77 // the respective types in ModelType 77 // the respective types in ModelType
78 const char* kDataTypeNames[] = { 78 const char* kDataTypeNames[] = {
79 "bookmarks", 79 "bookmarks",
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 "sessions", 86 "apps",
87 "apps" 87 "tabs"
88 }; 88 };
89 89
90 COMPILE_ASSERT(25 == syncer::MODEL_TYPE_COUNT, 90 COMPILE_ASSERT(26 == 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 1219 matching lines...) Expand 10 before | Expand all | Expand 10 after
1320 if (i != current_profile_index && AreUserNamesEqual( 1320 if (i != current_profile_index && AreUserNamesEqual(
1321 cache.GetUserNameOfProfileAtIndex(i), username_utf16)) { 1321 cache.GetUserNameOfProfileAtIndex(i), username_utf16)) {
1322 *error_message = l10n_util::GetStringUTF16( 1322 *error_message = l10n_util::GetStringUTF16(
1323 IDS_SYNC_USER_NAME_IN_USE_ERROR); 1323 IDS_SYNC_USER_NAME_IN_USE_ERROR);
1324 return false; 1324 return false;
1325 } 1325 }
1326 } 1326 }
1327 1327
1328 return true; 1328 return true;
1329 } 1329 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/webui/ntp/foreign_session_handler.cc ('k') | chrome/browser/ui/webui/sync_setup_handler_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698