OLD | NEW |
---|---|
(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 | |
OLD | NEW |