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

Side by Side Diff: content/browser/accessibility/accessibility_ui.cc

Issue 599653003: Remove old template html boilerplate (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@bydefault
Patch Set: fix android Created 6 years, 2 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
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/browser/accessibility/accessibility_ui.h" 5 #include "content/browser/accessibility/accessibility_ui.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/bind_helpers.h" 8 #include "base/bind_helpers.h"
9 #include "base/json/json_writer.h" 9 #include "base/json/json_writer.h"
10 #include "base/strings/string_number_conversions.h" 10 #include "base/strings/string_number_conversions.h"
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after
127 callback.Run(base::RefCountedString::TakeString(&json_string)); 127 callback.Run(base::RefCountedString::TakeString(&json_string));
128 return true; 128 return true;
129 } 129 }
130 130
131 } // namespace 131 } // namespace
132 132
133 AccessibilityUI::AccessibilityUI(WebUI* web_ui) : WebUIController(web_ui) { 133 AccessibilityUI::AccessibilityUI(WebUI* web_ui) : WebUIController(web_ui) {
134 // Set up the chrome://accessibility source. 134 // Set up the chrome://accessibility source.
135 WebUIDataSource* html_source = 135 WebUIDataSource* html_source =
136 WebUIDataSource::Create(kChromeUIAccessibilityHost); 136 WebUIDataSource::Create(kChromeUIAccessibilityHost);
137 html_source->SetUseJsonJSFormatV2();
138 137
139 web_ui->RegisterMessageCallback( 138 web_ui->RegisterMessageCallback(
140 "toggleAccessibility", 139 "toggleAccessibility",
141 base::Bind(&AccessibilityUI::ToggleAccessibility, 140 base::Bind(&AccessibilityUI::ToggleAccessibility,
142 base::Unretained(this))); 141 base::Unretained(this)));
143 web_ui->RegisterMessageCallback( 142 web_ui->RegisterMessageCallback(
144 "toggleGlobalAccessibility", 143 "toggleGlobalAccessibility",
145 base::Bind(&AccessibilityUI::ToggleGlobalAccessibility, 144 base::Bind(&AccessibilityUI::ToggleGlobalAccessibility,
146 base::Unretained(this))); 145 base::Unretained(this)));
147 web_ui->RegisterMessageCallback( 146 web_ui->RegisterMessageCallback(
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
233 formatter->SetFilters(filters); 232 formatter->SetFilters(filters);
234 formatter->FormatAccessibilityTree(&accessibility_contents_utf16); 233 formatter->FormatAccessibilityTree(&accessibility_contents_utf16);
235 234
236 result->Set("tree", 235 result->Set("tree",
237 new base::StringValue( 236 new base::StringValue(
238 base::UTF16ToUTF8(accessibility_contents_utf16))); 237 base::UTF16ToUTF8(accessibility_contents_utf16)));
239 web_ui()->CallJavascriptFunction("accessibility.showTree", *(result.get())); 238 web_ui()->CallJavascriptFunction("accessibility.showTree", *(result.get()));
240 } 239 }
241 240
242 } // namespace content 241 } // namespace content
OLDNEW
« no previous file with comments | « components/dom_distiller/webui/dom_distiller_ui.cc ('k') | content/browser/indexed_db/indexed_db_internals_ui.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698