OLD | NEW |
---|---|
(Empty) | |
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 | |
3 // found in the LICENSE file. | |
4 | |
5 #include "chrome/browser/ui/webui/signin/sync_confirmation_ui.h" | |
6 | |
7 #include "chrome/browser/profiles/profile.h" | |
8 #include "chrome/browser/ui/webui/signin/sync_confirmation_handler.h" | |
9 #include "chrome/grit/generated_resources.h" | |
10 #include "content/public/browser/web_ui.h" | |
11 #include "content/public/browser/web_ui_data_source.h" | |
12 #include "grit/browser_resources.h" | |
13 | |
14 SyncConfirmationUI::SyncConfirmationUI(content::WebUI* web_ui) | |
15 : WebDialogUI(web_ui) { | |
16 Profile* profile = Profile::FromWebUI(web_ui); | |
17 content::WebUIDataSource* source = | |
18 content::WebUIDataSource::Create("sync-confirmation"); | |
19 source->SetJsonPath("strings.js"); | |
20 source->OverrideContentSecurityPolicyFrameSrc("frame-src chrome-extension:;"); | |
21 source->OverrideContentSecurityPolicyObjectSrc("object-src *;"); | |
Dan Beam
2016/01/13 23:45:22
^ I don't really know how CSP works, maybe this sh
anthonyvd
2016/01/18 21:40:08
I based this code on some other web ui since it wa
| |
22 source->SetDefaultResource(IDR_SYNC_CONFIRMATION_HTML); | |
23 source->AddResourcePath("sync-confirmation.css", IDR_SYNC_CONFIRMATION_CSS); | |
24 source->AddResourcePath("sync-confirmation.js", IDR_SYNC_CONFIRMATION_JS); | |
25 | |
26 source->AddLocalizedString("syncConfirmationTitle", | |
27 IDS_SYNC_CONFIRMATION_TITLE); | |
28 source->AddLocalizedString("syncConfirmationBody", | |
29 IDS_SYNC_CONFIRMATION_BODY); | |
30 source->AddLocalizedString("syncConfirmationConfirmLabel", | |
31 IDS_SYNC_CONFIRMATION_CONFIRM_BUTTON_LABEL); | |
32 source->AddLocalizedString("syncConfirmationUndoLabel", | |
33 IDS_SYNC_CONFIRMATION_UNDO_BUTTON_LABEL); | |
34 | |
35 content::WebUIDataSource::Add(profile, source); | |
36 web_ui->AddMessageHandler(new SyncConfirmationHandler); | |
37 } | |
OLD | NEW |