OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/ui/webui/signin/sync_confirmation_ui.h" | 5 #include "chrome/browser/ui/webui/signin/sync_confirmation_ui.h" |
6 | 6 |
7 #include "chrome/browser/browser_process.h" | 7 #include "chrome/browser/browser_process.h" |
8 #include "chrome/browser/profiles/profile.h" | 8 #include "chrome/browser/profiles/profile.h" |
9 #include "chrome/browser/ui/webui/signin/sync_confirmation_handler.h" | 9 #include "chrome/browser/ui/webui/signin/sync_confirmation_handler.h" |
10 #include "chrome/common/url_constants.h" | 10 #include "chrome/common/url_constants.h" |
11 #include "chrome/grit/generated_resources.h" | 11 #include "chrome/grit/generated_resources.h" |
12 #include "content/public/browser/web_ui.h" | 12 #include "content/public/browser/web_ui.h" |
13 #include "content/public/browser/web_ui_data_source.h" | 13 #include "content/public/browser/web_ui_data_source.h" |
14 #include "grit/browser_resources.h" | 14 #include "grit/browser_resources.h" |
15 #include "ui/base/webui/web_ui_util.h" | 15 #include "ui/base/webui/web_ui_util.h" |
16 | 16 |
17 SyncConfirmationUI::SyncConfirmationUI(content::WebUI* web_ui) | 17 SyncConfirmationUI::SyncConfirmationUI(content::WebUI* web_ui) |
18 : SyncConfirmationUI(web_ui, new SyncConfirmationHandler) {} | 18 : SyncConfirmationUI(web_ui, new SyncConfirmationHandler) {} |
19 | 19 |
20 SyncConfirmationUI::SyncConfirmationUI( | 20 SyncConfirmationUI::SyncConfirmationUI( |
21 content::WebUI* web_ui, SyncConfirmationHandler* handler) | 21 content::WebUI* web_ui, SyncConfirmationHandler* handler) |
22 : WebDialogUI(web_ui){ | 22 : WebDialogUI(web_ui) { |
23 Profile* profile = Profile::FromWebUI(web_ui); | 23 Profile* profile = Profile::FromWebUI(web_ui); |
24 content::WebUIDataSource* source = | 24 content::WebUIDataSource* source = |
25 content::WebUIDataSource::Create(chrome::kChromeUISyncConfirmationHost); | 25 content::WebUIDataSource::Create(chrome::kChromeUISyncConfirmationHost); |
26 source->SetJsonPath("strings.js"); | 26 source->SetJsonPath("strings.js"); |
27 source->SetDefaultResource(IDR_SYNC_CONFIRMATION_HTML); | 27 source->SetDefaultResource(IDR_SYNC_CONFIRMATION_HTML); |
28 source->AddResourcePath("sync_confirmation.css", IDR_SYNC_CONFIRMATION_CSS); | 28 source->AddResourcePath("sync_confirmation.css", IDR_SYNC_CONFIRMATION_CSS); |
29 source->AddResourcePath("sync_confirmation.js", IDR_SYNC_CONFIRMATION_JS); | 29 source->AddResourcePath("sync_confirmation.js", IDR_SYNC_CONFIRMATION_JS); |
30 | 30 |
31 source->AddLocalizedString("syncConfirmationTitle", | 31 source->AddLocalizedString("syncConfirmationTitle", |
32 IDS_SYNC_CONFIRMATION_TITLE); | 32 IDS_SYNC_CONFIRMATION_TITLE); |
33 source->AddLocalizedString("syncConfirmationBody", | 33 source->AddLocalizedString("syncConfirmationChromeSyncTitle", |
34 IDS_SYNC_CONFIRMATION_BODY); | 34 IDS_SYNC_CONFIRMATION_CHROME_SYNC_TITLE); |
| 35 source->AddLocalizedString("syncConfirmationChromeSyncBody", |
| 36 IDS_SYNC_CONFIRMATION_CHROME_SYNC_BODY); |
| 37 source->AddLocalizedString("syncConfirmationActivityControlsTitle", |
| 38 IDS_SYNC_CONFIRMATION_ACTIVITY_CONTROLS_TITLE); |
| 39 source->AddLocalizedString("syncConfirmationActivityControlsBody", |
| 40 IDS_SYNC_CONFIRMATION_ACTIVITY_CONTROLS_BODY); |
| 41 source->AddLocalizedString("syncConfirmationActivityControlsCheckboxLabel", |
| 42 IDS_SYNC_CONFIRMATION_ACTIVITY_CONTROLS_CHECKBOX_LABEL); |
35 source->AddLocalizedString("syncConfirmationConfirmLabel", | 43 source->AddLocalizedString("syncConfirmationConfirmLabel", |
36 IDS_SYNC_CONFIRMATION_CONFIRM_BUTTON_LABEL); | 44 IDS_SYNC_CONFIRMATION_CONFIRM_BUTTON_LABEL); |
37 source->AddLocalizedString("syncConfirmationUndoLabel", | 45 source->AddLocalizedString("syncConfirmationUndoLabel", |
38 IDS_SYNC_CONFIRMATION_UNDO_BUTTON_LABEL); | 46 IDS_SYNC_CONFIRMATION_UNDO_BUTTON_LABEL); |
39 | 47 |
40 base::DictionaryValue strings; | 48 base::DictionaryValue strings; |
41 webui::SetLoadTimeDataDefaults( | 49 webui::SetLoadTimeDataDefaults( |
42 g_browser_process->GetApplicationLocale(), &strings); | 50 g_browser_process->GetApplicationLocale(), &strings); |
43 source->AddLocalizedStrings(strings); | 51 source->AddLocalizedStrings(strings); |
44 | 52 |
45 content::WebUIDataSource::Add(profile, source); | 53 content::WebUIDataSource::Add(profile, source); |
46 web_ui->AddMessageHandler(handler); | 54 web_ui->AddMessageHandler(handler); |
47 } | 55 } |
OLD | NEW |