| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 // Tree navigation will be treated identically to menu navigation for now. |
| 330 // TODO(dmazzoni): Figure out how and if we should take tree navigation beyond |
| 331 // mimicking menus. |
| 332 class AccessibilityTreeItemInfo : public AccessibilityMenuItemInfo { |
| 333 public: |
| 334 AccessibilityTreeItemInfo(Profile* profile, |
| 335 const std::string& name, |
| 336 const std::string& context, |
| 337 bool has_submenu, |
| 338 int item_index, |
| 339 int item_count); |
| 340 }; |
| 341 |
| 328 // Accessibility information about a slider passed to onControlFocused | 342 // Accessibility information about a slider passed to onControlFocused |
| 329 // and onControlAction event listeners. | 343 // and onControlAction event listeners. |
| 330 class AccessibilitySliderInfo : public AccessibilityControlInfo { | 344 class AccessibilitySliderInfo : public AccessibilityControlInfo { |
| 331 public: | 345 public: |
| 332 AccessibilitySliderInfo(Profile* profile, | 346 AccessibilitySliderInfo(Profile* profile, |
| 333 const std::string& name, | 347 const std::string& name, |
| 334 const std::string& context, | 348 const std::string& context, |
| 335 const std::string& value); | 349 const std::string& value); |
| 336 | 350 |
| 337 virtual const char* type() const OVERRIDE; | 351 virtual const char* type() const OVERRIDE; |
| 338 | 352 |
| 339 virtual void SerializeToDict(base::DictionaryValue* dict) const OVERRIDE; | 353 virtual void SerializeToDict(base::DictionaryValue* dict) const OVERRIDE; |
| 340 | 354 |
| 341 const std::string& value() const { return value_; } | 355 const std::string& value() const { return value_; } |
| 342 | 356 |
| 343 private: | 357 private: |
| 344 std::string value_; | 358 std::string value_; |
| 345 }; | 359 }; |
| 346 | 360 |
| 347 // Accessibility information about an alert passed to onControlAction event. | 361 // Accessibility information about an alert passed to onControlAction event. |
| 348 class AccessibilityAlertInfo : public AccessibilityControlInfo { | 362 class AccessibilityAlertInfo : public AccessibilityControlInfo { |
| 349 public: | 363 public: |
| 350 AccessibilityAlertInfo(Profile* profile, const std::string& name); | 364 AccessibilityAlertInfo(Profile* profile, const std::string& name); |
| 351 | 365 |
| 352 virtual const char* type() const OVERRIDE; | 366 virtual const char* type() const OVERRIDE; |
| 353 }; | 367 }; |
| 354 | 368 |
| 355 #endif // CHROME_BROWSER_ACCESSIBILITY_ACCESSIBILITY_EVENTS_H_ | 369 #endif // CHROME_BROWSER_ACCESSIBILITY_ACCESSIBILITY_EVENTS_H_ |
| OLD | NEW |