| 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 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 "Setting up Bookmarks Sync"); |
| 56 localized_strings.SetString(L"errorsigningin", "Error signing in"); | 56 localized_strings.SetString(L"errorsigningin", "Error signing in"); |
| 57 localized_strings.SetString(L"introduction", | 57 localized_strings.SetString(L"introduction", |
| 58 "Google Chrome can store your bookmark data with your Google account." | 58 "Google Chrome can store your bookmark data with your Google account." |
| 59 "Bookmarks that you create on this computer will instantly be made" | 59 "Bookmarks that you create on this computer will instantly be made" |
| 60 "available on all the computers synced to this account."); | 60 "available on all the computers synced to this account."); |
| 61 localized_strings.SetString(L"signinwithyour", "Sign in with your"); | 61 localized_strings.SetString(L"signinwithyour", "Sign in with your"); |
| 62 localized_strings.SetString(L"accountlabel", "Account"); | 62 localized_strings.SetString(L"accountlabel", "Account"); |
| 63 localized_strings.SetString(L"cannotbeblank", | 63 localized_strings.SetString(L"cannotbeblank", |
| 64 "Required field cannot be left blank"); | 64 "Required field cannot be left blank"); |
| 65 localized_strings.SetString(L"passwordlabel", "Password:"); | 65 localized_strings.SetString(L"passwordlabel", "Password:"); |
| 66 localized_strings.SetString(L"emaillabel", "Email:"); | 66 localized_strings.SetString(L"emaillabel", "Email:"); |
| 67 localized_strings.SetString(L"invalidcredentials", | 67 localized_strings.SetString(L"invalidcredentials", |
| 68 "Username and password do not match."); | 68 "Username and password do not match."); |
| 69 localized_strings.SetString(L"couldnotconnect", | 69 localized_strings.SetString(L"couldnotconnect", |
| 70 "Could not connect to the server"); | 70 "Could not connect to the server"); |
| 71 localized_strings.SetString(L"cannotaccessaccount", | 71 localized_strings.SetString(L"cannotaccessaccount", |
| 72 "I cannot access my account"); | 72 "I cannot access my account"); |
| 73 localized_strings.SetString(L"createaccount", | 73 localized_strings.SetString(L"createaccount", |
| 74 "Create a Google Account"); | 74 "Create a Google Account"); |
| 75 | 75 |
| 76 static const base::StringPiece html(ResourceBundle::GetSharedInstance() | 76 static const base::StringPiece html(ResourceBundle::GetSharedInstance() |
| 77 .GetRawDataResource(IDR_GAIA_LOGIN_HTML)); | 77 .GetRawDataResource(IDR_GAIA_LOGIN_HTML)); |
| 78 | 78 |
| 79 response = jstemplate_builder::GetI18nTemplateHtml( | 79 response = jstemplate_builder::GetI18nTemplateHtml( |
| 80 html, &localized_strings); | 80 html, &localized_strings); |
| 81 } else if (path_raw == chrome::kSyncMergeAndSyncPath) { | 81 } else if (path_raw == chrome::kSyncMergeAndSyncPath) { |
| 82 DictionaryValue localized_strings; |
| 83 localized_strings.SetString(L"mergeandsyncwarning", |
| 84 "Your existing online bookmarks will be merged with the " |
| 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 |
| 82 static const base::StringPiece html(ResourceBundle::GetSharedInstance() | 94 static const base::StringPiece html(ResourceBundle::GetSharedInstance() |
| 83 .GetRawDataResource(IDR_MERGE_AND_SYNC_HTML)); | 95 .GetRawDataResource(IDR_MERGE_AND_SYNC_HTML)); |
| 84 response = html.as_string(); | 96 |
| 97 response = jstemplate_builder::GetI18nTemplateHtml( |
| 98 html, &localized_strings); |
| 85 } else if (path_raw == chrome::kSyncSetupFlowPath) { | 99 } else if (path_raw == chrome::kSyncSetupFlowPath) { |
| 86 static const base::StringPiece html(ResourceBundle::GetSharedInstance() | 100 static const base::StringPiece html(ResourceBundle::GetSharedInstance() |
| 87 .GetRawDataResource(IDR_SYNC_SETUP_FLOW_HTML)); | 101 .GetRawDataResource(IDR_SYNC_SETUP_FLOW_HTML)); |
| 88 response = html.as_string(); | 102 response = html.as_string(); |
| 89 } | 103 } |
| 90 // Send the response. | 104 // Send the response. |
| 91 html_bytes->data.resize(response.size()); | 105 html_bytes->data.resize(response.size()); |
| 92 std::copy(response.begin(), response.end(), html_bytes->data.begin()); | 106 std::copy(response.begin(), response.end(), html_bytes->data.begin()); |
| 93 SendResponse(request_id, html_bytes); | 107 SendResponse(request_id, html_bytes); |
| 94 } | 108 } |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 140 // static | 154 // static |
| 141 SyncSetupWizard::State SyncSetupWizard::GetEndStateForDiscreteRun( | 155 SyncSetupWizard::State SyncSetupWizard::GetEndStateForDiscreteRun( |
| 142 State start_state) { | 156 State start_state) { |
| 143 State result = start_state == GAIA_LOGIN ? GAIA_SUCCESS : DONE; | 157 State result = start_state == GAIA_LOGIN ? GAIA_SUCCESS : DONE; |
| 144 DCHECK_NE(DONE, result) << | 158 DCHECK_NE(DONE, result) << |
| 145 "Invalid start state for discrete run: " << start_state; | 159 "Invalid start state for discrete run: " << start_state; |
| 146 return result; | 160 return result; |
| 147 } | 161 } |
| 148 | 162 |
| 149 #endif // CHROME_PERSONALIZATION | 163 #endif // CHROME_PERSONALIZATION |
| OLD | NEW |