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

Side by Side 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 unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2016 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/settings/chromeos/a11y_handler.h"
6
7 #include "base/bind.h"
8 #include "base/command_line.h"
9 #include "base/values.h"
10 #include "chrome/browser/profiles/profile.h"
11 #include "chromeos/chromeos_switches.h"
12 #include "content/public/browser/web_ui.h"
13
14 namespace chromeos {
15 namespace settings {
16
17 A11yHandler::A11yHandler(content::WebUI* webui)
18 : profile_(Profile::FromWebUI(webui)) {
19 }
20
21 A11yHandler::~A11yHandler() {
22 }
23
24 void A11yHandler::RegisterMessages() {
25 web_ui()->RegisterMessageCallback(
26 "initializeAccessibilityPage",
27 base::Bind(&A11yHandler::HandleInitialize,
28 base::Unretained(this)));
29 }
30
31 void A11yHandler::HandleInitialize(const base::ListValue* args) {
32 const base::FundamentalValue show_experimental_features(
33 base::CommandLine::ForCurrentProcess()->HasSwitch(
34 chromeos::switches::kEnableExperimentalAccessibilityFeatures));
Dan Beam 2016/03/11 22:07:20 can you just push this value into loadTimeData ins
35 web_ui()->CallJavascriptFunction(
36 "cr.webUIListenerCallback",
37 base::StringValue("show-experimental-features"),
38 show_experimental_features);
39 }
40
41 } // namespace settings
42 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698