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

Side by Side Diff: Source/web/WebAXObject.cpp

Issue 1072273006: Oilpan: Prepare moving AXObject to heap (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 6 months 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
« no previous file with comments | « Source/modules/accessibility/AXTableRow.cpp ('k') | public/web/WebAXObject.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2009 Google Inc. All rights reserved. 2 * Copyright (C) 2009 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 693 matching lines...) Expand 10 before | Expand all | Expand 10 after
704 704
705 // FIXME: This method passes in a point that has page scale applied but assumes that (0, 0) 705 // FIXME: This method passes in a point that has page scale applied but assumes that (0, 0)
706 // is the top left of the visual viewport. In other words, the point has the Pin chViewport 706 // is the top left of the visual viewport. In other words, the point has the Pin chViewport
707 // scale applied, but not the PinchViewport offset. crbug.com/459591. 707 // scale applied, but not the PinchViewport offset. crbug.com/459591.
708 WebAXObject WebAXObject::hitTest(const WebPoint& point) const 708 WebAXObject WebAXObject::hitTest(const WebPoint& point) const
709 { 709 {
710 if (isDetached()) 710 if (isDetached())
711 return WebAXObject(); 711 return WebAXObject();
712 712
713 IntPoint contentsPoint = m_private->documentFrameView()->soonToBeRemovedUnsc aledViewportToContents(point); 713 IntPoint contentsPoint = m_private->documentFrameView()->soonToBeRemovedUnsc aledViewportToContents(point);
714 RefPtr<AXObject> hit = m_private->accessibilityHitTest(contentsPoint); 714 RefPtrWillBeRawPtr<AXObject> hit = m_private->accessibilityHitTest(contentsP oint);
715 715
716 if (hit) 716 if (hit)
717 return WebAXObject(hit); 717 return WebAXObject(hit);
718 718
719 if (m_private->elementRect().contains(contentsPoint)) 719 if (m_private->elementRect().contains(contentsPoint))
720 return *this; 720 return *this;
721 721
722 return WebAXObject(); 722 return WebAXObject();
723 } 723 }
724 724
(...skipping 331 matching lines...) Expand 10 before | Expand all | Expand 10 after
1056 { 1056 {
1057 return deprecatedTitleUIElement(); 1057 return deprecatedTitleUIElement();
1058 } 1058 }
1059 1059
1060 WebString WebAXObject::name(WebAXNameFrom& outNameFrom, WebVector<WebAXObject>& outNameObjects) 1060 WebString WebAXObject::name(WebAXNameFrom& outNameFrom, WebVector<WebAXObject>& outNameObjects)
1061 { 1061 {
1062 if (isDetached()) 1062 if (isDetached())
1063 return WebString(); 1063 return WebString();
1064 1064
1065 AXNameFrom nameFrom = AXNameFromAttribute; 1065 AXNameFrom nameFrom = AXNameFromAttribute;
1066 Vector<AXObject*> nameObjects; 1066 WillBeHeapVector<RawPtrWillBeMember<AXObject>> nameObjects;
1067 WebString result = m_private->name(nameFrom, nameObjects); 1067 WebString result = m_private->name(nameFrom, nameObjects);
1068 outNameFrom = static_cast<WebAXNameFrom>(nameFrom); 1068 outNameFrom = static_cast<WebAXNameFrom>(nameFrom);
1069 1069
1070 WebVector<WebAXObject> webNameObjects(nameObjects.size()); 1070 WebVector<WebAXObject> webNameObjects(nameObjects.size());
1071 for (size_t i = 0; i < nameObjects.size(); i++) 1071 for (size_t i = 0; i < nameObjects.size(); i++)
1072 webNameObjects[i] = WebAXObject(nameObjects[i]); 1072 webNameObjects[i] = WebAXObject(nameObjects[i]);
1073 outNameObjects.swap(webNameObjects); 1073 outNameObjects.swap(webNameObjects);
1074 1074
1075 return result; 1075 return result;
1076 } 1076 }
1077 1077
1078 WebString WebAXObject::description(WebAXNameFrom nameFrom, WebAXDescriptionFrom& outDescriptionFrom, WebVector<WebAXObject>& outDescriptionObjects) 1078 WebString WebAXObject::description(WebAXNameFrom nameFrom, WebAXDescriptionFrom& outDescriptionFrom, WebVector<WebAXObject>& outDescriptionObjects)
1079 { 1079 {
1080 if (isDetached()) 1080 if (isDetached())
1081 return WebString(); 1081 return WebString();
1082 1082
1083 AXDescriptionFrom descriptionFrom; 1083 AXDescriptionFrom descriptionFrom;
1084 Vector<AXObject*> descriptionObjects; 1084 WillBeHeapVector<RawPtrWillBeMember<AXObject>> descriptionObjects;
1085 String result = m_private->description(static_cast<AXNameFrom>(nameFrom), de scriptionFrom, descriptionObjects); 1085 String result = m_private->description(static_cast<AXNameFrom>(nameFrom), de scriptionFrom, descriptionObjects);
1086 outDescriptionFrom = static_cast<WebAXDescriptionFrom>(descriptionFrom); 1086 outDescriptionFrom = static_cast<WebAXDescriptionFrom>(descriptionFrom);
1087 1087
1088 WebVector<WebAXObject> webDescriptionObjects(descriptionObjects.size()); 1088 WebVector<WebAXObject> webDescriptionObjects(descriptionObjects.size());
1089 for (size_t i = 0; i < descriptionObjects.size(); i++) 1089 for (size_t i = 0; i < descriptionObjects.size(); i++)
1090 webDescriptionObjects[i] = WebAXObject(descriptionObjects[i]); 1090 webDescriptionObjects[i] = WebAXObject(descriptionObjects[i]);
1091 outDescriptionObjects.swap(webDescriptionObjects); 1091 outDescriptionObjects.swap(webDescriptionObjects);
1092 1092
1093 return result; 1093 return result;
1094 } 1094 }
(...skipping 458 matching lines...) Expand 10 before | Expand all | Expand 10 after
1553 if (!isDetached()) 1553 if (!isDetached())
1554 m_private->scrollToMakeVisibleWithSubFocus(subfocus); 1554 m_private->scrollToMakeVisibleWithSubFocus(subfocus);
1555 } 1555 }
1556 1556
1557 void WebAXObject::scrollToGlobalPoint(const WebPoint& point) const 1557 void WebAXObject::scrollToGlobalPoint(const WebPoint& point) const
1558 { 1558 {
1559 if (!isDetached()) 1559 if (!isDetached())
1560 m_private->scrollToGlobalPoint(point); 1560 m_private->scrollToGlobalPoint(point);
1561 } 1561 }
1562 1562
1563 WebAXObject::WebAXObject(const WTF::PassRefPtr<AXObject>& object) 1563 WebAXObject::WebAXObject(const PassRefPtrWillBeRawPtr<AXObject>& object)
1564 : m_private(object) 1564 : m_private(object)
1565 { 1565 {
1566 } 1566 }
1567 1567
1568 WebAXObject& WebAXObject::operator=(const WTF::PassRefPtr<AXObject>& object) 1568 WebAXObject& WebAXObject::operator=(const PassRefPtrWillBeRawPtr<AXObject>& obje ct)
1569 { 1569 {
1570 m_private = object; 1570 m_private = object;
1571 return *this; 1571 return *this;
1572 } 1572 }
1573 1573
1574 WebAXObject::operator WTF::PassRefPtr<AXObject>() const 1574 WebAXObject::operator PassRefPtrWillBeRawPtr<AXObject>() const
1575 { 1575 {
1576 return m_private.get(); 1576 return m_private.get();
1577 } 1577 }
1578 1578
1579 } // namespace blink 1579 } // namespace blink
OLDNEW
« no previous file with comments | « Source/modules/accessibility/AXTableRow.cpp ('k') | public/web/WebAXObject.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698