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

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

Issue 24752002: Cleanup <static_cast>: Switch to toFoo for Accessibility Objects. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 7 years, 2 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/core/platform/Scrollbar.h ('k') | no next file » | 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 886 matching lines...) Expand 10 before | Expand all | Expand 10 after
897 } 897 }
898 898
899 unsigned WebAXObject::rowIndex() const 899 unsigned WebAXObject::rowIndex() const
900 { 900 {
901 if (isDetached()) 901 if (isDetached())
902 return 0; 902 return 0;
903 903
904 if (!m_private->isTableRow()) 904 if (!m_private->isTableRow())
905 return 0; 905 return 0;
906 906
907 return static_cast<WebCore::AccessibilityTableRow*>(m_private.get())->rowInd ex(); 907 return WebCore::toAccessibilityTableRow(m_private.get())->rowIndex();
908 } 908 }
909 909
910 WebAXObject WebAXObject::rowHeader() const 910 WebAXObject WebAXObject::rowHeader() const
911 { 911 {
912 if (isDetached()) 912 if (isDetached())
913 return WebAXObject(); 913 return WebAXObject();
914 914
915 if (!m_private->isTableRow()) 915 if (!m_private->isTableRow())
916 return WebAXObject(); 916 return WebAXObject();
917 917
918 return WebAXObject(static_cast<WebCore::AccessibilityTableRow*>(m_private.ge t())->headerObject()); 918 return WebAXObject(WebCore::toAccessibilityTableRow(m_private.get())->header Object());
919 } 919 }
920 920
921 unsigned WebAXObject::columnIndex() const 921 unsigned WebAXObject::columnIndex() const
922 { 922 {
923 if (isDetached()) 923 if (isDetached())
924 return 0; 924 return 0;
925 925
926 if (m_private->roleValue() != ColumnRole) 926 if (m_private->roleValue() != ColumnRole)
927 return 0; 927 return 0;
928 928
929 return static_cast<WebCore::AccessibilityTableColumn*>(m_private.get())->col umnIndex(); 929 return WebCore::toAccessibilityTableColumn(m_private.get())->columnIndex();
930 } 930 }
931 931
932 WebAXObject WebAXObject::columnHeader() const 932 WebAXObject WebAXObject::columnHeader() const
933 { 933 {
934 if (isDetached()) 934 if (isDetached())
935 return WebAXObject(); 935 return WebAXObject();
936 936
937 if (m_private->roleValue() != ColumnRole) 937 if (m_private->roleValue() != ColumnRole)
938 return WebAXObject(); 938 return WebAXObject();
939 939
940 return WebAXObject(static_cast<WebCore::AccessibilityTableColumn*>(m_private .get())->headerObject()); 940 return WebAXObject(WebCore::toAccessibilityTableColumn(m_private.get())->hea derObject());
941 } 941 }
942 942
943 unsigned WebAXObject::cellColumnIndex() const 943 unsigned WebAXObject::cellColumnIndex() const
944 { 944 {
945 if (isDetached()) 945 if (isDetached())
946 return 0; 946 return 0;
947 947
948 if (!m_private->isTableCell()) 948 if (!m_private->isTableCell())
949 return 0; 949 return 0;
950 950
951 pair<unsigned, unsigned> columnRange; 951 pair<unsigned, unsigned> columnRange;
952 static_cast<WebCore::AccessibilityTableCell*>(m_private.get())->columnIndexR ange(columnRange); 952 WebCore::toAccessibilityTableCell(m_private.get())->columnIndexRange(columnR ange);
953 return columnRange.first; 953 return columnRange.first;
954 } 954 }
955 955
956 unsigned WebAXObject::cellColumnSpan() const 956 unsigned WebAXObject::cellColumnSpan() const
957 { 957 {
958 if (isDetached()) 958 if (isDetached())
959 return 0; 959 return 0;
960 960
961 if (!m_private->isTableCell()) 961 if (!m_private->isTableCell())
962 return 0; 962 return 0;
963 963
964 pair<unsigned, unsigned> columnRange; 964 pair<unsigned, unsigned> columnRange;
965 static_cast<WebCore::AccessibilityTableCell*>(m_private.get())->columnIndexR ange(columnRange); 965 WebCore::toAccessibilityTableCell(m_private.get())->columnIndexRange(columnR ange);
966 return columnRange.second; 966 return columnRange.second;
967 } 967 }
968 968
969 unsigned WebAXObject::cellRowIndex() const 969 unsigned WebAXObject::cellRowIndex() const
970 { 970 {
971 if (isDetached()) 971 if (isDetached())
972 return 0; 972 return 0;
973 973
974 if (!m_private->isTableCell()) 974 if (!m_private->isTableCell())
975 return 0; 975 return 0;
976 976
977 pair<unsigned, unsigned> rowRange; 977 pair<unsigned, unsigned> rowRange;
978 static_cast<WebCore::AccessibilityTableCell*>(m_private.get())->rowIndexRang e(rowRange); 978 WebCore::toAccessibilityTableCell(m_private.get())->rowIndexRange(rowRange);
979 return rowRange.first; 979 return rowRange.first;
980 } 980 }
981 981
982 unsigned WebAXObject::cellRowSpan() const 982 unsigned WebAXObject::cellRowSpan() const
983 { 983 {
984 if (isDetached()) 984 if (isDetached())
985 return 0; 985 return 0;
986 986
987 if (!m_private->isTableCell()) 987 if (!m_private->isTableCell())
988 return 0; 988 return 0;
989 989
990 pair<unsigned, unsigned> rowRange; 990 pair<unsigned, unsigned> rowRange;
991 static_cast<WebCore::AccessibilityTableCell*>(m_private.get())->rowIndexRang e(rowRange); 991 WebCore::toAccessibilityTableCell(m_private.get())->rowIndexRange(rowRange);
992 return rowRange.second; 992 return rowRange.second;
993 } 993 }
994 994
995 void WebAXObject::scrollToMakeVisible() const 995 void WebAXObject::scrollToMakeVisible() const
996 { 996 {
997 if (!isDetached()) 997 if (!isDetached())
998 m_private->scrollToMakeVisible(); 998 m_private->scrollToMakeVisible();
999 } 999 }
1000 1000
1001 void WebAXObject::scrollToMakeVisibleWithSubFocus(const WebRect& subfocus) const 1001 void WebAXObject::scrollToMakeVisibleWithSubFocus(const WebRect& subfocus) const
(...skipping 18 matching lines...) Expand all
1020 m_private = object; 1020 m_private = object;
1021 return *this; 1021 return *this;
1022 } 1022 }
1023 1023
1024 WebAXObject::operator WTF::PassRefPtr<WebCore::AccessibilityObject>() const 1024 WebAXObject::operator WTF::PassRefPtr<WebCore::AccessibilityObject>() const
1025 { 1025 {
1026 return m_private.get(); 1026 return m_private.get();
1027 } 1027 }
1028 1028
1029 } // namespace WebKit 1029 } // namespace WebKit
OLDNEW
« no previous file with comments | « Source/core/platform/Scrollbar.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698