| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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/sync/sync_setup_wizard.h" | 5 #include "chrome/browser/sync/sync_setup_wizard.h" |
| 6 | 6 |
| 7 #include "app/resource_bundle.h" | 7 #include "app/resource_bundle.h" |
| 8 #include "base/message_loop.h" | 8 #include "base/message_loop.h" |
| 9 #include "base/singleton.h" | 9 #include "base/singleton.h" |
| 10 #include "chrome/browser/chrome_thread.h" | 10 #include "chrome/browser/chrome_thread.h" |
| (...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 119 l10n_util::GetString(IDS_SYNC_SUCCESS)); | 119 l10n_util::GetString(IDS_SYNC_SUCCESS)); |
| 120 localized_strings.SetString(L"errorsigningin", | 120 localized_strings.SetString(L"errorsigningin", |
| 121 l10n_util::GetString(IDS_SYNC_ERROR_SIGNING_IN)); | 121 l10n_util::GetString(IDS_SYNC_ERROR_SIGNING_IN)); |
| 122 localized_strings.SetString(L"captchainstructions", | 122 localized_strings.SetString(L"captchainstructions", |
| 123 l10n_util::GetString(IDS_SYNC_GAIA_CAPTCHA_INSTRUCTIONS)); | 123 l10n_util::GetString(IDS_SYNC_GAIA_CAPTCHA_INSTRUCTIONS)); |
| 124 static const base::StringPiece html(ResourceBundle::GetSharedInstance() | 124 static const base::StringPiece html(ResourceBundle::GetSharedInstance() |
| 125 .GetRawDataResource(IDR_GAIA_LOGIN_HTML)); | 125 .GetRawDataResource(IDR_GAIA_LOGIN_HTML)); |
| 126 SetFontAndTextDirection(&localized_strings); | 126 SetFontAndTextDirection(&localized_strings); |
| 127 response = jstemplate_builder::GetI18nTemplateHtml( | 127 response = jstemplate_builder::GetI18nTemplateHtml( |
| 128 html, &localized_strings); | 128 html, &localized_strings); |
| 129 } else if (path_raw == chrome::kSyncChooseDataTypesPath) { | |
| 130 DictionaryValue localized_strings; | |
| 131 localized_strings.SetString(L"choosedatatypesheader", | |
| 132 l10n_util::GetString(IDS_SYNC_CHOOSE_DATATYPES_HEADER)); | |
| 133 localized_strings.SetString(L"choosedatatypesinstructions", | |
| 134 l10n_util::GetStringF(IDS_SYNC_CHOOSE_DATATYPES_INSTRUCTIONS, | |
| 135 l10n_util::GetString(IDS_PRODUCT_NAME))); | |
| 136 localized_strings.SetString(L"keepeverythingsynced", | |
| 137 l10n_util::GetString(IDS_SYNC_EVERYTHING)); | |
| 138 localized_strings.SetString(L"choosedatatypes", | |
| 139 l10n_util::GetString(IDS_SYNC_CHOOSE_DATATYPES)); | |
| 140 localized_strings.SetString(L"bookmarks", | |
| 141 l10n_util::GetString(IDS_SYNC_DATATYPE_BOOKMARKS)); | |
| 142 localized_strings.SetString(L"preferences", | |
| 143 l10n_util::GetString(IDS_SYNC_DATATYPE_PREFERENCES)); | |
| 144 localized_strings.SetString(L"autofill", | |
| 145 l10n_util::GetString(IDS_SYNC_DATATYPE_AUTOFILL)); | |
| 146 localized_strings.SetString(L"themes", | |
| 147 l10n_util::GetString(IDS_SYNC_DATATYPE_THEMES)); | |
| 148 localized_strings.SetString(L"passwords", | |
| 149 l10n_util::GetString(IDS_SYNC_DATATYPE_PASSWORDS)); | |
| 150 localized_strings.SetString(L"extensions", | |
| 151 l10n_util::GetString(IDS_SYNC_DATATYPE_EXTENSIONS)); | |
| 152 localized_strings.SetString(L"typedurls", | |
| 153 l10n_util::GetString(IDS_SYNC_DATATYPE_TYPED_URLS)); | |
| 154 localized_strings.SetString(L"ok", | |
| 155 l10n_util::GetString(IDS_OK)); | |
| 156 localized_strings.SetString(L"cancel", | |
| 157 l10n_util::GetString(IDS_CANCEL)); | |
| 158 localized_strings.SetString(L"settingup", | |
| 159 l10n_util::GetString(IDS_SYNC_LOGIN_SETTING_UP)); | |
| 160 static const base::StringPiece html(ResourceBundle::GetSharedInstance() | |
| 161 .GetRawDataResource(IDR_SYNC_CHOOSE_DATATYPES_HTML)); | |
| 162 SetFontAndTextDirection(&localized_strings); | |
| 163 response = jstemplate_builder::GetI18nTemplateHtml( | |
| 164 html, &localized_strings); | |
| 165 } else if (path_raw == chrome::kSyncSetupDonePath) { | 129 } else if (path_raw == chrome::kSyncSetupDonePath) { |
| 166 DictionaryValue localized_strings; | 130 DictionaryValue localized_strings; |
| 167 localized_strings.SetString(L"success", | 131 localized_strings.SetString(L"success", |
| 168 l10n_util::GetString(IDS_SYNC_SUCCESS)); | 132 l10n_util::GetString(IDS_SYNC_SUCCESS)); |
| 169 localized_strings.SetString(L"setupsummary", | 133 localized_strings.SetString(L"setupsummary", |
| 170 l10n_util::GetStringF(IDS_SYNC_SETUP_ALL_DONE, | 134 l10n_util::GetStringF(IDS_SYNC_SETUP_ALL_DONE, |
| 171 l10n_util::GetString(IDS_PRODUCT_NAME))); | 135 l10n_util::GetString(IDS_PRODUCT_NAME))); |
| 172 localized_strings.SetString(L"firsttimesetupsummary", | 136 localized_strings.SetString(L"firsttimesetupsummary", |
| 173 l10n_util::GetString(IDS_SYNC_SETUP_FIRST_TIME_ALL_DONE)); | 137 l10n_util::GetString(IDS_SYNC_SETUP_FIRST_TIME_ALL_DONE)); |
| 174 localized_strings.SetString(L"okay", | 138 localized_strings.SetString(L"okay", |
| (...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 251 void SyncSetupWizard::Focus() { | 215 void SyncSetupWizard::Focus() { |
| 252 SyncSetupFlow* flow = flow_container_->get_flow(); | 216 SyncSetupFlow* flow = flow_container_->get_flow(); |
| 253 if (flow) { | 217 if (flow) { |
| 254 flow->Focus(); | 218 flow->Focus(); |
| 255 } | 219 } |
| 256 } | 220 } |
| 257 | 221 |
| 258 // static | 222 // static |
| 259 SyncSetupWizard::State SyncSetupWizard::GetEndStateForDiscreteRun( | 223 SyncSetupWizard::State SyncSetupWizard::GetEndStateForDiscreteRun( |
| 260 State start_state) { | 224 State start_state) { |
| 261 State result = FATAL_ERROR; | 225 State result = start_state == GAIA_LOGIN ? GAIA_SUCCESS : DONE; |
| 262 if (start_state == GAIA_LOGIN) { | 226 DCHECK_NE(DONE, result) << |
| 263 result = GAIA_SUCCESS; | |
| 264 } else if (start_state == CHOOSE_DATA_TYPES) { | |
| 265 result = DONE; | |
| 266 } | |
| 267 DCHECK_NE(FATAL_ERROR, result) << | |
| 268 "Invalid start state for discrete run: " << start_state; | 227 "Invalid start state for discrete run: " << start_state; |
| 269 return result; | 228 return result; |
| 270 } | 229 } |
| OLD | NEW |