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

Unified Diff: chrome/browser/ui/webui/sync_setup_handler.cc

Issue 674633002: sync: add WIFI_CREDENTIALS protobuf, ModelType, and preference (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@local-master
Patch Set: fix error in get commit message Created 6 years, 2 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/sync/profile_sync_service.cc ('k') | chrome/browser/ui/webui/sync_setup_handler_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
« no previous file with comments | « chrome/browser/sync/profile_sync_service.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