Chromium Code Reviews| 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_EXTENSION_API_H_ | 5 #ifndef CHROME_BROWSER_ACCESSIBILITY_ACCESSIBILITY_EXTENSION_API_H_ |
| 6 #define CHROME_BROWSER_ACCESSIBILITY_ACCESSIBILITY_EXTENSION_API_H_ | 6 #define CHROME_BROWSER_ACCESSIBILITY_ACCESSIBILITY_EXTENSION_API_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
| 11 #include "base/memory/singleton.h" | 11 #include "base/memory/singleton.h" |
| 12 #include "base/values.h" | 12 #include "base/values.h" |
| 13 #include "chrome/browser/accessibility/accessibility_events.h" | 13 #include "chrome/browser/accessibility/accessibility_events.h" |
| 14 #include "chrome/browser/extensions/extension_function.h" | 14 #include "chrome/browser/extensions/extension_function.h" |
| 15 #include "ui/base/accessibility/accessibility_types.h" | 15 #include "ui/base/accessibility/accessibility_types.h" |
| 16 | 16 |
| 17 namespace extensions { | |
| 18 class ExtensionHost; | |
| 19 struct Event; | |
|
dmazzoni
2013/10/25 23:09:16
unused?
| |
| 20 } // namespace extensions | |
| 21 | |
| 17 // Observes the profile and routes accessibility notifications as events | 22 // Observes the profile and routes accessibility notifications as events |
| 18 // to the extension system. | 23 // to the extension system. |
| 19 class ExtensionAccessibilityEventRouter { | 24 class ExtensionAccessibilityEventRouter { |
| 20 public: | 25 public: |
| 21 typedef base::Callback<void(ui::AccessibilityTypes::Event, | 26 typedef base::Callback<void(ui::AccessibilityTypes::Event, |
| 22 const AccessibilityControlInfo*)> | 27 const AccessibilityControlInfo*)> |
| 23 ControlEventCallback; | 28 ControlEventCallback; |
| 24 // Single instance of the event router. | 29 // Single instance of the event router. |
| 25 static ExtensionAccessibilityEventRouter* GetInstance(); | 30 static ExtensionAccessibilityEventRouter* GetInstance(); |
| 26 | 31 |
| (...skipping 20 matching lines...) Expand all Loading... | |
| 47 const AccessibilityWindowInfo* info); | 52 const AccessibilityWindowInfo* info); |
| 48 | 53 |
| 49 // Route a menu-related accessibility event. | 54 // Route a menu-related accessibility event. |
| 50 void HandleMenuEvent(ui::AccessibilityTypes::Event event, | 55 void HandleMenuEvent(ui::AccessibilityTypes::Event event, |
| 51 const AccessibilityMenuInfo* info); | 56 const AccessibilityMenuInfo* info); |
| 52 | 57 |
| 53 // Route a control-related accessibility event. | 58 // Route a control-related accessibility event. |
| 54 void HandleControlEvent(ui::AccessibilityTypes::Event event, | 59 void HandleControlEvent(ui::AccessibilityTypes::Event event, |
| 55 const AccessibilityControlInfo* info); | 60 const AccessibilityControlInfo* info); |
| 56 | 61 |
| 62 void OnSpokenFeedbackEnabled(Profile* profile, bool make_announcements); | |
| 63 void OnSpokenFeedbackDisabled(Profile* profile); | |
| 64 | |
| 65 static void DispatchEventToChromeVox(Profile* profile, | |
|
dmazzoni
2013/10/25 23:09:16
nit: when doing one argument per line, line them u
| |
| 66 const char* event_name, | |
| 67 scoped_ptr<base::ListValue> event_args, | |
| 68 bool first_call, | |
| 69 extensions::ExtensionHost* host); | |
| 70 | |
| 57 private: | 71 private: |
| 58 friend struct DefaultSingletonTraits<ExtensionAccessibilityEventRouter>; | 72 friend struct DefaultSingletonTraits<ExtensionAccessibilityEventRouter>; |
| 59 | 73 |
| 60 ExtensionAccessibilityEventRouter(); | 74 ExtensionAccessibilityEventRouter(); |
| 61 virtual ~ExtensionAccessibilityEventRouter(); | 75 virtual ~ExtensionAccessibilityEventRouter(); |
| 62 | 76 |
| 63 void OnWindowOpened(const AccessibilityWindowInfo* details); | 77 void OnWindowOpened(const AccessibilityWindowInfo* details); |
| 64 void OnControlFocused(const AccessibilityControlInfo* details); | 78 void OnControlFocused(const AccessibilityControlInfo* details); |
| 65 void OnControlAction(const AccessibilityControlInfo* details); | 79 void OnControlAction(const AccessibilityControlInfo* details); |
| 66 void OnTextChanged(const AccessibilityControlInfo* details); | 80 void OnTextChanged(const AccessibilityControlInfo* details); |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 115 // API function that returns alerts being shown on the give tab. | 129 // API function that returns alerts being shown on the give tab. |
| 116 class AccessibilityGetAlertsForTabFunction : public SyncExtensionFunction { | 130 class AccessibilityGetAlertsForTabFunction : public SyncExtensionFunction { |
| 117 virtual ~AccessibilityGetAlertsForTabFunction() {} | 131 virtual ~AccessibilityGetAlertsForTabFunction() {} |
| 118 virtual bool RunImpl() OVERRIDE; | 132 virtual bool RunImpl() OVERRIDE; |
| 119 DECLARE_EXTENSION_FUNCTION( | 133 DECLARE_EXTENSION_FUNCTION( |
| 120 "experimental.accessibility.getAlertsForTab", | 134 "experimental.accessibility.getAlertsForTab", |
| 121 EXPERIMENTAL_ACCESSIBILITY_GETALERTSFORTAB) | 135 EXPERIMENTAL_ACCESSIBILITY_GETALERTSFORTAB) |
| 122 }; | 136 }; |
| 123 | 137 |
| 124 #endif // CHROME_BROWSER_ACCESSIBILITY_ACCESSIBILITY_EXTENSION_API_H_ | 138 #endif // CHROME_BROWSER_ACCESSIBILITY_ACCESSIBILITY_EXTENSION_API_H_ |
| OLD | NEW |