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

Side by Side Diff: chrome/browser/ui/webui/signin/sync_confirmation_ui.cc

Issue 1487283005: Implement the new Sync Confirmation dialog on Linux and Windows. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address feedback Created 4 years, 11 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
OLDNEW
(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/browser_process.h"
8 #include "chrome/browser/profiles/profile.h"
9 #include "chrome/browser/ui/webui/signin/sync_confirmation_handler.h"
10 #include "chrome/common/url_constants.h"
11 #include "chrome/grit/generated_resources.h"
12 #include "content/public/browser/web_ui.h"
13 #include "content/public/browser/web_ui_data_source.h"
14 #include "grit/browser_resources.h"
15 #include "ui/base/webui/web_ui_util.h"
16
17 SyncConfirmationUI::SyncConfirmationUI(content::WebUI* web_ui)
18 : WebDialogUI(web_ui) {
19 Profile* profile = Profile::FromWebUI(web_ui);
20 content::WebUIDataSource* source =
21 content::WebUIDataSource::Create(chrome::kChromeUISyncConfirmationHost);
22 source->SetJsonPath("strings.js");
23 source->SetDefaultResource(IDR_SYNC_CONFIRMATION_HTML);
24 source->AddResourcePath("sync_confirmation.css", IDR_SYNC_CONFIRMATION_CSS);
25 source->AddResourcePath("sync_confirmation.js", IDR_SYNC_CONFIRMATION_JS);
26
27 source->AddLocalizedString("syncConfirmationTitle",
28 IDS_SYNC_CONFIRMATION_TITLE);
29 source->AddLocalizedString("syncConfirmationBody",
30 IDS_SYNC_CONFIRMATION_BODY);
31 source->AddLocalizedString("syncConfirmationConfirmLabel",
32 IDS_SYNC_CONFIRMATION_CONFIRM_BUTTON_LABEL);
33 source->AddLocalizedString("syncConfirmationUndoLabel",
34 IDS_SYNC_CONFIRMATION_UNDO_BUTTON_LABEL);
35
36 base::DictionaryValue strings;
37 webui::SetLoadTimeDataDefaults(
38 g_browser_process->GetApplicationLocale(), &strings);
39 source->AddLocalizedStrings(strings);
40
41 content::WebUIDataSource::Add(profile, source);
42 web_ui->AddMessageHandler(new SyncConfirmationHandler);
43 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698