From 516126f099666df7b6eb9882cf51da05a6ab8edd Mon Sep 17 00:00:00 2001 From: "thakis@chromium.org" Date: Sun, 29 Jul 2012 17:31:36 +0000 Subject: mac: Remove one static initializer. The NSAccessibility* strings are not defined, only declared, in NSAccessibility.h, so the compiler needs to emit a static initializer if they are used in a global initializer. BUG=94925 Review URL: https://chromiumcodereview.appspot.com/10821085 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@148914 0039d316-1c4b-4281-b951-d872f2087c98 --- .../accessibility/browser_accessibility_cocoa.mm | 80 +++++++++++----------- 1 file changed, 39 insertions(+), 41 deletions(-) (limited to 'content') diff --git a/content/browser/accessibility/browser_accessibility_cocoa.mm b/content/browser/accessibility/browser_accessibility_cocoa.mm index 22e858a..f26fea7 100644 --- a/content/browser/accessibility/browser_accessibility_cocoa.mm +++ b/content/browser/accessibility/browser_accessibility_cocoa.mm @@ -47,47 +47,6 @@ struct MapEntry { typedef std::map RoleMap; -struct AttributeToMethodNameEntry { - NSString* attribute; - NSString* methodName; -}; - -const AttributeToMethodNameEntry attributeToMethodNameContainer[] = { - { NSAccessibilityChildrenAttribute, @"children" }, - { NSAccessibilityColumnsAttribute, @"columns" }, - { NSAccessibilityDescriptionAttribute, @"description" }, - { NSAccessibilityEnabledAttribute, @"enabled" }, - { NSAccessibilityFocusedAttribute, @"focused" }, - { NSAccessibilityHelpAttribute, @"help" }, - { NSAccessibilityMaxValueAttribute, @"maxValue" }, - { NSAccessibilityMinValueAttribute, @"minValue" }, - { NSAccessibilityNumberOfCharactersAttribute, @"numberOfCharacters" }, - { NSAccessibilityParentAttribute, @"parent" }, - { NSAccessibilityPositionAttribute, @"position" }, - { NSAccessibilityRoleAttribute, @"role" }, - { NSAccessibilityRoleDescriptionAttribute, @"roleDescription" }, - { NSAccessibilityRowsAttribute, @"rows" }, - { NSAccessibilitySizeAttribute, @"size" }, - { NSAccessibilitySubroleAttribute, @"subrole" }, - { NSAccessibilityTabsAttribute, @"tabs" }, - { NSAccessibilityTitleAttribute, @"title" }, - { NSAccessibilityTitleUIElementAttribute, @"titleUIElement" }, - { NSAccessibilityTopLevelUIElementAttribute, @"window" }, - { NSAccessibilityURLAttribute, @"url" }, - { NSAccessibilityValueAttribute, @"value" }, - { NSAccessibilityVisibleCharacterRangeAttribute, @"visibleCharacterRange" }, - { NSAccessibilityWindowAttribute, @"window" }, - { @"AXAccessKey", @"accessKey" }, - { @"AXARIAAtomic", @"ariaAtomic" }, - { @"AXARIABusy", @"ariaBusy" }, - { @"AXARIALive", @"ariaLive" }, - { @"AXARIARelevant", @"ariaRelevant" }, - { @"AXLoaded", @"loaded" }, - { @"AXLoadingProgress", @"loadingProgress" }, - { @"AXRequired", @"required" }, - { @"AXVisited", @"visited" }, -}; - // GetState checks the bitmask used in AccessibilityNodeData to check // if the given state was set on the accessibility object. bool GetState(BrowserAccessibility* accessibility, int state) { @@ -287,6 +246,45 @@ NSDictionary* attributeToMethodNameMap = nil; @implementation BrowserAccessibilityCocoa + (void)initialize { + const struct { + NSString* attribute; + NSString* methodName; + } attributeToMethodNameContainer[] = { + { NSAccessibilityChildrenAttribute, @"children" }, + { NSAccessibilityColumnsAttribute, @"columns" }, + { NSAccessibilityDescriptionAttribute, @"description" }, + { NSAccessibilityEnabledAttribute, @"enabled" }, + { NSAccessibilityFocusedAttribute, @"focused" }, + { NSAccessibilityHelpAttribute, @"help" }, + { NSAccessibilityMaxValueAttribute, @"maxValue" }, + { NSAccessibilityMinValueAttribute, @"minValue" }, + { NSAccessibilityNumberOfCharactersAttribute, @"numberOfCharacters" }, + { NSAccessibilityParentAttribute, @"parent" }, + { NSAccessibilityPositionAttribute, @"position" }, + { NSAccessibilityRoleAttribute, @"role" }, + { NSAccessibilityRoleDescriptionAttribute, @"roleDescription" }, + { NSAccessibilityRowsAttribute, @"rows" }, + { NSAccessibilitySizeAttribute, @"size" }, + { NSAccessibilitySubroleAttribute, @"subrole" }, + { NSAccessibilityTabsAttribute, @"tabs" }, + { NSAccessibilityTitleAttribute, @"title" }, + { NSAccessibilityTitleUIElementAttribute, @"titleUIElement" }, + { NSAccessibilityTopLevelUIElementAttribute, @"window" }, + { NSAccessibilityURLAttribute, @"url" }, + { NSAccessibilityValueAttribute, @"value" }, + { NSAccessibilityVisibleCharacterRangeAttribute, @"visibleCharacterRange" }, + { NSAccessibilityWindowAttribute, @"window" }, + { @"AXAccessKey", @"accessKey" }, + { @"AXARIAAtomic", @"ariaAtomic" }, + { @"AXARIABusy", @"ariaBusy" }, + { @"AXARIALive", @"ariaLive" }, + { @"AXARIARelevant", @"ariaRelevant" }, + { @"AXLoaded", @"loaded" }, + { @"AXLoadingProgress", @"loadingProgress" }, + { @"AXRequired", @"required" }, + { @"AXVisited", @"visited" }, + }; + NSMutableDictionary* dict = [[NSMutableDictionary alloc] init]; const size_t numAttributes = sizeof(attributeToMethodNameContainer) / sizeof(attributeToMethodNameContainer[0]); -- cgit v1.1