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); |
129 } else if (path_raw == chrome::kSyncSetupDonePath) { | 165 } else if (path_raw == chrome::kSyncSetupDonePath) { |
130 DictionaryValue localized_strings; | 166 DictionaryValue localized_strings; |
131 localized_strings.SetString(L"success", | 167 localized_strings.SetString(L"success", |
132 l10n_util::GetString(IDS_SYNC_SUCCESS)); | 168 l10n_util::GetString(IDS_SYNC_SUCCESS)); |
133 localized_strings.SetString(L"setupsummary", | 169 localized_strings.SetString(L"setupsummary", |
134 l10n_util::GetStringF(IDS_SYNC_SETUP_ALL_DONE, | 170 l10n_util::GetStringF(IDS_SYNC_SETUP_ALL_DONE, |
135 l10n_util::GetString(IDS_PRODUCT_NAME))); | 171 l10n_util::GetString(IDS_PRODUCT_NAME))); |
136 localized_strings.SetString(L"firsttimesetupsummary", | 172 localized_strings.SetString(L"firsttimesetupsummary", |
137 l10n_util::GetString(IDS_SYNC_SETUP_FIRST_TIME_ALL_DONE)); | 173 l10n_util::GetString(IDS_SYNC_SETUP_FIRST_TIME_ALL_DONE)); |
138 localized_strings.SetString(L"okay", | 174 localized_strings.SetString(L"okay", |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
215 void SyncSetupWizard::Focus() { | 251 void SyncSetupWizard::Focus() { |
216 SyncSetupFlow* flow = flow_container_->get_flow(); | 252 SyncSetupFlow* flow = flow_container_->get_flow(); |
217 if (flow) { | 253 if (flow) { |
218 flow->Focus(); | 254 flow->Focus(); |
219 } | 255 } |
220 } | 256 } |
221 | 257 |
222 // static | 258 // static |
223 SyncSetupWizard::State SyncSetupWizard::GetEndStateForDiscreteRun( | 259 SyncSetupWizard::State SyncSetupWizard::GetEndStateForDiscreteRun( |
224 State start_state) { | 260 State start_state) { |
225 State result = start_state == GAIA_LOGIN ? GAIA_SUCCESS : DONE; | 261 State result = FATAL_ERROR; |
226 DCHECK_NE(DONE, result) << | 262 if (start_state == GAIA_LOGIN) { |
| 263 result = GAIA_SUCCESS; |
| 264 } else if (start_state == CHOOSE_DATA_TYPES) { |
| 265 result = DONE; |
| 266 } |
| 267 DCHECK_NE(FATAL_ERROR, result) << |
227 "Invalid start state for discrete run: " << start_state; | 268 "Invalid start state for discrete run: " << start_state; |
228 return result; | 269 return result; |
229 } | 270 } |
OLD | NEW |