OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/bind.h" | 7 #include "base/bind.h" |
8 #include "base/bind_helpers.h" | 8 #include "base/bind_helpers.h" |
9 #include "base/json/json_reader.h" | 9 #include "base/json/json_reader.h" |
10 #include "base/json/json_writer.h" | 10 #include "base/json/json_writer.h" |
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
117 return false; | 117 return false; |
118 if (sync_extensions) | 118 if (sync_extensions) |
119 config->data_types.insert(syncable::EXTENSIONS); | 119 config->data_types.insert(syncable::EXTENSIONS); |
120 | 120 |
121 bool sync_typed_urls; | 121 bool sync_typed_urls; |
122 if (!result->GetBoolean("syncTypedUrls", &sync_typed_urls)) | 122 if (!result->GetBoolean("syncTypedUrls", &sync_typed_urls)) |
123 return false; | 123 return false; |
124 if (sync_typed_urls) | 124 if (sync_typed_urls) |
125 config->data_types.insert(syncable::TYPED_URLS); | 125 config->data_types.insert(syncable::TYPED_URLS); |
126 | 126 |
127 bool sync_search_engines; | |
128 if (!result->GetBoolean("syncSearchEngines", &sync_search_engines)) | |
129 return false; | |
130 if (sync_search_engines) | |
131 config->data_types.insert(syncable::SEARCH_ENGINES); | |
132 | |
133 bool sync_sessions; | 127 bool sync_sessions; |
134 if (!result->GetBoolean("syncSessions", &sync_sessions)) | 128 if (!result->GetBoolean("syncSessions", &sync_sessions)) |
135 return false; | 129 return false; |
136 if (sync_sessions) | 130 if (sync_sessions) |
137 config->data_types.insert(syncable::SESSIONS); | 131 config->data_types.insert(syncable::SESSIONS); |
138 | 132 |
139 bool sync_apps; | 133 bool sync_apps; |
140 if (!result->GetBoolean("syncApps", &sync_apps)) | 134 if (!result->GetBoolean("syncApps", &sync_apps)) |
141 return false; | 135 return false; |
142 if (sync_apps) | 136 if (sync_apps) |
(...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
323 { "syncAllDataTypes", IDS_SYNC_EVERYTHING }, | 317 { "syncAllDataTypes", IDS_SYNC_EVERYTHING }, |
324 { "chooseDataTypes", IDS_SYNC_CHOOSE_DATATYPES }, | 318 { "chooseDataTypes", IDS_SYNC_CHOOSE_DATATYPES }, |
325 { "bookmarks", IDS_SYNC_DATATYPE_BOOKMARKS }, | 319 { "bookmarks", IDS_SYNC_DATATYPE_BOOKMARKS }, |
326 { "preferences", IDS_SYNC_DATATYPE_PREFERENCES }, | 320 { "preferences", IDS_SYNC_DATATYPE_PREFERENCES }, |
327 { "autofill", IDS_SYNC_DATATYPE_AUTOFILL }, | 321 { "autofill", IDS_SYNC_DATATYPE_AUTOFILL }, |
328 { "themes", IDS_SYNC_DATATYPE_THEMES }, | 322 { "themes", IDS_SYNC_DATATYPE_THEMES }, |
329 { "passwords", IDS_SYNC_DATATYPE_PASSWORDS }, | 323 { "passwords", IDS_SYNC_DATATYPE_PASSWORDS }, |
330 { "extensions", IDS_SYNC_DATATYPE_EXTENSIONS }, | 324 { "extensions", IDS_SYNC_DATATYPE_EXTENSIONS }, |
331 { "typedURLs", IDS_SYNC_DATATYPE_TYPED_URLS }, | 325 { "typedURLs", IDS_SYNC_DATATYPE_TYPED_URLS }, |
332 { "apps", IDS_SYNC_DATATYPE_APPS }, | 326 { "apps", IDS_SYNC_DATATYPE_APPS }, |
333 { "searchEngines", IDS_SYNC_DATATYPE_SEARCH_ENGINES }, | |
334 { "openTabs", IDS_SYNC_DATATYPE_TABS }, | 327 { "openTabs", IDS_SYNC_DATATYPE_TABS }, |
335 { "syncZeroDataTypesError", IDS_SYNC_ZERO_DATA_TYPES_ERROR }, | 328 { "syncZeroDataTypesError", IDS_SYNC_ZERO_DATA_TYPES_ERROR }, |
336 { "serviceUnavailableError", IDS_SYNC_SETUP_ABORTED_BY_PENDING_CLEAR }, | 329 { "serviceUnavailableError", IDS_SYNC_SETUP_ABORTED_BY_PENDING_CLEAR }, |
337 { "encryptAllLabel", IDS_SYNC_ENCRYPT_ALL_LABEL }, | 330 { "encryptAllLabel", IDS_SYNC_ENCRYPT_ALL_LABEL }, |
338 { "googleOption", IDS_SYNC_PASSPHRASE_OPT_GOOGLE }, | 331 { "googleOption", IDS_SYNC_PASSPHRASE_OPT_GOOGLE }, |
339 { "explicitOption", IDS_SYNC_PASSPHRASE_OPT_EXPLICIT }, | 332 { "explicitOption", IDS_SYNC_PASSPHRASE_OPT_EXPLICIT }, |
340 { "sectionGoogleMessage", IDS_SYNC_PASSPHRASE_MSG_GOOGLE }, | 333 { "sectionGoogleMessage", IDS_SYNC_PASSPHRASE_MSG_GOOGLE }, |
341 { "sectionExplicitMessage", IDS_SYNC_PASSPHRASE_MSG_EXPLICIT }, | 334 { "sectionExplicitMessage", IDS_SYNC_PASSPHRASE_MSG_EXPLICIT }, |
342 { "passphraseLabel", IDS_SYNC_PASSPHRASE_LABEL }, | 335 { "passphraseLabel", IDS_SYNC_PASSPHRASE_LABEL }, |
343 { "confirmLabel", IDS_SYNC_CONFIRM_PASSPHRASE_LABEL }, | 336 { "confirmLabel", IDS_SYNC_CONFIRM_PASSPHRASE_LABEL }, |
(...skipping 396 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
740 } | 733 } |
741 | 734 |
742 void SyncSetupHandler::ShowLoginErrorMessage(const string16& error_message) { | 735 void SyncSetupHandler::ShowLoginErrorMessage(const string16& error_message) { |
743 DictionaryValue args; | 736 DictionaryValue args; |
744 Profile* profile = Profile::FromWebUI(web_ui_); | 737 Profile* profile = Profile::FromWebUI(web_ui_); |
745 ProfileSyncService* service = profile->GetProfileSyncService(); | 738 ProfileSyncService* service = profile->GetProfileSyncService(); |
746 SyncSetupFlow::GetArgsForGaiaLogin(service, &args); | 739 SyncSetupFlow::GetArgsForGaiaLogin(service, &args); |
747 args.SetString("error_message", error_message); | 740 args.SetString("error_message", error_message); |
748 ShowGaiaLogin(args); | 741 ShowGaiaLogin(args); |
749 } | 742 } |
OLD | NEW |