| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2010 Google Inc. All rights reserved. | 2 * Copyright (C) 2010 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 20 matching lines...) Expand all Loading... |
| 31 #include "AccessibilityController.h" | 31 #include "AccessibilityController.h" |
| 32 | 32 |
| 33 #include "public/platform/WebCString.h" | 33 #include "public/platform/WebCString.h" |
| 34 #include "public/testing/WebTestDelegate.h" | 34 #include "public/testing/WebTestDelegate.h" |
| 35 #include "public/web/WebAXObject.h" | 35 #include "public/web/WebAXObject.h" |
| 36 #include "public/web/WebElement.h" | 36 #include "public/web/WebElement.h" |
| 37 #include "public/web/WebFrame.h" | 37 #include "public/web/WebFrame.h" |
| 38 #include "public/web/WebNode.h" | 38 #include "public/web/WebNode.h" |
| 39 #include "public/web/WebView.h" | 39 #include "public/web/WebView.h" |
| 40 | 40 |
| 41 using namespace WebKit; | 41 using namespace blink; |
| 42 | 42 |
| 43 namespace WebTestRunner { | 43 namespace WebTestRunner { |
| 44 | 44 |
| 45 AccessibilityController::AccessibilityController() | 45 AccessibilityController::AccessibilityController() |
| 46 : m_logAccessibilityEvents(false) | 46 : m_logAccessibilityEvents(false) |
| 47 { | 47 { |
| 48 | 48 |
| 49 bindMethod("logAccessibilityEvents", &AccessibilityController::logAccessibil
ityEventsCallback); | 49 bindMethod("logAccessibilityEvents", &AccessibilityController::logAccessibil
ityEventsCallback); |
| 50 bindMethod("addNotificationListener", &AccessibilityController::addNotificat
ionListenerCallback); | 50 bindMethod("addNotificationListener", &AccessibilityController::addNotificat
ionListenerCallback); |
| 51 bindMethod("removeNotificationListener", &AccessibilityController::removeNot
ificationListenerCallback); | 51 bindMethod("removeNotificationListener", &AccessibilityController::removeNot
ificationListenerCallback); |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 125 return 0; | 125 return 0; |
| 126 | 126 |
| 127 return findAccessibleElementByIdRecursive(m_rootElement, WebString::fromUTF8
(id.c_str())); | 127 return findAccessibleElementByIdRecursive(m_rootElement, WebString::fromUTF8
(id.c_str())); |
| 128 } | 128 } |
| 129 | 129 |
| 130 bool AccessibilityController::shouldLogAccessibilityEvents() | 130 bool AccessibilityController::shouldLogAccessibilityEvents() |
| 131 { | 131 { |
| 132 return m_logAccessibilityEvents; | 132 return m_logAccessibilityEvents; |
| 133 } | 133 } |
| 134 | 134 |
| 135 void AccessibilityController::notificationReceived(const WebKit::WebAXObject& ta
rget, const char* notificationName) | 135 void AccessibilityController::notificationReceived(const blink::WebAXObject& tar
get, const char* notificationName) |
| 136 { | 136 { |
| 137 // Call notification listeners on the element. | 137 // Call notification listeners on the element. |
| 138 WebAXObjectProxy* element = m_elements.getOrCreate(target); | 138 WebAXObjectProxy* element = m_elements.getOrCreate(target); |
| 139 element->notificationReceived(notificationName); | 139 element->notificationReceived(notificationName); |
| 140 | 140 |
| 141 // Call global notification listeners. | 141 // Call global notification listeners. |
| 142 size_t callbackCount = m_notificationCallbacks.size(); | 142 size_t callbackCount = m_notificationCallbacks.size(); |
| 143 for (size_t i = 0; i < callbackCount; i++) { | 143 for (size_t i = 0; i < callbackCount; i++) { |
| 144 CppVariant arguments[2]; | 144 CppVariant arguments[2]; |
| 145 arguments[0].set(*element->getAsCppVariant()); | 145 arguments[0].set(*element->getAsCppVariant()); |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 197 result->set(*(foundElement->getAsCppVariant())); | 197 result->set(*(foundElement->getAsCppVariant())); |
| 198 } | 198 } |
| 199 | 199 |
| 200 void AccessibilityController::fallbackCallback(const CppArgumentList&, CppVarian
t* result) | 200 void AccessibilityController::fallbackCallback(const CppArgumentList&, CppVarian
t* result) |
| 201 { | 201 { |
| 202 m_delegate->printMessage("CONSOLE MESSAGE: JavaScript ERROR: unknown method
called on AccessibilityController\n"); | 202 m_delegate->printMessage("CONSOLE MESSAGE: JavaScript ERROR: unknown method
called on AccessibilityController\n"); |
| 203 result->setNull(); | 203 result->setNull(); |
| 204 } | 204 } |
| 205 | 205 |
| 206 } | 206 } |
| OLD | NEW |