OLD | NEW |
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/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 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
97 | 97 |
98 bool sync_autofill; | 98 bool sync_autofill; |
99 if (!result->GetBoolean("syncAutofill", &sync_autofill)) | 99 if (!result->GetBoolean("syncAutofill", &sync_autofill)) |
100 return false; | 100 return false; |
101 if (sync_autofill) | 101 if (sync_autofill) |
102 config->data_types.Put(syncable::AUTOFILL); | 102 config->data_types.Put(syncable::AUTOFILL); |
103 | 103 |
104 bool sync_extensions; | 104 bool sync_extensions; |
105 if (!result->GetBoolean("syncExtensions", &sync_extensions)) | 105 if (!result->GetBoolean("syncExtensions", &sync_extensions)) |
106 return false; | 106 return false; |
107 if (sync_extensions) { | 107 if (sync_extensions) |
108 config->data_types.Put(syncable::EXTENSIONS); | 108 config->data_types.Put(syncable::EXTENSIONS); |
109 config->data_types.Put(syncable::EXTENSION_SETTINGS); | |
110 } | |
111 | 109 |
112 bool sync_typed_urls; | 110 bool sync_typed_urls; |
113 if (!result->GetBoolean("syncTypedUrls", &sync_typed_urls)) | 111 if (!result->GetBoolean("syncTypedUrls", &sync_typed_urls)) |
114 return false; | 112 return false; |
115 if (sync_typed_urls) | 113 if (sync_typed_urls) |
116 config->data_types.Put(syncable::TYPED_URLS); | 114 config->data_types.Put(syncable::TYPED_URLS); |
117 | 115 |
118 bool sync_sessions; | 116 bool sync_sessions; |
119 if (!result->GetBoolean("syncSessions", &sync_sessions)) | 117 if (!result->GetBoolean("syncSessions", &sync_sessions)) |
120 return false; | 118 return false; |
121 if (sync_sessions) | 119 if (sync_sessions) |
122 config->data_types.Put(syncable::SESSIONS); | 120 config->data_types.Put(syncable::SESSIONS); |
123 | 121 |
124 bool sync_apps; | 122 bool sync_apps; |
125 if (!result->GetBoolean("syncApps", &sync_apps)) | 123 if (!result->GetBoolean("syncApps", &sync_apps)) |
126 return false; | 124 return false; |
127 if (sync_apps) { | 125 if (sync_apps) |
128 config->data_types.Put(syncable::APPS); | 126 config->data_types.Put(syncable::APPS); |
129 config->data_types.Put(syncable::APP_SETTINGS); | |
130 } | |
131 | 127 |
132 // Encryption settings. | 128 // Encryption settings. |
133 if (!result->GetBoolean("encryptAllData", &config->encrypt_all)) | 129 if (!result->GetBoolean("encryptAllData", &config->encrypt_all)) |
134 return false; | 130 return false; |
135 | 131 |
136 // Passphrase settings. | 132 // Passphrase settings. |
137 bool have_passphrase; | 133 bool have_passphrase; |
138 if (!result->GetBoolean("usePassphrase", &have_passphrase)) | 134 if (!result->GetBoolean("usePassphrase", &have_passphrase)) |
139 return false; | 135 return false; |
140 | 136 |
(...skipping 647 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
788 if (i != current_profile_index && AreUserNamesEqual( | 784 if (i != current_profile_index && AreUserNamesEqual( |
789 cache.GetUserNameOfProfileAtIndex(i), username_utf16)) { | 785 cache.GetUserNameOfProfileAtIndex(i), username_utf16)) { |
790 *error_message = l10n_util::GetStringUTF16( | 786 *error_message = l10n_util::GetStringUTF16( |
791 IDS_SYNC_USER_NAME_IN_USE_ERROR); | 787 IDS_SYNC_USER_NAME_IN_USE_ERROR); |
792 return false; | 788 return false; |
793 } | 789 } |
794 } | 790 } |
795 | 791 |
796 return true; | 792 return true; |
797 } | 793 } |
OLD | NEW |