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

Unified Diff: chrome/browser/ui/webui/chromeos/hats/hats_ui.cc

Issue 2057853002: Opens the HaTS dialog with an empty HTML (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 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
Index: chrome/browser/ui/webui/chromeos/hats/hats_ui.cc
diff --git a/chrome/browser/ui/webui/chromeos/hats/hats_ui.cc b/chrome/browser/ui/webui/chromeos/hats/hats_ui.cc
new file mode 100644
index 0000000000000000000000000000000000000000..5bfb67660064338341c955bb2a5fe4e8b24790d9
--- /dev/null
+++ b/chrome/browser/ui/webui/chromeos/hats/hats_ui.cc
@@ -0,0 +1,40 @@
+// Copyright (c) 2016 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/chromeos/hats/hats_ui.h"
+
+#include "base/values.h"
+#include "chrome/browser/profiles/profile.h"
+#include "chrome/common/url_constants.h"
+#include "content/public/browser/web_ui.h"
+#include "content/public/browser/web_ui_data_source.h"
+#include "grit/browser_resources.h"
+
+using content::WebContents;
+using content::WebUIMessageHandler;
+
+namespace chromeos {
+
+HatsUI::HatsUI(content::WebUI* web_ui)
+ : WebDialogUI(web_ui) {
+ content::WebUIDataSource* source =
+ content::WebUIDataSource::Create(chrome::kChromeUIHatsHost);
+
+ source->SetDefaultResource(IDR_HATS_HTML);
+ source->DisableContentSecurityPolicy();
+
+ web_ui->RegisterMessageCallback("surveyCompleted",
+ base::Bind(&HatsUI::SurveyCompleted, base::Unretained(this)));
stevenjb 2016/06/10 01:08:16 We should at least add a "complete survey" button
malaykeshav 2016/06/10 01:18:32 Done. Removing for this CL.
+
+ Profile* profile = Profile::FromWebUI(web_ui);
stevenjb 2016/06/10 01:08:16 No need for local
malaykeshav 2016/06/10 01:18:32 Done
+ content::WebUIDataSource::Add(profile, source);
+}
+
+HatsUI::~HatsUI() {}
+
+void HatsUI::SurveyCompleted(const base::ListValue* args) {
+ CloseDialog(args);
+}
+
+} // namespace chromeos

Powered by Google App Engine
This is Rietveld 408576698