Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #import "content/browser/accessibility/browser_accessibility_cocoa.h" | 5 #import "content/browser/accessibility/browser_accessibility_cocoa.h" |
| 6 | 6 |
| 7 #include <execinfo.h> | 7 #include <execinfo.h> |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 #include <stdint.h> | 9 #include <stdint.h> |
| 10 #include <string.h> | 10 #include <string.h> |
| (...skipping 842 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 853 nameFrom == ui::AX_NAME_FROM_VALUE) { | 853 nameFrom == ui::AX_NAME_FROM_VALUE) { |
| 854 return @""; | 854 return @""; |
| 855 } else { | 855 } else { |
| 856 return base::SysUTF8ToNSString(name); | 856 return base::SysUTF8ToNSString(name); |
| 857 } | 857 } |
| 858 } | 858 } |
| 859 | 859 |
| 860 // Given an image where there's no other title, return the base part | 860 // Given an image where there's no other title, return the base part |
| 861 // of the filename as the description. | 861 // of the filename as the description. |
| 862 if ([[self role] isEqualToString:NSAccessibilityImageRole]) { | 862 if ([[self role] isEqualToString:NSAccessibilityImageRole]) { |
| 863 if (browserAccessibility_->HasStringAttribute(ui::AX_ATTR_NAME)) | 863 if (browserAccessibility_->HasExplicitlyEmptyName()) |
|
aleventhal
2017/05/01 17:33:17
We already checked for empty AX_ATTR_NAME above an
| |
| 864 return @""; | 864 return @""; |
| 865 if ([self titleUIElement]) | 865 if ([self titleUIElement]) |
| 866 return @""; | 866 return @""; |
| 867 | 867 |
| 868 std::string url; | 868 std::string url; |
| 869 if (browserAccessibility_->GetStringAttribute( | 869 if (browserAccessibility_->GetStringAttribute( |
| 870 ui::AX_ATTR_URL, &url)) { | 870 ui::AX_ATTR_URL, &url)) { |
| 871 // Given a url like http://foo.com/bar/baz.png, just return the | 871 // Given a url like http://foo.com/bar/baz.png, just return the |
| 872 // base name, e.g., "baz.png". | 872 // base name, e.g., "baz.png". |
| 873 size_t leftIndex = url.rfind('/'); | 873 size_t leftIndex = url.rfind('/'); |
| (...skipping 2026 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2900 } | 2900 } |
| 2901 | 2901 |
| 2902 - (BOOL)accessibilityNotifiesWhenDestroyed { | 2902 - (BOOL)accessibilityNotifiesWhenDestroyed { |
| 2903 // Indicate that BrowserAccessibilityCocoa will post a notification when it's | 2903 // Indicate that BrowserAccessibilityCocoa will post a notification when it's |
| 2904 // destroyed (see -detach). This allows VoiceOver to do some internal things | 2904 // destroyed (see -detach). This allows VoiceOver to do some internal things |
| 2905 // more efficiently. | 2905 // more efficiently. |
| 2906 return YES; | 2906 return YES; |
| 2907 } | 2907 } |
| 2908 | 2908 |
| 2909 @end | 2909 @end |
| OLD | NEW |