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

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

Issue 79543010: Added basic accessibility to TreeView. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years 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
« no previous file with comments | « no previous file | chrome/browser/accessibility/accessibility_events.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 #ifndef CHROME_BROWSER_ACCESSIBILITY_ACCESSIBILITY_EVENTS_H_ 5 #ifndef CHROME_BROWSER_ACCESSIBILITY_ACCESSIBILITY_EVENTS_H_
6 #define CHROME_BROWSER_ACCESSIBILITY_ACCESSIBILITY_EVENTS_H_ 6 #define CHROME_BROWSER_ACCESSIBILITY_ACCESSIBILITY_EVENTS_H_
7 7
8 #include <string> 8 #include <string>
9 #include "base/compiler_specific.h" 9 #include "base/compiler_specific.h"
10 #include "ui/base/accessibility/accessibility_types.h" 10 #include "ui/base/accessibility/accessibility_types.h"
(...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after
218 218
219 private: 219 private:
220 std::string value_; 220 std::string value_;
221 // The 0-based index of the current item and the number of total items. 221 // The 0-based index of the current item and the number of total items.
222 // If the value is not one of the drop-down options, |item_index_| should 222 // If the value is not one of the drop-down options, |item_index_| should
223 // be -1. 223 // be -1.
224 int item_index_; 224 int item_index_;
225 int item_count_; 225 int item_count_;
226 }; 226 };
227 227
228
228 // Accessibility information about a text box, passed to onControlFocused, 229 // Accessibility information about a text box, passed to onControlFocused,
229 // onControlAction, and onTextChanged event listeners. 230 // onControlAction, and onTextChanged event listeners.
230 class AccessibilityTextBoxInfo : public AccessibilityControlInfo { 231 class AccessibilityTextBoxInfo : public AccessibilityControlInfo {
231 public: 232 public:
232 AccessibilityTextBoxInfo(Profile* profile, 233 AccessibilityTextBoxInfo(Profile* profile,
233 const std::string& name, 234 const std::string& name,
234 const std::string& context, 235 const std::string& context,
235 bool password); 236 bool password);
236 237
237 virtual const char* type() const OVERRIDE; 238 virtual const char* type() const OVERRIDE;
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
318 int item_count() const { return item_count_; } 319 int item_count() const { return item_count_; }
319 bool has_submenu() const { return has_submenu_; } 320 bool has_submenu() const { return has_submenu_; }
320 321
321 private: 322 private:
322 bool has_submenu_; 323 bool has_submenu_;
323 // The 0-based index of the current item and the number of total items. 324 // The 0-based index of the current item and the number of total items.
324 int item_index_; 325 int item_index_;
325 int item_count_; 326 int item_count_;
326 }; 327 };
327 328
329 // Accessibility information about a tree; this class is used by
330 // onControlFocused event listeners.
331 class AccessibilityTreeInfo : public AccessibilityControlInfo {
332 public:
333 AccessibilityTreeInfo(Profile* profile, const std::string& menu_name);
334
335 virtual const char* type() const OVERRIDE;
336 };
337
338 // Accessibility information about a tree item; this class is used by
339 // onControlFocused event listeners.
340 class AccessibilityTreeItemInfo : public AccessibilityControlInfo {
341 public:
342 AccessibilityTreeItemInfo(Profile* profile,
343 const std::string& name,
344 const std::string& context,
345 int item_depth,
346 int item_index,
347 int item_count,
348 int children_count,
349 bool is_expanded);
350
351 virtual const char* type() const OVERRIDE;
352
353 virtual void SerializeToDict(base::DictionaryValue* dict) const OVERRIDE;
354
355 int item_depth() const { return item_depth_; }
356 int item_index() const { return item_index_; }
357 int item_count() const { return item_count_; }
358 int children_count() const { return children_count_; }
359 bool is_expanded() const { return is_expanded_; }
360
361 private:
362 // 0-based item depth.
363 int item_depth_;
364 // The 0-based index of the current item and the number of total items at the
365 // current depth.
366 int item_index_;
367 // Count of items at the current depth.
368 int item_count_;
369 // Count of children of the current item.
370 int children_count_;
371 // True if the node is expanded.
372 bool is_expanded_;
373 };
374
328 // Accessibility information about a slider passed to onControlFocused 375 // Accessibility information about a slider passed to onControlFocused
329 // and onControlAction event listeners. 376 // and onControlAction event listeners.
330 class AccessibilitySliderInfo : public AccessibilityControlInfo { 377 class AccessibilitySliderInfo : public AccessibilityControlInfo {
331 public: 378 public:
332 AccessibilitySliderInfo(Profile* profile, 379 AccessibilitySliderInfo(Profile* profile,
333 const std::string& name, 380 const std::string& name,
334 const std::string& context, 381 const std::string& context,
335 const std::string& value); 382 const std::string& value);
336 383
337 virtual const char* type() const OVERRIDE; 384 virtual const char* type() const OVERRIDE;
338 385
339 virtual void SerializeToDict(base::DictionaryValue* dict) const OVERRIDE; 386 virtual void SerializeToDict(base::DictionaryValue* dict) const OVERRIDE;
340 387
341 const std::string& value() const { return value_; } 388 const std::string& value() const { return value_; }
342 389
343 private: 390 private:
344 std::string value_; 391 std::string value_;
345 }; 392 };
346 393
347 // Accessibility information about an alert passed to onControlAction event. 394 // Accessibility information about an alert passed to onControlAction event.
348 class AccessibilityAlertInfo : public AccessibilityControlInfo { 395 class AccessibilityAlertInfo : public AccessibilityControlInfo {
349 public: 396 public:
350 AccessibilityAlertInfo(Profile* profile, const std::string& name); 397 AccessibilityAlertInfo(Profile* profile, const std::string& name);
351 398
352 virtual const char* type() const OVERRIDE; 399 virtual const char* type() const OVERRIDE;
353 }; 400 };
354 401
355 #endif // CHROME_BROWSER_ACCESSIBILITY_ACCESSIBILITY_EVENTS_H_ 402 #endif // CHROME_BROWSER_ACCESSIBILITY_ACCESSIBILITY_EVENTS_H_
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/accessibility/accessibility_events.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698