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

Side by Side Diff: chrome/browser/ui/cocoa/tabs/tab_view.mm

Issue 2578303003: a11y: Add a11y information to views::Tab and manually ignore its a11y children. (Closed)
Patch Set: Rebase Created 3 years, 11 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 | « chrome/app/generated_resources.grd ('k') | ui/accessibility/platform/ax_platform_node_mac.mm » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "chrome/browser/ui/cocoa/tabs/tab_view.h" 5 #import "chrome/browser/ui/cocoa/tabs/tab_view.h"
6 6
7 #include "base/i18n/rtl.h" 7 #include "base/i18n/rtl.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "base/mac/sdk_forward_declarations.h" 9 #include "base/mac/sdk_forward_declarations.h"
10 #include "base/strings/sys_string_conversions.h" 10 #include "base/strings/sys_string_conversions.h"
11 #include "chrome/browser/themes/theme_properties.h" 11 #include "chrome/browser/themes/theme_properties.h"
12 #include "chrome/browser/themes/theme_service.h" 12 #include "chrome/browser/themes/theme_service.h"
13 #import "chrome/browser/ui/cocoa/tabs/alert_indicator_button_cocoa.h" 13 #import "chrome/browser/ui/cocoa/tabs/alert_indicator_button_cocoa.h"
14 #import "chrome/browser/ui/cocoa/tabs/tab_controller.h" 14 #import "chrome/browser/ui/cocoa/tabs/tab_controller.h"
15 #import "chrome/browser/ui/cocoa/tabs/tab_window_controller.h" 15 #import "chrome/browser/ui/cocoa/tabs/tab_window_controller.h"
16 #import "chrome/browser/ui/cocoa/themed_window.h" 16 #import "chrome/browser/ui/cocoa/themed_window.h"
17 #import "chrome/browser/ui/cocoa/view_id_util.h" 17 #import "chrome/browser/ui/cocoa/view_id_util.h"
18 #include "chrome/grit/generated_resources.h"
19 #include "chrome/grit/theme_resources.h" 18 #include "chrome/grit/theme_resources.h"
20 #include "skia/ext/skia_utils_mac.h" 19 #include "skia/ext/skia_utils_mac.h"
21 #import "third_party/google_toolbox_for_mac/src/AppKit/GTMFadeTruncatingTextFiel dCell.h" 20 #import "third_party/google_toolbox_for_mac/src/AppKit/GTMFadeTruncatingTextFiel dCell.h"
22 #import "ui/base/cocoa/nsgraphics_context_additions.h" 21 #import "ui/base/cocoa/nsgraphics_context_additions.h"
23 #import "ui/base/cocoa/nsview_additions.h" 22 #import "ui/base/cocoa/nsview_additions.h"
24 #include "ui/base/cocoa/three_part_image.h" 23 #include "ui/base/cocoa/three_part_image.h"
25 #include "ui/base/l10n/l10n_util.h" 24 #include "ui/base/l10n/l10n_util.h"
26 #include "ui/base/material_design/material_design_controller.h" 25 #include "ui/base/material_design/material_design_controller.h"
27 #include "ui/base/resource/resource_bundle.h" 26 #include "ui/base/resource/resource_bundle.h"
28 #include "ui/gfx/scoped_ns_graphics_context_save_gstate_mac.h" 27 #include "ui/gfx/scoped_ns_graphics_context_save_gstate_mac.h"
28 #include "ui/strings/grit/ui_strings.h"
29 29
30 namespace { 30 namespace {
31 31
32 // The color of the icons in dark mode theme. 32 // The color of the icons in dark mode theme.
33 const SkColor kDarkModeIconColor = SkColorSetARGB(0xFF, 0xC4, 0xC4, 0xC4); 33 const SkColor kDarkModeIconColor = SkColorSetARGB(0xFF, 0xC4, 0xC4, 0xC4);
34 34
35 } // namespace 35 } // namespace
36 36
37 // The amount of time in seconds during which each type of glow increases, holds 37 // The amount of time in seconds during which each type of glow increases, holds
38 // steady, and decreases, respectively. 38 // steady, and decreases, respectively.
(...skipping 713 matching lines...) Expand 10 before | Expand all | Expand 10 after
752 NSAccessibilityValueChangedNotification); 752 NSAccessibilityValueChangedNotification);
753 } else { 753 } else {
754 [super accessibilityPerformAction:action]; 754 [super accessibilityPerformAction:action];
755 } 755 }
756 } 756 }
757 757
758 - (id)accessibilityAttributeValue:(NSString*)attribute { 758 - (id)accessibilityAttributeValue:(NSString*)attribute {
759 if ([attribute isEqual:NSAccessibilityRoleAttribute]) 759 if ([attribute isEqual:NSAccessibilityRoleAttribute])
760 return NSAccessibilityRadioButtonRole; 760 return NSAccessibilityRadioButtonRole;
761 if ([attribute isEqual:NSAccessibilityRoleDescriptionAttribute]) 761 if ([attribute isEqual:NSAccessibilityRoleDescriptionAttribute])
762 return l10n_util::GetNSStringWithFixup(IDS_ACCNAME_TAB); 762 return l10n_util::GetNSStringWithFixup(IDS_ACCNAME_TAB_ROLE_DESCRIPTION);
763 if ([attribute isEqual:NSAccessibilityTitleAttribute]) 763 if ([attribute isEqual:NSAccessibilityTitleAttribute])
764 return [controller_ title]; 764 return [controller_ title];
765 if ([attribute isEqual:NSAccessibilityValueAttribute]) 765 if ([attribute isEqual:NSAccessibilityValueAttribute])
766 return [NSNumber numberWithInt:[controller_ selected]]; 766 return [NSNumber numberWithInt:[controller_ selected]];
767 if ([attribute isEqual:NSAccessibilityEnabledAttribute]) 767 if ([attribute isEqual:NSAccessibilityEnabledAttribute])
768 return [NSNumber numberWithBool:YES]; 768 return [NSNumber numberWithBool:YES];
769 769
770 return [super accessibilityAttributeValue:attribute]; 770 return [super accessibilityAttributeValue:attribute];
771 } 771 }
772 772
(...skipping 247 matching lines...) Expand 10 before | Expand all | Expand 10 after
1020 1020
1021 // For "Increase Contrast" mode, use flat black instead of semitransparent black 1021 // For "Increase Contrast" mode, use flat black instead of semitransparent black
1022 // for the tab edge stroke. 1022 // for the tab edge stroke.
1023 + (void)setTabEdgeStrokeColor { 1023 + (void)setTabEdgeStrokeColor {
1024 static NSColor* heavyStrokeColor = 1024 static NSColor* heavyStrokeColor =
1025 [skia::SkColorToSRGBNSColor(SK_ColorBLACK) retain]; 1025 [skia::SkColorToSRGBNSColor(SK_ColorBLACK) retain];
1026 [heavyStrokeColor set]; 1026 [heavyStrokeColor set];
1027 } 1027 }
1028 1028
1029 @end 1029 @end
OLDNEW
« no previous file with comments | « chrome/app/generated_resources.grd ('k') | ui/accessibility/platform/ax_platform_node_mac.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698