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

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

Issue 22331005: Clean up accessibility enums for use in Chromium. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Add forgotten file back Created 7 years, 3 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/web/AssertMatchingEnums.cpp ('k') | Source/web/WebAccessibilityObject.cpp » ('j') | 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 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). 3 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are 6 * modification, are permitted provided that the following conditions are
7 * met: 7 * met:
8 * 8 *
9 * * Redistributions of source code must retain the above copyright 9 * * Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after
121 } 121 }
122 } 122 }
123 123
124 // Converts a WebCore::AXObjectCache::AXNotification to a WebKit::WebAccessibili tyNotification 124 // Converts a WebCore::AXObjectCache::AXNotification to a WebKit::WebAccessibili tyNotification
125 static WebAccessibilityNotification toWebAccessibilityNotification(AXObjectCache ::AXNotification notification) 125 static WebAccessibilityNotification toWebAccessibilityNotification(AXObjectCache ::AXNotification notification)
126 { 126 {
127 // These enums have the same values; enforced in AssertMatchingEnums.cpp. 127 // These enums have the same values; enforced in AssertMatchingEnums.cpp.
128 return static_cast<WebAccessibilityNotification>(notification); 128 return static_cast<WebAccessibilityNotification>(notification);
129 } 129 }
130 130
131 // Converts a WebCore::AXObjectCache::AXNotification to a WebKit::WebAXEvent
132 static WebAXEvent toWebAXEvent(AXObjectCache::AXNotification notification)
133 {
134 // These enums have the same values; enforced in AssertMatchingEnums.cpp.
135 return static_cast<WebAXEvent>(notification);
136 }
137
131 ChromeClientImpl::ChromeClientImpl(WebViewImpl* webView) 138 ChromeClientImpl::ChromeClientImpl(WebViewImpl* webView)
132 : m_webView(webView) 139 : m_webView(webView)
133 , m_toolbarsVisible(true) 140 , m_toolbarsVisible(true)
134 , m_statusbarVisible(true) 141 , m_statusbarVisible(true)
135 , m_scrollbarsVisible(true) 142 , m_scrollbarsVisible(true)
136 , m_menubarVisible(true) 143 , m_menubarVisible(true)
137 , m_resizable(true) 144 , m_resizable(true)
138 , m_pagePopupDriver(webView) 145 , m_pagePopupDriver(webView)
139 { 146 {
140 } 147 }
(...skipping 653 matching lines...) Expand 10 before | Expand all | Expand 10 after
794 info->itemHeight = popupContainer->menuItemHeight(); 801 info->itemHeight = popupContainer->menuItemHeight();
795 info->itemFontSize = popupContainer->menuItemFontSize(); 802 info->itemFontSize = popupContainer->menuItemFontSize();
796 info->selectedIndex = popupContainer->selectedIndex(); 803 info->selectedIndex = popupContainer->selectedIndex();
797 info->items.swap(outputItems); 804 info->items.swap(outputItems);
798 info->rightAligned = popupContainer->menuStyle().textDirection() == RTL; 805 info->rightAligned = popupContainer->menuStyle().textDirection() == RTL;
799 } 806 }
800 807
801 void ChromeClientImpl::postAccessibilityNotification(AccessibilityObject* obj, A XObjectCache::AXNotification notification) 808 void ChromeClientImpl::postAccessibilityNotification(AccessibilityObject* obj, A XObjectCache::AXNotification notification)
802 { 809 {
803 // Alert assistive technology about the accessibility object notification. 810 // Alert assistive technology about the accessibility object notification.
804 if (obj) 811 if (!obj)
805 m_webView->client()->postAccessibilityNotification(WebAccessibilityObjec t(obj), toWebAccessibilityNotification(notification)); 812 return;
813
814 // FIXME: Remove this first call once Chromium has switched over to using th e second. (http://crbug.com/269034)
815 m_webView->client()->postAccessibilityNotification(WebAccessibilityObject(ob j), toWebAccessibilityNotification(notification));
816 m_webView->client()->postAccessibilityEvent(WebAccessibilityObject(obj), toW ebAXEvent(notification));
806 } 817 }
807 818
808 String ChromeClientImpl::acceptLanguages() 819 String ChromeClientImpl::acceptLanguages()
809 { 820 {
810 return m_webView->client()->acceptLanguages(); 821 return m_webView->client()->acceptLanguages();
811 } 822 }
812 823
813 bool ChromeClientImpl::paintCustomOverhangArea(GraphicsContext* context, const I ntRect& horizontalOverhangArea, const IntRect& verticalOverhangArea, const IntRe ct& dirtyRect) 824 bool ChromeClientImpl::paintCustomOverhangArea(GraphicsContext* context, const I ntRect& horizontalOverhangArea, const IntRect& verticalOverhangArea, const IntRe ct& dirtyRect)
814 { 825 {
815 Frame* frame = m_webView->mainFrameImpl()->frame(); 826 Frame* frame = m_webView->mainFrameImpl()->frame();
(...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after
1005 { 1016 {
1006 } 1017 }
1007 1018
1008 void NavigatorContentUtilsClientImpl::registerProtocolHandler(const String& sche me, const String& baseURL, const String& url, const String& title) 1019 void NavigatorContentUtilsClientImpl::registerProtocolHandler(const String& sche me, const String& baseURL, const String& url, const String& title)
1009 { 1020 {
1010 m_webView->client()->registerProtocolHandler(scheme, baseURL, url, title); 1021 m_webView->client()->registerProtocolHandler(scheme, baseURL, url, title);
1011 } 1022 }
1012 #endif 1023 #endif
1013 1024
1014 } // namespace WebKit 1025 } // namespace WebKit
OLDNEW
« no previous file with comments | « Source/web/AssertMatchingEnums.cpp ('k') | Source/web/WebAccessibilityObject.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698