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

Unified 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: Fix Mac/ChromeOS builds and iOS tests. 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/ui/webui/signin/sync_confirmation_ui.h ('k') | chrome/chrome_browser_ui.gypi » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/webui/signin/sync_confirmation_ui.cc
diff --git a/chrome/browser/ui/webui/signin/sync_confirmation_ui.cc b/chrome/browser/ui/webui/signin/sync_confirmation_ui.cc
new file mode 100644
index 0000000000000000000000000000000000000000..f1ede0ab977ffb4dd54d16fce42fdaf08cba7cd0
--- /dev/null
+++ b/chrome/browser/ui/webui/signin/sync_confirmation_ui.cc
@@ -0,0 +1,47 @@
+// Copyright 2015 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "chrome/browser/ui/webui/signin/sync_confirmation_ui.h"
+
+#include "chrome/browser/browser_process.h"
+#include "chrome/browser/profiles/profile.h"
+#include "chrome/browser/ui/webui/signin/sync_confirmation_handler.h"
+#include "chrome/common/url_constants.h"
+#include "chrome/grit/generated_resources.h"
+#include "content/public/browser/web_ui.h"
+#include "content/public/browser/web_ui_data_source.h"
+#include "grit/browser_resources.h"
+#include "ui/base/webui/web_ui_util.h"
+
+SyncConfirmationUI::SyncConfirmationUI(content::WebUI* web_ui)
+ : SyncConfirmationUI(web_ui, new SyncConfirmationHandler) {}
+
+SyncConfirmationUI::SyncConfirmationUI(
+ content::WebUI* web_ui, SyncConfirmationHandler* handler)
+ : WebDialogUI(web_ui){
+ Profile* profile = Profile::FromWebUI(web_ui);
+ content::WebUIDataSource* source =
+ content::WebUIDataSource::Create(chrome::kChromeUISyncConfirmationHost);
+ source->SetJsonPath("strings.js");
+ source->SetDefaultResource(IDR_SYNC_CONFIRMATION_HTML);
+ source->AddResourcePath("sync_confirmation.css", IDR_SYNC_CONFIRMATION_CSS);
+ source->AddResourcePath("sync_confirmation.js", IDR_SYNC_CONFIRMATION_JS);
+
+ source->AddLocalizedString("syncConfirmationTitle",
+ IDS_SYNC_CONFIRMATION_TITLE);
+ source->AddLocalizedString("syncConfirmationBody",
+ IDS_SYNC_CONFIRMATION_BODY);
+ source->AddLocalizedString("syncConfirmationConfirmLabel",
+ IDS_SYNC_CONFIRMATION_CONFIRM_BUTTON_LABEL);
+ source->AddLocalizedString("syncConfirmationUndoLabel",
+ IDS_SYNC_CONFIRMATION_UNDO_BUTTON_LABEL);
+
+ base::DictionaryValue strings;
+ webui::SetLoadTimeDataDefaults(
+ g_browser_process->GetApplicationLocale(), &strings);
+ source->AddLocalizedStrings(strings);
+
+ content::WebUIDataSource::Add(profile, source);
+ web_ui->AddMessageHandler(handler);
+}
« no previous file with comments | « chrome/browser/ui/webui/signin/sync_confirmation_ui.h ('k') | chrome/chrome_browser_ui.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698