| 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 #ifdef CHROME_PERSONALIZATION | 5 #ifdef CHROME_PERSONALIZATION |
| 6 | 6 |
| 7 #include "chrome/browser/views/sync/sync_setup_wizard.h" | 7 #include "chrome/browser/views/sync/sync_setup_wizard.h" |
| 8 | 8 |
| 9 #include "app/resource_bundle.h" | 9 #include "app/resource_bundle.h" |
| 10 #include "base/message_loop.h" | 10 #include "base/message_loop.h" |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 45 ResourceBundle::GetSharedInstance().LoadImageResourceBytes(IDR_THROBBER, | 45 ResourceBundle::GetSharedInstance().LoadImageResourceBytes(IDR_THROBBER, |
| 46 &html_bytes->data); | 46 &html_bytes->data); |
| 47 SendResponse(request_id, html_bytes); | 47 SendResponse(request_id, html_bytes); |
| 48 return; | 48 return; |
| 49 } | 49 } |
| 50 | 50 |
| 51 std::string response; | 51 std::string response; |
| 52 if (path_raw == chrome::kSyncGaiaLoginPath) { | 52 if (path_raw == chrome::kSyncGaiaLoginPath) { |
| 53 DictionaryValue localized_strings; | 53 DictionaryValue localized_strings; |
| 54 localized_strings.SetString(L"settingupsync", | 54 localized_strings.SetString(L"settingupsync", |
| 55 "Setting up Bookmarks Sync"); | 55 l10n_util::GetString(IDS_SYNC_LOGIN_SETTING_UP_SYNC)); |
| 56 localized_strings.SetString(L"errorsigningin", "Error signing in"); | |
| 57 localized_strings.SetString(L"introduction", | 56 localized_strings.SetString(L"introduction", |
| 58 "Google Chrome can store your bookmark data with your Google account." | 57 l10n_util::GetString(IDS_SYNC_LOGIN_INTRODUCTION)); |
| 59 "Bookmarks that you create on this computer will instantly be made" | 58 localized_strings.SetString(L"signinprefix", |
| 60 "available on all the computers synced to this account."); | 59 l10n_util::GetString(IDS_SYNC_LOGIN_SIGNIN_PREFIX)); |
| 61 localized_strings.SetString(L"signinwithyour", "Sign in with your"); | 60 localized_strings.SetString(L"signinsuffix", |
| 62 localized_strings.SetString(L"accountlabel", "Account"); | 61 l10n_util::GetString(IDS_SYNC_LOGIN_SIGNIN_SUFFIX)); |
| 63 localized_strings.SetString(L"cannotbeblank", | 62 localized_strings.SetString(L"cannotbeblank", |
| 64 "Required field cannot be left blank"); | 63 l10n_util::GetString(IDS_SYNC_CANNOT_BE_BLANK)); |
| 65 localized_strings.SetString(L"passwordlabel", "Password:"); | 64 localized_strings.SetString(L"emaillabel", |
| 66 localized_strings.SetString(L"emaillabel", "Email:"); | 65 l10n_util::GetString(IDS_SYNC_LOGIN_EMAIL)); |
| 66 localized_strings.SetString(L"passwordlabel", |
| 67 l10n_util::GetString(IDS_SYNC_LOGIN_PASSWORD)); |
| 67 localized_strings.SetString(L"invalidcredentials", | 68 localized_strings.SetString(L"invalidcredentials", |
| 68 "Username and password do not match."); | 69 l10n_util::GetString(IDS_SYNC_INVALID_USER_CREDENTIALS)); |
| 70 localized_strings.SetString(L"signin", |
| 71 l10n_util::GetString(IDS_SYNC_SIGNIN)); |
| 69 localized_strings.SetString(L"couldnotconnect", | 72 localized_strings.SetString(L"couldnotconnect", |
| 70 "Could not connect to the server"); | 73 l10n_util::GetString(IDS_SYNC_LOGIN_COULD_NOT_CONNECT)); |
| 71 localized_strings.SetString(L"cannotaccessaccount", | 74 localized_strings.SetString(L"cannotaccessaccount", |
| 72 "I cannot access my account"); | 75 l10n_util::GetString(IDS_SYNC_CANNOT_ACCESS_ACCOUNT)); |
| 73 localized_strings.SetString(L"createaccount", | 76 localized_strings.SetString(L"createaccount", |
| 74 "Create a Google Account"); | 77 l10n_util::GetString(IDS_SYNC_CREATE_ACCOUNT)); |
| 75 | 78 localized_strings.SetString(L"cancel", |
| 79 l10n_util::GetString(IDS_CANCEL)); |
| 80 localized_strings.SetString(L"settingup", |
| 81 l10n_util::GetString(IDS_SYNC_LOGIN_SETTING_UP)); |
| 82 localized_strings.SetString(L"success", |
| 83 l10n_util::GetString(IDS_SYNC_LOGIN_SUCCESS)); |
| 84 localized_strings.SetString(L"errorsigningin", |
| 85 l10n_util::GetString(IDS_SYNC_ERROR_SIGNING_IN)); |
| 76 static const base::StringPiece html(ResourceBundle::GetSharedInstance() | 86 static const base::StringPiece html(ResourceBundle::GetSharedInstance() |
| 77 .GetRawDataResource(IDR_GAIA_LOGIN_HTML)); | 87 .GetRawDataResource(IDR_GAIA_LOGIN_HTML)); |
| 78 | 88 SetFontAndTextDirection(&localized_strings); |
| 79 response = jstemplate_builder::GetI18nTemplateHtml( | 89 response = jstemplate_builder::GetI18nTemplateHtml( |
| 80 html, &localized_strings); | 90 html, &localized_strings); |
| 81 } else if (path_raw == chrome::kSyncMergeAndSyncPath) { | 91 } else if (path_raw == chrome::kSyncMergeAndSyncPath) { |
| 82 DictionaryValue localized_strings; | 92 DictionaryValue localized_strings; |
| 93 localized_strings.SetString(L"introduction", |
| 94 l10n_util::GetString(IDS_SYNC_MERGE_INTRODUCTION)); |
| 95 localized_strings.SetString(L"mergeandsynclabel", |
| 96 l10n_util::GetString(IDS_SYNC_MERGE_AND_SYNC_LABEL)); |
| 97 localized_strings.SetString(L"abortlabel", |
| 98 l10n_util::GetString(IDS_ABORT)); |
| 99 localized_strings.SetString(L"closelabel", |
| 100 l10n_util::GetString(IDS_CLOSE)); |
| 101 localized_strings.SetString(L"alldone", |
| 102 l10n_util::GetString(IDS_SYNC_MERGE_ALL_DONE)); |
| 83 localized_strings.SetString(L"mergeandsyncwarning", | 103 localized_strings.SetString(L"mergeandsyncwarning", |
| 84 "Your existing online bookmarks will be merged with the " | 104 l10n_util::GetString(IDS_SYNC_MERGE_WARNING)); |
| 85 "bookmarks on this machine. You can use the Bookmark Manager to " | |
| 86 "organize your bookmarks after the merge."); | |
| 87 localized_strings.SetString(L"titlewarning", | |
| 88 "Your bookmarks will be merged."); | |
| 89 localized_strings.SetString(L"mergeandsynclabel", "Merge and sync"); | |
| 90 localized_strings.SetString(L"abortlabel", "Abort"); | |
| 91 localized_strings.SetString(L"alldone", "All Done!"); | |
| 92 localized_strings.SetString(L"closelabel", "Close"); | |
| 93 localized_strings.SetString(L"setuperror", | 105 localized_strings.SetString(L"setuperror", |
| 94 l10n_util::GetString(IDS_SYNC_SETUP_ERROR)); | 106 l10n_util::GetString(IDS_SYNC_SETUP_ERROR)); |
| 95 | 107 |
| 96 static const base::StringPiece html(ResourceBundle::GetSharedInstance() | 108 static const base::StringPiece html(ResourceBundle::GetSharedInstance() |
| 97 .GetRawDataResource(IDR_MERGE_AND_SYNC_HTML)); | 109 .GetRawDataResource(IDR_MERGE_AND_SYNC_HTML)); |
| 98 | 110 SetFontAndTextDirection(&localized_strings); |
| 99 response = jstemplate_builder::GetI18nTemplateHtml( | 111 response = jstemplate_builder::GetI18nTemplateHtml( |
| 100 html, &localized_strings); | 112 html, &localized_strings); |
| 101 } else if (path_raw == chrome::kSyncSetupFlowPath) { | 113 } else if (path_raw == chrome::kSyncSetupFlowPath) { |
| 102 static const base::StringPiece html(ResourceBundle::GetSharedInstance() | 114 static const base::StringPiece html(ResourceBundle::GetSharedInstance() |
| 103 .GetRawDataResource(IDR_SYNC_SETUP_FLOW_HTML)); | 115 .GetRawDataResource(IDR_SYNC_SETUP_FLOW_HTML)); |
| 104 response = html.as_string(); | 116 response = html.as_string(); |
| 105 } | 117 } |
| 106 // Send the response. | 118 // Send the response. |
| 107 html_bytes->data.resize(response.size()); | 119 html_bytes->data.resize(response.size()); |
| 108 std::copy(response.begin(), response.end(), html_bytes->data.begin()); | 120 std::copy(response.begin(), response.end(), html_bytes->data.begin()); |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 156 // static | 168 // static |
| 157 SyncSetupWizard::State SyncSetupWizard::GetEndStateForDiscreteRun( | 169 SyncSetupWizard::State SyncSetupWizard::GetEndStateForDiscreteRun( |
| 158 State start_state) { | 170 State start_state) { |
| 159 State result = start_state == GAIA_LOGIN ? GAIA_SUCCESS : DONE; | 171 State result = start_state == GAIA_LOGIN ? GAIA_SUCCESS : DONE; |
| 160 DCHECK_NE(DONE, result) << | 172 DCHECK_NE(DONE, result) << |
| 161 "Invalid start state for discrete run: " << start_state; | 173 "Invalid start state for discrete run: " << start_state; |
| 162 return result; | 174 return result; |
| 163 } | 175 } |
| 164 | 176 |
| 165 #endif // CHROME_PERSONALIZATION | 177 #endif // CHROME_PERSONALIZATION |
| OLD | NEW |