Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(285)

Side by Side Diff: chrome/browser/views/sync/sync_setup_wizard.cc

Issue 199083: Populate strings in gaia_login.html using jstemplates instead of literals.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/browser/sync/resources/gaia_login.html ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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"
11 #include "chrome/common/pref_names.h" 11 #include "chrome/common/pref_names.h"
12 #include "chrome/common/pref_service.h" 12 #include "chrome/common/pref_service.h"
13 #include "chrome/browser/browser_process.h" 13 #include "chrome/browser/browser_process.h"
14 #include "chrome/browser/dom_ui/chrome_url_data_manager.h" 14 #include "chrome/browser/dom_ui/chrome_url_data_manager.h"
15 #include "chrome/browser/sync/profile_sync_service.h" 15 #include "chrome/browser/sync/profile_sync_service.h"
16 #include "chrome/browser/views/sync/sync_setup_flow.h" 16 #include "chrome/browser/views/sync/sync_setup_flow.h"
17 #include "chrome/common/jstemplate_builder.h"
17 #include "chrome/common/url_constants.h" 18 #include "chrome/common/url_constants.h"
18 #include "grit/app_resources.h" 19 #include "grit/app_resources.h"
19 #include "grit/browser_resources.h" 20 #include "grit/browser_resources.h"
20 21
21 class SyncResourcesSource : public ChromeURLDataManager::DataSource { 22 class SyncResourcesSource : public ChromeURLDataManager::DataSource {
22 public: 23 public:
23 SyncResourcesSource() 24 SyncResourcesSource()
24 : DataSource(chrome::kSyncResourcesHost, MessageLoop::current()) { 25 : DataSource(chrome::kSyncResourcesHost, MessageLoop::current()) {
25 } 26 }
26 virtual ~SyncResourcesSource() { } 27 virtual ~SyncResourcesSource() { }
(...skipping 15 matching lines...) Expand all
42 scoped_refptr<RefCountedBytes> html_bytes(new RefCountedBytes); 43 scoped_refptr<RefCountedBytes> html_bytes(new RefCountedBytes);
43 if (path_raw == chrome::kSyncThrobberPath) { 44 if (path_raw == chrome::kSyncThrobberPath) {
44 ResourceBundle::GetSharedInstance().LoadImageResourceBytes(IDR_THROBBER, 45 ResourceBundle::GetSharedInstance().LoadImageResourceBytes(IDR_THROBBER,
45 &html_bytes->data); 46 &html_bytes->data);
46 SendResponse(request_id, html_bytes); 47 SendResponse(request_id, html_bytes);
47 return; 48 return;
48 } 49 }
49 50
50 std::string response; 51 std::string response;
51 if (path_raw == chrome::kSyncGaiaLoginPath) { 52 if (path_raw == chrome::kSyncGaiaLoginPath) {
53 DictionaryValue localized_strings;
54 localized_strings.SetString(L"settingupsync",
55 "Setting up Bookmarks Sync");
56 localized_strings.SetString(L"errorsigningin", "Error signing in");
57 localized_strings.SetString(L"introduction",
58 "Google Chrome can store your bookmark data with your Google account."
59 "Bookmarks that you create on this computer will instantly be made"
60 "available on all the computers synced to this account.");
61 localized_strings.SetString(L"signinwithyour", "Sign in with your");
62 localized_strings.SetString(L"accountlabel", "Account");
63 localized_strings.SetString(L"cannotbeblank",
64 "Required field cannot be left blank");
65 localized_strings.SetString(L"passwordlabel", "Password:");
66 localized_strings.SetString(L"emaillabel", "Email:");
67 localized_strings.SetString(L"invalidcredentials",
68 "Username and password do not match.");
69 localized_strings.SetString(L"couldnotconnect",
70 "Could not connect to the server");
71 localized_strings.SetString(L"cannotaccessaccount",
72 "I cannot access my account");
73 localized_strings.SetString(L"createaccount",
74 "Create a Google Account");
75
52 static const base::StringPiece html(ResourceBundle::GetSharedInstance() 76 static const base::StringPiece html(ResourceBundle::GetSharedInstance()
53 .GetRawDataResource(IDR_GAIA_LOGIN_HTML)); 77 .GetRawDataResource(IDR_GAIA_LOGIN_HTML));
54 response = html.as_string(); 78
79 response = jstemplate_builder::GetI18nTemplateHtml(
80 html, &localized_strings);
55 } else if (path_raw == chrome::kSyncMergeAndSyncPath) { 81 } else if (path_raw == chrome::kSyncMergeAndSyncPath) {
56 static const base::StringPiece html(ResourceBundle::GetSharedInstance() 82 static const base::StringPiece html(ResourceBundle::GetSharedInstance()
57 .GetRawDataResource(IDR_MERGE_AND_SYNC_HTML)); 83 .GetRawDataResource(IDR_MERGE_AND_SYNC_HTML));
58 response = html.as_string(); 84 response = html.as_string();
59 } else if (path_raw == chrome::kSyncSetupFlowPath) { 85 } else if (path_raw == chrome::kSyncSetupFlowPath) {
60 static const base::StringPiece html(ResourceBundle::GetSharedInstance() 86 static const base::StringPiece html(ResourceBundle::GetSharedInstance()
61 .GetRawDataResource(IDR_SYNC_SETUP_FLOW_HTML)); 87 .GetRawDataResource(IDR_SYNC_SETUP_FLOW_HTML));
62 response = html.as_string(); 88 response = html.as_string();
63 } 89 }
64 // Send the response. 90 // Send the response.
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
114 // static 140 // static
115 SyncSetupWizard::State SyncSetupWizard::GetEndStateForDiscreteRun( 141 SyncSetupWizard::State SyncSetupWizard::GetEndStateForDiscreteRun(
116 State start_state) { 142 State start_state) {
117 State result = start_state == GAIA_LOGIN ? GAIA_SUCCESS : DONE; 143 State result = start_state == GAIA_LOGIN ? GAIA_SUCCESS : DONE;
118 DCHECK_NE(DONE, result) << 144 DCHECK_NE(DONE, result) <<
119 "Invalid start state for discrete run: " << start_state; 145 "Invalid start state for discrete run: " << start_state;
120 return result; 146 return result;
121 } 147 }
122 148
123 #endif // CHROME_PERSONALIZATION 149 #endif // CHROME_PERSONALIZATION
OLDNEW
« no previous file with comments | « chrome/browser/sync/resources/gaia_login.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698