| 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 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 114 return false; | 114 return false; |
| 115 if (sync_extensions) | 115 if (sync_extensions) |
| 116 config->data_types.insert(syncable::EXTENSIONS); | 116 config->data_types.insert(syncable::EXTENSIONS); |
| 117 | 117 |
| 118 bool sync_typed_urls; | 118 bool sync_typed_urls; |
| 119 if (!result->GetBoolean("syncTypedUrls", &sync_typed_urls)) | 119 if (!result->GetBoolean("syncTypedUrls", &sync_typed_urls)) |
| 120 return false; | 120 return false; |
| 121 if (sync_typed_urls) | 121 if (sync_typed_urls) |
| 122 config->data_types.insert(syncable::TYPED_URLS); | 122 config->data_types.insert(syncable::TYPED_URLS); |
| 123 | 123 |
| 124 bool sync_search_engines; | |
| 125 if (!result->GetBoolean("syncSearchEngines", &sync_search_engines)) | |
| 126 return false; | |
| 127 if (sync_search_engines) | |
| 128 config->data_types.insert(syncable::SEARCH_ENGINES); | |
| 129 | |
| 130 bool sync_sessions; | 124 bool sync_sessions; |
| 131 if (!result->GetBoolean("syncSessions", &sync_sessions)) | 125 if (!result->GetBoolean("syncSessions", &sync_sessions)) |
| 132 return false; | 126 return false; |
| 133 if (sync_sessions) | 127 if (sync_sessions) |
| 134 config->data_types.insert(syncable::SESSIONS); | 128 config->data_types.insert(syncable::SESSIONS); |
| 135 | 129 |
| 136 bool sync_apps; | 130 bool sync_apps; |
| 137 if (!result->GetBoolean("syncApps", &sync_apps)) | 131 if (!result->GetBoolean("syncApps", &sync_apps)) |
| 138 return false; | 132 return false; |
| 139 if (sync_apps) | 133 if (sync_apps) |
| (...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 271 { "syncAllDataTypes", IDS_SYNC_EVERYTHING }, | 265 { "syncAllDataTypes", IDS_SYNC_EVERYTHING }, |
| 272 { "chooseDataTypes", IDS_SYNC_CHOOSE_DATATYPES }, | 266 { "chooseDataTypes", IDS_SYNC_CHOOSE_DATATYPES }, |
| 273 { "bookmarks", IDS_SYNC_DATATYPE_BOOKMARKS }, | 267 { "bookmarks", IDS_SYNC_DATATYPE_BOOKMARKS }, |
| 274 { "preferences", IDS_SYNC_DATATYPE_PREFERENCES }, | 268 { "preferences", IDS_SYNC_DATATYPE_PREFERENCES }, |
| 275 { "autofill", IDS_SYNC_DATATYPE_AUTOFILL }, | 269 { "autofill", IDS_SYNC_DATATYPE_AUTOFILL }, |
| 276 { "themes", IDS_SYNC_DATATYPE_THEMES }, | 270 { "themes", IDS_SYNC_DATATYPE_THEMES }, |
| 277 { "passwords", IDS_SYNC_DATATYPE_PASSWORDS }, | 271 { "passwords", IDS_SYNC_DATATYPE_PASSWORDS }, |
| 278 { "extensions", IDS_SYNC_DATATYPE_EXTENSIONS }, | 272 { "extensions", IDS_SYNC_DATATYPE_EXTENSIONS }, |
| 279 { "typedURLs", IDS_SYNC_DATATYPE_TYPED_URLS }, | 273 { "typedURLs", IDS_SYNC_DATATYPE_TYPED_URLS }, |
| 280 { "apps", IDS_SYNC_DATATYPE_APPS }, | 274 { "apps", IDS_SYNC_DATATYPE_APPS }, |
| 281 { "searchEngines", IDS_SYNC_DATATYPE_SEARCH_ENGINES }, | |
| 282 { "openTabs", IDS_SYNC_DATATYPE_TABS }, | 275 { "openTabs", IDS_SYNC_DATATYPE_TABS }, |
| 283 { "syncZeroDataTypesError", IDS_SYNC_ZERO_DATA_TYPES_ERROR }, | 276 { "syncZeroDataTypesError", IDS_SYNC_ZERO_DATA_TYPES_ERROR }, |
| 284 { "serviceUnavailableError", IDS_SYNC_SETUP_ABORTED_BY_PENDING_CLEAR }, | 277 { "serviceUnavailableError", IDS_SYNC_SETUP_ABORTED_BY_PENDING_CLEAR }, |
| 285 { "encryptAllLabel", IDS_SYNC_ENCRYPT_ALL_LABEL }, | 278 { "encryptAllLabel", IDS_SYNC_ENCRYPT_ALL_LABEL }, |
| 286 { "googleOption", IDS_SYNC_PASSPHRASE_OPT_GOOGLE }, | 279 { "googleOption", IDS_SYNC_PASSPHRASE_OPT_GOOGLE }, |
| 287 { "explicitOption", IDS_SYNC_PASSPHRASE_OPT_EXPLICIT }, | 280 { "explicitOption", IDS_SYNC_PASSPHRASE_OPT_EXPLICIT }, |
| 288 { "sectionGoogleMessage", IDS_SYNC_PASSPHRASE_MSG_GOOGLE }, | 281 { "sectionGoogleMessage", IDS_SYNC_PASSPHRASE_MSG_GOOGLE }, |
| 289 { "sectionExplicitMessage", IDS_SYNC_PASSPHRASE_MSG_EXPLICIT }, | 282 { "sectionExplicitMessage", IDS_SYNC_PASSPHRASE_MSG_EXPLICIT }, |
| 290 { "passphraseLabel", IDS_SYNC_PASSPHRASE_LABEL }, | 283 { "passphraseLabel", IDS_SYNC_PASSPHRASE_LABEL }, |
| 291 { "confirmLabel", IDS_SYNC_CONFIRM_PASSPHRASE_LABEL }, | 284 { "confirmLabel", IDS_SYNC_CONFIRM_PASSPHRASE_LABEL }, |
| (...skipping 357 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 649 } | 642 } |
| 650 | 643 |
| 651 void SyncSetupHandler::ShowLoginErrorMessage(const string16& error_message) { | 644 void SyncSetupHandler::ShowLoginErrorMessage(const string16& error_message) { |
| 652 DictionaryValue args; | 645 DictionaryValue args; |
| 653 Profile* profile = Profile::FromWebUI(web_ui_); | 646 Profile* profile = Profile::FromWebUI(web_ui_); |
| 654 ProfileSyncService* service = profile->GetProfileSyncService(); | 647 ProfileSyncService* service = profile->GetProfileSyncService(); |
| 655 SyncSetupFlow::GetArgsForGaiaLogin(service, &args); | 648 SyncSetupFlow::GetArgsForGaiaLogin(service, &args); |
| 656 args.SetString("error_message", error_message); | 649 args.SetString("error_message", error_message); |
| 657 ShowGaiaLogin(args); | 650 ShowGaiaLogin(args); |
| 658 } | 651 } |
| OLD | NEW |