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

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

Issue 1121473004: Expose scroll containers via accessibility APIs. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Move scrolling logic from ScrollView to WebArea Created 5 years, 7 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
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 1405 matching lines...) Expand 10 before | Expand all | Expand 10 after
1416 WebVector<int> startsWebVector(words.size()); 1416 WebVector<int> startsWebVector(words.size());
1417 WebVector<int> endsWebVector(words.size()); 1417 WebVector<int> endsWebVector(words.size());
1418 for (size_t i = 0; i < words.size(); i++) { 1418 for (size_t i = 0; i < words.size(); i++) {
1419 startsWebVector[i] = words[i].start; 1419 startsWebVector[i] = words[i].start;
1420 endsWebVector[i] = words[i].start + words[i].length; 1420 endsWebVector[i] = words[i].start + words[i].length;
1421 } 1421 }
1422 starts.swap(startsWebVector); 1422 starts.swap(startsWebVector);
1423 ends.swap(endsWebVector); 1423 ends.swap(endsWebVector);
1424 } 1424 }
1425 1425
1426 bool WebAXObject::isScrollableContainer() const
1427 {
1428 if (isDetached())
1429 return false;
1430
1431 return m_private->isScrollableContainer();
1432 }
1433
1434 WebPoint WebAXObject::scrollOffset() const
1435 {
1436 if (isDetached())
1437 return WebPoint();
1438
1439 return m_private->scrollOffset();
1440 }
1441
1442 WebPoint WebAXObject::minimumScrollOffset() const
1443 {
1444 if (isDetached())
1445 return WebPoint();
1446
1447 return m_private->minimumScrollOffset();
1448 }
1449
1450 WebPoint WebAXObject::maximumScrollOffset() const
1451 {
1452 if (isDetached())
1453 return WebPoint();
1454
1455 return m_private->maximumScrollOffset();
1456 }
1457
1458 void WebAXObject::setScrollOffset(const WebPoint& offset) const
1459 {
1460 if (isDetached())
1461 return;
1462
1463 m_private->setScrollOffset(offset);
1464 }
1465
1426 void WebAXObject::scrollToMakeVisible() const 1466 void WebAXObject::scrollToMakeVisible() const
1427 { 1467 {
1428 if (!isDetached()) 1468 if (!isDetached())
1429 m_private->scrollToMakeVisible(); 1469 m_private->scrollToMakeVisible();
1430 } 1470 }
1431 1471
1432 void WebAXObject::scrollToMakeVisibleWithSubFocus(const WebRect& subfocus) const 1472 void WebAXObject::scrollToMakeVisibleWithSubFocus(const WebRect& subfocus) const
1433 { 1473 {
1434 if (!isDetached()) 1474 if (!isDetached())
1435 m_private->scrollToMakeVisibleWithSubFocus(subfocus); 1475 m_private->scrollToMakeVisibleWithSubFocus(subfocus);
(...skipping 15 matching lines...) Expand all
1451 m_private = object; 1491 m_private = object;
1452 return *this; 1492 return *this;
1453 } 1493 }
1454 1494
1455 WebAXObject::operator WTF::PassRefPtr<AXObject>() const 1495 WebAXObject::operator WTF::PassRefPtr<AXObject>() const
1456 { 1496 {
1457 return m_private.get(); 1497 return m_private.get();
1458 } 1498 }
1459 1499
1460 } // namespace blink 1500 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698