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

Side by Side 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: sync: add WIFI_CREDENTIALS protobuf, ModelType, and preference 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 unified diff | Download patch
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 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
96 // the respective types in ModelType 96 // the respective types in ModelType
97 const char* kDataTypeNames[] = { 97 const char* kDataTypeNames[] = {
98 "bookmarks", 98 "bookmarks",
99 "preferences", 99 "preferences",
100 "passwords", 100 "passwords",
101 "autofill", 101 "autofill",
102 "themes", 102 "themes",
103 "typedUrls", 103 "typedUrls",
104 "extensions", 104 "extensions",
105 "apps", 105 "apps",
106 "tabs" 106 "wifiCredentials",
107 "tabs",
107 }; 108 };
108 109
109 COMPILE_ASSERT(33 == syncer::MODEL_TYPE_COUNT, 110 COMPILE_ASSERT(34 == syncer::MODEL_TYPE_COUNT,
110 update_kDataTypeNames_to_match_UserSelectableTypes); 111 update_kDataTypeNames_to_match_UserSelectableTypes);
111 112
112 typedef std::map<syncer::ModelType, const char*> ModelTypeNameMap; 113 typedef std::map<syncer::ModelType, const char*> ModelTypeNameMap;
113 114
114 ModelTypeNameMap GetSelectableTypeNameMap() { 115 ModelTypeNameMap GetSelectableTypeNameMap() {
115 ModelTypeNameMap type_names; 116 ModelTypeNameMap type_names;
116 syncer::ModelTypeSet type_set = syncer::UserSelectableTypes(); 117 syncer::ModelTypeSet type_set = syncer::UserSelectableTypes();
117 syncer::ModelTypeSet::Iterator it = type_set.First(); 118 syncer::ModelTypeSet::Iterator it = type_set.First();
118 DCHECK_EQ(arraysize(kDataTypeNames), type_set.Size()); 119 DCHECK_EQ(arraysize(kDataTypeNames), type_set.Size());
119 for (size_t i = 0; i < arraysize(kDataTypeNames) && it.Good(); 120 for (size_t i = 0; i < arraysize(kDataTypeNames) && it.Good();
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after
265 { "chooseDataTypes", IDS_SYNC_CHOOSE_DATATYPES }, 266 { "chooseDataTypes", IDS_SYNC_CHOOSE_DATATYPES },
266 { "syncNothing", IDS_SYNC_NOTHING }, 267 { "syncNothing", IDS_SYNC_NOTHING },
267 { "bookmarks", IDS_SYNC_DATATYPE_BOOKMARKS }, 268 { "bookmarks", IDS_SYNC_DATATYPE_BOOKMARKS },
268 { "preferences", IDS_SYNC_DATATYPE_PREFERENCES }, 269 { "preferences", IDS_SYNC_DATATYPE_PREFERENCES },
269 { "autofill", IDS_SYNC_DATATYPE_AUTOFILL }, 270 { "autofill", IDS_SYNC_DATATYPE_AUTOFILL },
270 { "themes", IDS_SYNC_DATATYPE_THEMES }, 271 { "themes", IDS_SYNC_DATATYPE_THEMES },
271 { "passwords", IDS_SYNC_DATATYPE_PASSWORDS }, 272 { "passwords", IDS_SYNC_DATATYPE_PASSWORDS },
272 { "extensions", IDS_SYNC_DATATYPE_EXTENSIONS }, 273 { "extensions", IDS_SYNC_DATATYPE_EXTENSIONS },
273 { "typedURLs", IDS_SYNC_DATATYPE_TYPED_URLS }, 274 { "typedURLs", IDS_SYNC_DATATYPE_TYPED_URLS },
274 { "apps", IDS_SYNC_DATATYPE_APPS }, 275 { "apps", IDS_SYNC_DATATYPE_APPS },
276 { "wifiCredentials", IDS_SYNC_DATATYPE_WIFI_CREDENTIALS },
275 { "openTabs", IDS_SYNC_DATATYPE_TABS }, 277 { "openTabs", IDS_SYNC_DATATYPE_TABS },
276 { "serviceUnavailableError", IDS_SYNC_SETUP_ABORTED_BY_PENDING_CLEAR }, 278 { "serviceUnavailableError", IDS_SYNC_SETUP_ABORTED_BY_PENDING_CLEAR },
277 { "confirmLabel", IDS_SYNC_CONFIRM_PASSPHRASE_LABEL }, 279 { "confirmLabel", IDS_SYNC_CONFIRM_PASSPHRASE_LABEL },
278 { "emptyErrorMessage", IDS_SYNC_EMPTY_PASSPHRASE_ERROR }, 280 { "emptyErrorMessage", IDS_SYNC_EMPTY_PASSPHRASE_ERROR },
279 { "mismatchErrorMessage", IDS_SYNC_PASSPHRASE_MISMATCH_ERROR }, 281 { "mismatchErrorMessage", IDS_SYNC_PASSPHRASE_MISMATCH_ERROR },
280 { "customizeLinkLabel", IDS_SYNC_CUSTOMIZE_LINK_LABEL }, 282 { "customizeLinkLabel", IDS_SYNC_CUSTOMIZE_LINK_LABEL },
281 { "confirmSyncPreferences", IDS_SYNC_CONFIRM_SYNC_PREFERENCES }, 283 { "confirmSyncPreferences", IDS_SYNC_CONFIRM_SYNC_PREFERENCES },
282 { "syncEverything", IDS_SYNC_SYNC_EVERYTHING }, 284 { "syncEverything", IDS_SYNC_SYNC_EVERYTHING },
283 { "useDefaultSettings", IDS_SYNC_USE_DEFAULT_SETTINGS }, 285 { "useDefaultSettings", IDS_SYNC_USE_DEFAULT_SETTINGS },
284 { "enterPassphraseBody", IDS_SYNC_ENTER_PASSPHRASE_BODY }, 286 { "enterPassphraseBody", IDS_SYNC_ENTER_PASSPHRASE_BODY },
(...skipping 673 matching lines...) Expand 10 before | Expand all | Expand 10 after
958 960
959 LoginUIService* service = GetLoginUIService(); 961 LoginUIService* service = GetLoginUIService();
960 DCHECK(service); 962 DCHECK(service);
961 service->current_login_ui()->FocusUI(); 963 service->current_login_ui()->FocusUI();
962 return true; 964 return true;
963 } 965 }
964 966
965 LoginUIService* SyncSetupHandler::GetLoginUIService() const { 967 LoginUIService* SyncSetupHandler::GetLoginUIService() const {
966 return LoginUIServiceFactory::GetForProfile(GetProfile()); 968 return LoginUIServiceFactory::GetForProfile(GetProfile());
967 } 969 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698