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

Unified Diff: chrome/browser/ui/webui/settings/chromeos/a11y_handler.cc

Issue 1785833002: Add 5 experimental accessibility features on Chrome OS. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Ported to md-settings too Created 4 years, 9 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/settings/chromeos/a11y_handler.cc
diff --git a/chrome/browser/ui/webui/settings/chromeos/a11y_handler.cc b/chrome/browser/ui/webui/settings/chromeos/a11y_handler.cc
new file mode 100644
index 0000000000000000000000000000000000000000..9a0067b232546945dae1399a6ac4bd6b396d2aa4
--- /dev/null
+++ b/chrome/browser/ui/webui/settings/chromeos/a11y_handler.cc
@@ -0,0 +1,42 @@
+// Copyright 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/settings/chromeos/a11y_handler.h"
+
+#include "base/bind.h"
+#include "base/command_line.h"
+#include "base/values.h"
+#include "chrome/browser/profiles/profile.h"
+#include "chromeos/chromeos_switches.h"
+#include "content/public/browser/web_ui.h"
+
+namespace chromeos {
+namespace settings {
+
+A11yHandler::A11yHandler(content::WebUI* webui)
+ : profile_(Profile::FromWebUI(webui)) {
+}
+
+A11yHandler::~A11yHandler() {
+}
+
+void A11yHandler::RegisterMessages() {
+ web_ui()->RegisterMessageCallback(
+ "initializeAccessibilityPage",
+ base::Bind(&A11yHandler::HandleInitialize,
+ base::Unretained(this)));
+}
+
+void A11yHandler::HandleInitialize(const base::ListValue* args) {
+ const base::FundamentalValue show_experimental_features(
+ base::CommandLine::ForCurrentProcess()->HasSwitch(
+ chromeos::switches::kEnableExperimentalAccessibilityFeatures));
Dan Beam 2016/03/11 22:07:20 can you just push this value into loadTimeData ins
+ web_ui()->CallJavascriptFunction(
+ "cr.webUIListenerCallback",
+ base::StringValue("show-experimental-features"),
+ show_experimental_features);
+}
+
+} // namespace settings
+} // namespace chromeos

Powered by Google App Engine
This is Rietveld 408576698