| Index: chrome/browser/ui/webui/sync_setup_handler.cc
|
| diff --git a/chrome/browser/ui/webui/sync_setup_handler.cc b/chrome/browser/ui/webui/sync_setup_handler.cc
|
| index 090372aede33d9b7680a88fb1db87c95cb950159..0b251737d1a2dc8c277144fc3a71475f8cecb14b 100644
|
| --- a/chrome/browser/ui/webui/sync_setup_handler.cc
|
| +++ b/chrome/browser/ui/webui/sync_setup_handler.cc
|
| @@ -91,37 +91,6 @@ SyncConfigInfo::SyncConfigInfo()
|
|
|
| SyncConfigInfo::~SyncConfigInfo() {}
|
|
|
| -// Note: The order of these types must match the ordering of
|
| -// the respective types in ModelType
|
| -const char* kDataTypeNames[] = {
|
| - "bookmarks",
|
| - "preferences",
|
| - "passwords",
|
| - "autofill",
|
| - "themes",
|
| - "typedUrls",
|
| - "extensions",
|
| - "apps",
|
| - "tabs"
|
| -};
|
| -
|
| -COMPILE_ASSERT(32 == syncer::MODEL_TYPE_COUNT,
|
| - update_kDataTypeNames_to_match_UserSelectableTypes);
|
| -
|
| -typedef std::map<syncer::ModelType, const char*> ModelTypeNameMap;
|
| -
|
| -ModelTypeNameMap GetSelectableTypeNameMap() {
|
| - ModelTypeNameMap type_names;
|
| - syncer::ModelTypeSet type_set = syncer::UserSelectableTypes();
|
| - syncer::ModelTypeSet::Iterator it = type_set.First();
|
| - DCHECK_EQ(arraysize(kDataTypeNames), type_set.Size());
|
| - for (size_t i = 0; i < arraysize(kDataTypeNames) && it.Good();
|
| - ++i, it.Inc()) {
|
| - type_names[it.Get()] = kDataTypeNames[i];
|
| - }
|
| - return type_names;
|
| -}
|
| -
|
| bool GetConfiguration(const std::string& json, SyncConfigInfo* config) {
|
| scoped_ptr<base::Value> parsed_value(base::JSONReader::Read(json));
|
| base::DictionaryValue* result;
|
| @@ -143,9 +112,9 @@ bool GetConfiguration(const std::string& json, SyncConfigInfo* config) {
|
| DCHECK(!(config->sync_everything && config->sync_nothing))
|
| << "syncAllDataTypes and syncNothing cannot both be true";
|
|
|
| - ModelTypeNameMap type_names = GetSelectableTypeNameMap();
|
| + syncer::ModelTypeNameMap type_names = syncer::GetUserSelectableTypeNameMap();
|
|
|
| - for (ModelTypeNameMap::const_iterator it = type_names.begin();
|
| + for (syncer::ModelTypeNameMap::const_iterator it = type_names.begin();
|
| it != type_names.end(); ++it) {
|
| std::string key_name = it->second + std::string("Synced");
|
| bool sync_value;
|
| @@ -271,6 +240,7 @@ void SyncSetupHandler::GetStaticLocalizedValues(
|
| { "extensions", IDS_SYNC_DATATYPE_EXTENSIONS },
|
| { "typedURLs", IDS_SYNC_DATATYPE_TYPED_URLS },
|
| { "apps", IDS_SYNC_DATATYPE_APPS },
|
| + { "wifiCredentials", IDS_SYNC_DATATYPE_WIFI_CREDENTIALS },
|
| { "openTabs", IDS_SYNC_DATATYPE_TABS },
|
| { "serviceUnavailableError", IDS_SYNC_SETUP_ABORTED_BY_PENDING_CLEAR },
|
| { "confirmLabel", IDS_SYNC_CONFIRM_PASSPHRASE_LABEL },
|
| @@ -357,8 +327,8 @@ void SyncSetupHandler::DisplayConfigureSync(bool show_advanced,
|
| service->GetRegisteredDataTypes();
|
| const syncer::ModelTypeSet preferred_types = service->GetPreferredDataTypes();
|
| const syncer::ModelTypeSet enforced_types = service->GetForcedDataTypes();
|
| - ModelTypeNameMap type_names = GetSelectableTypeNameMap();
|
| - for (ModelTypeNameMap::const_iterator it = type_names.begin();
|
| + syncer::ModelTypeNameMap type_names = syncer::GetUserSelectableTypeNameMap();
|
| + for (syncer::ModelTypeNameMap::const_iterator it = type_names.begin();
|
| it != type_names.end(); ++it) {
|
| syncer::ModelType sync_type = it->first;
|
| const std::string key_name = it->second;
|
|
|