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

Side by Side Diff: third_party/WebKit/Source/modules/accessibility/AXObject.cpp

Issue 2408333004: Move persistent gesture state to Document, add DocumentUserGestureToken (Closed)
Patch Set: Re-add dropped null check Created 4 years, 1 month 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) 2008, 2009, 2011 Apple Inc. All rights reserved. 2 * Copyright (C) 2008, 2009, 2011 Apple 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 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 7 *
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. 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 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 12 matching lines...) Expand all
23 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 23 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
24 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 25 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
26 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 */ 27 */
28 28
29 #include "modules/accessibility/AXObject.h" 29 #include "modules/accessibility/AXObject.h"
30 30
31 #include "SkMatrix44.h" 31 #include "SkMatrix44.h"
32 #include "core/css/resolver/StyleResolver.h" 32 #include "core/css/resolver/StyleResolver.h"
33 #include "core/dom/DocumentUserGestureToken.h"
33 #include "core/editing/EditingUtilities.h" 34 #include "core/editing/EditingUtilities.h"
34 #include "core/editing/VisibleUnits.h" 35 #include "core/editing/VisibleUnits.h"
35 #include "core/frame/FrameView.h" 36 #include "core/frame/FrameView.h"
36 #include "core/frame/LocalFrame.h" 37 #include "core/frame/LocalFrame.h"
37 #include "core/frame/Settings.h" 38 #include "core/frame/Settings.h"
38 #include "core/html/HTMLDialogElement.h" 39 #include "core/html/HTMLDialogElement.h"
39 #include "core/html/HTMLFrameOwnerElement.h" 40 #include "core/html/HTMLFrameOwnerElement.h"
40 #include "core/html/parser/HTMLParserIdioms.h" 41 #include "core/html/parser/HTMLParserIdioms.h"
41 #include "core/layout/LayoutBox.h" 42 #include "core/layout/LayoutBox.h"
42 #include "modules/accessibility/AXObjectCacheImpl.h" 43 #include "modules/accessibility/AXObjectCacheImpl.h"
(...skipping 1297 matching lines...) Expand 10 before | Expand all | Expand 10 after
1340 } 1341 }
1341 1342
1342 // 1343 //
1343 // Modify or take an action on an object. 1344 // Modify or take an action on an object.
1344 // 1345 //
1345 1346
1346 bool AXObject::press() const { 1347 bool AXObject::press() const {
1347 Element* actionElem = actionElement(); 1348 Element* actionElem = actionElement();
1348 if (!actionElem) 1349 if (!actionElem)
1349 return false; 1350 return false;
1350 UserGestureIndicator gestureIndicator( 1351 UserGestureIndicator gestureIndicator(DocumentUserGestureToken::create(
1351 UserGestureToken::create(UserGestureToken::NewGesture)); 1352 &actionElem->document(), UserGestureToken::NewGesture));
1352 actionElem->accessKeyAction(true); 1353 actionElem->accessKeyAction(true);
1353 return true; 1354 return true;
1354 } 1355 }
1355 1356
1356 void AXObject::scrollToMakeVisible() const { 1357 void AXObject::scrollToMakeVisible() const {
1357 IntRect objectRect = pixelSnappedIntRect(getBoundsInFrameCoordinates()); 1358 IntRect objectRect = pixelSnappedIntRect(getBoundsInFrameCoordinates());
1358 objectRect.setLocation(IntPoint()); 1359 objectRect.setLocation(IntPoint());
1359 scrollToMakeVisibleWithSubFocus(objectRect); 1360 scrollToMakeVisibleWithSubFocus(objectRect);
1360 } 1361 }
1361 1362
(...skipping 379 matching lines...) Expand 10 before | Expand all | Expand 10 after
1741 } 1742 }
1742 1743
1743 DEFINE_TRACE(AXObject) { 1744 DEFINE_TRACE(AXObject) {
1744 visitor->trace(m_children); 1745 visitor->trace(m_children);
1745 visitor->trace(m_parent); 1746 visitor->trace(m_parent);
1746 visitor->trace(m_cachedLiveRegionRoot); 1747 visitor->trace(m_cachedLiveRegionRoot);
1747 visitor->trace(m_axObjectCache); 1748 visitor->trace(m_axObjectCache);
1748 } 1749 }
1749 1750
1750 } // namespace blink 1751 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698