| 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/accessibility/ax_enums.h" | 10 #include "ui/accessibility/ax_enums.h" |
| 11 #include "ui/gfx/rect.h" |
| 11 | 12 |
| 12 class AccessibilityControlInfo; | 13 class AccessibilityControlInfo; |
| 13 class AccessibilityMenuInfo; | 14 class AccessibilityMenuInfo; |
| 14 class AccessibilityWindowInfo; | 15 class AccessibilityWindowInfo; |
| 15 class Profile; | 16 class Profile; |
| 16 | 17 |
| 17 namespace base { | 18 namespace base { |
| 18 class DictionaryValue; | 19 class DictionaryValue; |
| 19 } | 20 } |
| 20 | 21 |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 63 virtual void SerializeToDict(base::DictionaryValue* dict) const OVERRIDE; | 64 virtual void SerializeToDict(base::DictionaryValue* dict) const OVERRIDE; |
| 64 | 65 |
| 65 // Return the specific type of this control, which will be one of the | 66 // Return the specific type of this control, which will be one of the |
| 66 // string constants defined in extension_accessibility_api_constants.h. | 67 // string constants defined in extension_accessibility_api_constants.h. |
| 67 virtual const char* type() const = 0; | 68 virtual const char* type() const = 0; |
| 68 | 69 |
| 69 const std::string& name() const { return name_; } | 70 const std::string& name() const { return name_; } |
| 70 | 71 |
| 71 const std::string& context() const { return context_; } | 72 const std::string& context() const { return context_; } |
| 72 | 73 |
| 74 void set_bounds(const gfx::Rect& bounds) { bounds_ = bounds; } |
| 75 const gfx::Rect& bounds() const { return bounds_; } |
| 76 |
| 73 protected: | 77 protected: |
| 74 AccessibilityControlInfo(Profile* profile, | 78 AccessibilityControlInfo(Profile* profile, |
| 75 const std::string& name); | 79 const std::string& name); |
| 76 | 80 |
| 77 void set_context(const std::string& context) { context_ = context; } | 81 void set_context(const std::string& context) { context_ = context; } |
| 78 | 82 |
| 79 // The name of the control, like "OK" or "Password". | 83 // The name of the control, like "OK" or "Password". |
| 80 std::string name_; | 84 std::string name_; |
| 81 | 85 |
| 82 // A string describing the context of the control, such as the name of | 86 // A string describing the context of the control, such as the name of |
| 83 // the group or toolbar it's contained in. | 87 // the group or toolbar it's contained in. |
| 84 std::string context_; | 88 std::string context_; |
| 89 |
| 90 // The bounds of the control in global screen coordinates. |
| 91 gfx::Rect bounds_; |
| 85 }; | 92 }; |
| 86 | 93 |
| 87 // Accessibility information about a window passed to onWindowOpened | 94 // Accessibility information about a window passed to onWindowOpened |
| 88 // and onWindowClosed event listeners. | 95 // and onWindowClosed event listeners. |
| 89 class AccessibilityWindowInfo : public AccessibilityControlInfo { | 96 class AccessibilityWindowInfo : public AccessibilityControlInfo { |
| 90 public: | 97 public: |
| 91 AccessibilityWindowInfo(Profile* profile, const std::string& window_name); | 98 AccessibilityWindowInfo(Profile* profile, const std::string& window_name); |
| 92 | 99 |
| 93 virtual const char* type() const OVERRIDE; | 100 virtual const char* type() const OVERRIDE; |
| 94 }; | 101 }; |
| (...skipping 309 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 404 | 411 |
| 405 // Accessibility information about an alert passed to onControlAction event. | 412 // Accessibility information about an alert passed to onControlAction event. |
| 406 class AccessibilityAlertInfo : public AccessibilityControlInfo { | 413 class AccessibilityAlertInfo : public AccessibilityControlInfo { |
| 407 public: | 414 public: |
| 408 AccessibilityAlertInfo(Profile* profile, const std::string& name); | 415 AccessibilityAlertInfo(Profile* profile, const std::string& name); |
| 409 | 416 |
| 410 virtual const char* type() const OVERRIDE; | 417 virtual const char* type() const OVERRIDE; |
| 411 }; | 418 }; |
| 412 | 419 |
| 413 #endif // CHROME_BROWSER_ACCESSIBILITY_ACCESSIBILITY_EVENTS_H_ | 420 #endif // CHROME_BROWSER_ACCESSIBILITY_ACCESSIBILITY_EVENTS_H_ |
| OLD | NEW |