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

Side by Side Diff: chrome/browser/accessibility/accessibility_events.cc

Issue 79543010: Added basic accessibility to TreeView. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 1 month 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "chrome/browser/accessibility/accessibility_events.h" 5 #include "chrome/browser/accessibility/accessibility_events.h"
6 6
7 #include "base/values.h" 7 #include "base/values.h"
8 #include "chrome/browser/accessibility/accessibility_extension_api.h" 8 #include "chrome/browser/accessibility/accessibility_extension_api.h"
9 #include "chrome/browser/accessibility/accessibility_extension_api_constants.h" 9 #include "chrome/browser/accessibility/accessibility_extension_api_constants.h"
10 #include "chrome/browser/chrome_notification_types.h" 10 #include "chrome/browser/chrome_notification_types.h"
(...skipping 247 matching lines...) Expand 10 before | Expand all | Expand 10 after
258 return keys::kTypeMenuItem; 258 return keys::kTypeMenuItem;
259 } 259 }
260 260
261 void AccessibilityMenuItemInfo::SerializeToDict(DictionaryValue *dict) const { 261 void AccessibilityMenuItemInfo::SerializeToDict(DictionaryValue *dict) const {
262 AccessibilityControlInfo::SerializeToDict(dict); 262 AccessibilityControlInfo::SerializeToDict(dict);
263 dict->SetBoolean(keys::kHasSubmenuKey, has_submenu_); 263 dict->SetBoolean(keys::kHasSubmenuKey, has_submenu_);
264 dict->SetInteger(keys::kItemIndexKey, item_index_); 264 dict->SetInteger(keys::kItemIndexKey, item_index_);
265 dict->SetInteger(keys::kItemCountKey, item_count_); 265 dict->SetInteger(keys::kItemCountKey, item_count_);
266 } 266 }
267 267
268 AccessibilityTreeInfo::AccessibilityTreeInfo(Profile* profile,
269 const std::string& menu_name)
David Tseng 2013/11/23 02:45:15 nit: tree_name
270 : AccessibilityControlInfo(profile, menu_name) {
271 }
272
273 const char* AccessibilityTreeInfo::type() const {
274 return keys::kTypeTree;
275 }
276
277 AccessibilityTreeItemInfo::AccessibilityTreeItemInfo(Profile* profile,
278 const std::string& name,
279 const std::string& context,
280 int item_depth,
281 int item_index,
282 int item_count,
283 int children_count,
284 bool is_expanded)
285 : AccessibilityControlInfo(profile, name),
286 item_depth_(item_depth),
287 item_index_(item_index),
288 item_count_(item_count),
289 children_count_(children_count),
290 is_expanded_(is_expanded) {
291 set_context(context);
292 }
293
294 const char* AccessibilityTreeItemInfo::type() const {
295 return keys::kTypeTreeItem;
296 }
297
298 void AccessibilityTreeItemInfo::SerializeToDict(DictionaryValue *dict) const {
299 AccessibilityControlInfo::SerializeToDict(dict);
300 dict->SetInteger(keys::kItemDepthKey, item_depth_);
301 dict->SetInteger(keys::kItemIndexKey, item_index_);
302 dict->SetInteger(keys::kItemCountKey, item_count_);
303 dict->SetInteger(keys::kChildrenCountKey, children_count_);
304 dict->SetBoolean(keys::kItemExpandedKey, is_expanded_);
305 }
306
268 AccessibilitySliderInfo::AccessibilitySliderInfo(Profile* profile, 307 AccessibilitySliderInfo::AccessibilitySliderInfo(Profile* profile,
269 const std::string& name, 308 const std::string& name,
270 const std::string& context, 309 const std::string& context,
271 const std::string& value) 310 const std::string& value)
272 : AccessibilityControlInfo(profile, name), 311 : AccessibilityControlInfo(profile, name),
273 value_(value) { 312 value_(value) {
274 set_context(context); 313 set_context(context);
275 } 314 }
276 315
277 const char* AccessibilitySliderInfo::type() const { 316 const char* AccessibilitySliderInfo::type() const {
278 return keys::kTypeSlider; 317 return keys::kTypeSlider;
279 } 318 }
280 319
281 void AccessibilitySliderInfo::SerializeToDict(DictionaryValue *dict) const { 320 void AccessibilitySliderInfo::SerializeToDict(DictionaryValue *dict) const {
282 AccessibilityControlInfo::SerializeToDict(dict); 321 AccessibilityControlInfo::SerializeToDict(dict);
283 dict->SetString(keys::kStringValueKey, value_); 322 dict->SetString(keys::kStringValueKey, value_);
284 } 323 }
285 324
286 AccessibilityAlertInfo::AccessibilityAlertInfo(Profile* profile, 325 AccessibilityAlertInfo::AccessibilityAlertInfo(Profile* profile,
287 const std::string& name) 326 const std::string& name)
288 : AccessibilityControlInfo(profile, name) { 327 : AccessibilityControlInfo(profile, name) {
289 } 328 }
290 329
291 const char* AccessibilityAlertInfo::type() const { 330 const char* AccessibilityAlertInfo::type() const {
292 return keys::kTypeAlert; 331 return keys::kTypeAlert;
293 } 332 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698