diff options
author | dmazzoni@chromium.org <dmazzoni@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-06-25 05:16:22 +0000 |
---|---|---|
committer | dmazzoni@chromium.org <dmazzoni@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-06-25 05:16:22 +0000 |
commit | ba1fa653e6f4137c6c4441d15e3a8e71d2f9d719 (patch) | |
tree | b663c5d75a7d64ac73af84c82f9abe1986ae8f76 | |
parent | 94f8c957011e0d1f9a28607a05066edc2989eaa2 (diff) | |
download | chromium_src-ba1fa653e6f4137c6c4441d15e3a8e71d2f9d719.zip chromium_src-ba1fa653e6f4137c6c4441d15e3a8e71d2f9d719.tar.gz chromium_src-ba1fa653e6f4137c6c4441d15e3a8e71d2f9d719.tar.bz2 |
Re-land: Move browser accessibility code from chrome to content.
BUG=85932
TEST=none
Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=90435
Review URL: http://codereview.chromium.org/7233022
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@90495 0039d316-1c4b-4281-b951-d872f2087c98
33 files changed, 123 insertions, 99 deletions
diff --git a/chrome/browser/accessibility/browser_accessibility_mac_unittest.mm b/chrome/browser/accessibility/browser_accessibility_mac_unittest.mm index 09fb41f1..595fb33 100644 --- a/chrome/browser/accessibility/browser_accessibility_mac_unittest.mm +++ b/chrome/browser/accessibility/browser_accessibility_mac_unittest.mm @@ -7,9 +7,9 @@ #include "base/memory/scoped_ptr.h" #include "base/string_util.h" #include "base/utf_string_conversions.h" -#include "chrome/browser/accessibility/browser_accessibility_cocoa.h" -#include "chrome/browser/accessibility/browser_accessibility_manager.h" #include "chrome/browser/ui/cocoa/cocoa_test_helper.h" +#include "content/browser/accessibility/browser_accessibility_cocoa.h" +#include "content/browser/accessibility/browser_accessibility_manager.h" #include "testing/gtest/include/gtest/gtest.h" #import "testing/gtest_mac.h" diff --git a/chrome/browser/accessibility/browser_accessibility_manager_unittest.cc b/chrome/browser/accessibility/browser_accessibility_manager_unittest.cc index 4d8bb15..79f96b8 100644 --- a/chrome/browser/accessibility/browser_accessibility_manager_unittest.cc +++ b/chrome/browser/accessibility/browser_accessibility_manager_unittest.cc @@ -4,8 +4,8 @@ #include "base/string16.h" #include "base/utf_string_conversions.h" -#include "chrome/browser/accessibility/browser_accessibility.h" -#include "chrome/browser/accessibility/browser_accessibility_manager.h" +#include "content/browser/accessibility/browser_accessibility.h" +#include "content/browser/accessibility/browser_accessibility_manager.h" #include "content/common/view_messages.h" #include "testing/gtest/include/gtest/gtest.h" #include "webkit/glue/webaccessibility.h" diff --git a/chrome/browser/accessibility/browser_accessibility_win_unittest.cc b/chrome/browser/accessibility/browser_accessibility_win_unittest.cc index 66cf70d..f34b11c 100644 --- a/chrome/browser/accessibility/browser_accessibility_win_unittest.cc +++ b/chrome/browser/accessibility/browser_accessibility_win_unittest.cc @@ -4,8 +4,8 @@ #include "base/memory/scoped_ptr.h" #include "base/win/scoped_comptr.h" -#include "chrome/browser/accessibility/browser_accessibility_manager.h" -#include "chrome/browser/accessibility/browser_accessibility_win.h" +#include "content/browser/accessibility/browser_accessibility_manager.h" +#include "content/browser/accessibility/browser_accessibility_win.h" #include "content/common/view_messages.h" #include "testing/gtest/include/gtest/gtest.h" diff --git a/chrome/browser/chrome_browser_application_mac.mm b/chrome/browser/chrome_browser_application_mac.mm index ebb37f5..8c212cf 100644 --- a/chrome/browser/chrome_browser_application_mac.mm +++ b/chrome/browser/chrome_browser_application_mac.mm @@ -10,12 +10,12 @@ #import "base/memory/scoped_nsobject.h" #import "base/sys_string_conversions.h" #import "chrome/app/breakpad_mac.h" -#include "chrome/browser/accessibility/browser_accessibility_state.h" #import "chrome/browser/app_controller_mac.h" #include "chrome/browser/ui/browser_list.h" #import "chrome/browser/ui/cocoa/objc_method_swizzle.h" #import "chrome/browser/ui/cocoa/objc_zombie.h" #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" +#include "content/browser/accessibility/browser_accessibility_state.h" #include "content/browser/renderer_host/render_view_host.h" // The implementation of NSExceptions break various assumptions in the diff --git a/chrome/browser/chrome_content_browser_client.cc b/chrome/browser/chrome_content_browser_client.cc index 47c2226..cff371e 100644 --- a/chrome/browser/chrome_content_browser_client.cc +++ b/chrome/browser/chrome_content_browser_client.cc @@ -6,7 +6,6 @@ #include "base/command_line.h" #include "chrome/app/breakpad_mac.h" -#include "chrome/browser/accessibility/browser_accessibility_state.h" #include "chrome/browser/browser_process.h" #include "chrome/browser/character_encoding.h" #include "chrome/browser/chrome_plugin_message_filter.h" @@ -142,9 +141,6 @@ void ChromeContentBrowserClient::RenderViewHostCreated( new DevToolsHandler(render_view_host); new ExtensionMessageHandler(render_view_host); - if (BrowserAccessibilityState::GetInstance()->IsAccessibleBrowser()) - render_view_host->EnableRendererAccessibility(); - InitRenderViewHostForExtensions(render_view_host); } diff --git a/chrome/browser/renderer_host/render_widget_host_view_mac.h b/chrome/browser/renderer_host/render_widget_host_view_mac.h index 923e401..1d032e7 100644 --- a/chrome/browser/renderer_host/render_widget_host_view_mac.h +++ b/chrome/browser/renderer_host/render_widget_host_view_mac.h @@ -12,9 +12,9 @@ #include "base/memory/scoped_ptr.h" #include "base/task.h" #include "base/time.h" -#include "chrome/browser/accessibility/browser_accessibility_delegate_mac.h" -#include "chrome/browser/accessibility/browser_accessibility_manager.h" #include "chrome/browser/ui/cocoa/base_view.h" +#include "content/browser/accessibility/browser_accessibility_delegate_mac.h" +#include "content/browser/accessibility/browser_accessibility_manager.h" #include "content/browser/renderer_host/accelerated_surface_container_manager_mac.h" #include "content/browser/renderer_host/render_widget_host_view.h" #include "content/common/edit_command.h" diff --git a/chrome/browser/renderer_host/render_widget_host_view_mac.mm b/chrome/browser/renderer_host/render_widget_host_view_mac.mm index b344f08..64aa8c0 100644 --- a/chrome/browser/renderer_host/render_widget_host_view_mac.mm +++ b/chrome/browser/renderer_host/render_widget_host_view_mac.mm @@ -16,7 +16,6 @@ #include "base/sys_info.h" #include "base/sys_string_conversions.h" #import "chrome/app/breakpad_mac.h" -#import "chrome/browser/accessibility/browser_accessibility_cocoa.h" #include "chrome/browser/browser_trial.h" #import "chrome/browser/renderer_host/accelerated_plugin_view_mac.h" #import "chrome/browser/renderer_host/text_input_client_mac.h" @@ -25,6 +24,7 @@ #import "chrome/browser/ui/cocoa/view_id_util.h" #include "chrome/common/render_messages.h" #include "chrome/common/spellcheck_messages.h" +#import "content/browser/accessibility/browser_accessibility_cocoa.h" #include "content/browser/browser_thread.h" #include "content/browser/gpu/gpu_process_host.h" #include "content/browser/gpu/gpu_process_host_ui_shim.h" diff --git a/chrome/browser/renderer_host/render_widget_host_view_win.cc b/chrome/browser/renderer_host/render_widget_host_view_win.cc index fc28ed1..fdb5d85 100644 --- a/chrome/browser/renderer_host/render_widget_host_view_win.cc +++ b/chrome/browser/renderer_host/render_widget_host_view_win.cc @@ -14,14 +14,14 @@ #include "base/win/scoped_comptr.h" #include "base/win/scoped_gdi_object.h" #include "base/win/wrapped_window_proc.h" -#include "chrome/browser/accessibility/browser_accessibility_manager.h" -#include "chrome/browser/accessibility/browser_accessibility_state.h" -#include "chrome/browser/accessibility/browser_accessibility_win.h" #include "chrome/browser/browser_trial.h" #include "chrome/browser/renderer_host/render_widget_host_view_views.h" #include "chrome/common/chrome_constants.h" #include "chrome/common/chrome_switches.h" #include "chrome/common/render_messages.h" +#include "content/browser/accessibility/browser_accessibility_manager.h" +#include "content/browser/accessibility/browser_accessibility_state.h" +#include "content/browser/accessibility/browser_accessibility_win.h" #include "content/browser/browser_thread.h" #include "content/browser/plugin_process_host.h" #include "content/browser/renderer_host/backing_store.h" diff --git a/chrome/browser/renderer_host/render_widget_host_view_win.h b/chrome/browser/renderer_host/render_widget_host_view_win.h index b72d853..70e126c 100644 --- a/chrome/browser/renderer_host/render_widget_host_view_win.h +++ b/chrome/browser/renderer_host/render_widget_host_view_win.h @@ -17,7 +17,7 @@ #include "base/memory/scoped_vector.h" #include "base/task.h" #include "base/win/scoped_comptr.h" -#include "chrome/browser/accessibility/browser_accessibility_manager.h" +#include "content/browser/accessibility/browser_accessibility_manager.h" #include "content/browser/renderer_host/render_widget_host_view.h" #include "content/common/notification_observer.h" #include "content/common/notification_registrar.h" diff --git a/chrome/browser/ui/views/frame/browser_frame_win.cc b/chrome/browser/ui/views/frame/browser_frame_win.cc index e3f5cdc..2b344c6 100644 --- a/chrome/browser/ui/views/frame/browser_frame_win.cc +++ b/chrome/browser/ui/views/frame/browser_frame_win.cc @@ -9,10 +9,10 @@ #include <set> -#include "chrome/browser/accessibility/browser_accessibility_state.h" #include "chrome/browser/ui/browser_list.h" #include "chrome/browser/ui/views/frame/browser_frame_views.h" #include "chrome/browser/ui/views/frame/browser_view.h" +#include "content/browser/accessibility/browser_accessibility_state.h" #include "grit/theme_resources.h" #include "ui/base/theme_provider.h" #include "ui/gfx/font.h" @@ -221,4 +221,3 @@ NativeBrowserFrame* NativeBrowserFrame::CreateNativeBrowserFrame( return new BrowserFrameViews(browser_frame, browser_view); return new BrowserFrameWin(browser_frame, browser_view); } - diff --git a/chrome/browser/ui/views/toolbar_view.cc b/chrome/browser/ui/views/toolbar_view.cc index c9908f4..d9c1958 100644 --- a/chrome/browser/ui/views/toolbar_view.cc +++ b/chrome/browser/ui/views/toolbar_view.cc @@ -7,7 +7,6 @@ #include "base/i18n/number_formatting.h" #include "base/utf_string_conversions.h" #include "chrome/app/chrome_command_ids.h" -#include "chrome/browser/accessibility/browser_accessibility_state.h" #include "chrome/browser/prefs/pref_service.h" #include "chrome/browser/profiles/profile.h" #include "chrome/browser/ui/browser.h" @@ -19,6 +18,7 @@ #include "chrome/browser/ui/views/wrench_menu.h" #include "chrome/browser/upgrade_detector.h" #include "chrome/common/pref_names.h" +#include "content/browser/accessibility/browser_accessibility_state.h" #include "content/browser/user_metrics.h" #include "content/common/notification_service.h" #include "grit/chromium_strings.h" diff --git a/chrome/chrome_browser.gypi b/chrome/chrome_browser.gypi index 7ecc30d..289f3d1 100644 --- a/chrome/chrome_browser.gypi +++ b/chrome/chrome_browser.gypi @@ -75,23 +75,6 @@ # mocks. 'browser/about_flags.cc', 'browser/about_flags.h', - 'browser/accessibility/browser_accessibility.cc', - 'browser/accessibility/browser_accessibility.h', - 'browser/accessibility/browser_accessibility_cocoa.h', - 'browser/accessibility/browser_accessibility_cocoa.mm', - 'browser/accessibility/browser_accessibility_delegate_mac.h', - 'browser/accessibility/browser_accessibility_mac.h', - 'browser/accessibility/browser_accessibility_mac.mm', - 'browser/accessibility/browser_accessibility_manager.cc', - 'browser/accessibility/browser_accessibility_manager.h', - 'browser/accessibility/browser_accessibility_manager_mac.h', - 'browser/accessibility/browser_accessibility_manager_mac.mm', - 'browser/accessibility/browser_accessibility_manager_win.cc', - 'browser/accessibility/browser_accessibility_manager_win.h', - 'browser/accessibility/browser_accessibility_state.cc', - 'browser/accessibility/browser_accessibility_state.h', - 'browser/accessibility/browser_accessibility_win.cc', - 'browser/accessibility/browser_accessibility_win.h', 'browser/accessibility_events.cc', 'browser/accessibility_events.h', 'browser/aeropeek_manager.cc', diff --git a/content/browser/accessibility/OWNERS b/content/browser/accessibility/OWNERS new file mode 100644 index 0000000..843e2c4 --- /dev/null +++ b/content/browser/accessibility/OWNERS @@ -0,0 +1,9 @@ +ctguil@chromium.org +dmazzoni@chromium.org +dtseng@chromium.org +ctguil@chromium.org +dmazzoni@chromium.org +dtseng@chromium.org +ctguil@chromium.org +dmazzoni@chromium.org +dtseng@chromium.org diff --git a/chrome/browser/accessibility/browser_accessibility.cc b/content/browser/accessibility/browser_accessibility.cc index 92a4819..784bae0 100644 --- a/chrome/browser/accessibility/browser_accessibility.cc +++ b/content/browser/accessibility/browser_accessibility.cc @@ -2,11 +2,11 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "chrome/browser/accessibility/browser_accessibility.h" +#include "content/browser/accessibility/browser_accessibility.h" #include "base/logging.h" #include "base/string_number_conversions.h" -#include "chrome/browser/accessibility/browser_accessibility_manager.h" +#include "content/browser/accessibility/browser_accessibility_manager.h" #if defined(OS_POSIX) && !defined(OS_MACOSX) // There's no OS-specific implementation of BrowserAccessibilityManager diff --git a/chrome/browser/accessibility/browser_accessibility.h b/content/browser/accessibility/browser_accessibility.h index 3234372..dbd3e13 100644 --- a/chrome/browser/accessibility/browser_accessibility.h +++ b/content/browser/accessibility/browser_accessibility.h @@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef CHROME_BROWSER_ACCESSIBILITY_BROWSER_ACCESSIBILITY_H_ -#define CHROME_BROWSER_ACCESSIBILITY_BROWSER_ACCESSIBILITY_H_ +#ifndef CONTENT_BROWSER_ACCESSIBILITY_BROWSER_ACCESSIBILITY_H_ +#define CONTENT_BROWSER_ACCESSIBILITY_BROWSER_ACCESSIBILITY_H_ #pragma once #include <map> @@ -224,4 +224,4 @@ class BrowserAccessibility { DISALLOW_COPY_AND_ASSIGN(BrowserAccessibility); }; -#endif // CHROME_BROWSER_ACCESSIBILITY_BROWSER_ACCESSIBILITY_H_ +#endif // CONTENT_BROWSER_ACCESSIBILITY_BROWSER_ACCESSIBILITY_H_ diff --git a/chrome/browser/accessibility/browser_accessibility_cocoa.h b/content/browser/accessibility/browser_accessibility_cocoa.h index db224e0..ab4044f 100644 --- a/chrome/browser/accessibility/browser_accessibility_cocoa.h +++ b/content/browser/accessibility/browser_accessibility_cocoa.h @@ -2,15 +2,15 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef CHROME_BROWSER_ACCESSIBILITY_BROWSER_ACCESSIBILITY_COCOA_H_ -#define CHROME_BROWSER_ACCESSIBILITY_BROWSER_ACCESSIBILITY_COCOA_H_ +#ifndef CONTENT_BROWSER_ACCESSIBILITY_BROWSER_ACCESSIBILITY_COCOA_H_ +#define CONTENT_BROWSER_ACCESSIBILITY_BROWSER_ACCESSIBILITY_COCOA_H_ #pragma once #import <Cocoa/Cocoa.h> #import "base/memory/scoped_nsobject.h" -#import "chrome/browser/accessibility/browser_accessibility_delegate_mac.h" -#include "chrome/browser/accessibility/browser_accessibility.h" +#import "content/browser/accessibility/browser_accessibility_delegate_mac.h" +#include "content/browser/accessibility/browser_accessibility.h" // BrowserAccessibilityCocoa is a cocoa wrapper around the BrowserAccessibility // object. The renderer converts webkit's accessibility tree into a @@ -73,4 +73,4 @@ @property(nonatomic, readonly) id window; @end -#endif // CHROME_BROWSER_ACCESSIBILITY_BROWSER_ACCESSIBILITY_COCOA_H_ +#endif // CONTENT_BROWSER_ACCESSIBILITY_BROWSER_ACCESSIBILITY_COCOA_H_ diff --git a/chrome/browser/accessibility/browser_accessibility_cocoa.mm b/content/browser/accessibility/browser_accessibility_cocoa.mm index f4ed2e4..c4a670a 100644 --- a/chrome/browser/accessibility/browser_accessibility_cocoa.mm +++ b/content/browser/accessibility/browser_accessibility_cocoa.mm @@ -4,17 +4,17 @@ #include <execinfo.h> -#import "chrome/browser/accessibility/browser_accessibility_cocoa.h" +#import "content/browser/accessibility/browser_accessibility_cocoa.h" #include <map> #include "base/string16.h" #include "base/sys_string_conversions.h" #include "base/utf_string_conversions.h" -#include "chrome/browser/renderer_host/render_widget_host_view_mac.h" +#include "content/browser/accessibility/browser_accessibility_manager.h" +#include "content/common/content_client.h" #include "grit/webkit_strings.h" #include "third_party/WebKit/Source/WebKit/chromium/public/WebRect.h" -#include "ui/base/l10n/l10n_util_mac.h" namespace { @@ -383,15 +383,24 @@ NSDictionary* attributeToMethodNameMap = nil; // Returns a string indicating the role description of this object. - (NSString*)roleDescription { NSString* role = [self role]; + + content::ContentClient* content_client = content::GetContentClient(); + // The following descriptions are specific to webkit. - if ([role isEqualToString:@"AXWebArea"]) - return l10n_util::GetNSString(IDS_AX_ROLE_WEB_AREA); + if ([role isEqualToString:@"AXWebArea"]) { + return base::SysUTF16ToNSString(content_client->GetLocalizedString( + IDS_AX_ROLE_WEB_AREA)); + } - if ([role isEqualToString:@"NSAccessibilityLinkRole"]) - return l10n_util::GetNSString(IDS_AX_ROLE_LINK); + if ([role isEqualToString:@"NSAccessibilityLinkRole"]) { + return base::SysUTF16ToNSString(content_client->GetLocalizedString( + IDS_AX_ROLE_LINK)); + } - if ([role isEqualToString:@"AXHeading"]) - return l10n_util::GetNSString(IDS_AX_ROLE_HEADING); + if ([role isEqualToString:@"AXHeading"]) { + return base::SysUTF16ToNSString(content_client->GetLocalizedString( + IDS_AX_ROLE_HEADING)); + } if ([role isEqualToString:NSAccessibilityGroupRole] || [role isEqualToString:NSAccessibilityRadioButtonRole]) { diff --git a/chrome/browser/accessibility/browser_accessibility_delegate_mac.h b/content/browser/accessibility/browser_accessibility_delegate_mac.h index 1fd27c1..680ab87 100644 --- a/chrome/browser/accessibility/browser_accessibility_delegate_mac.h +++ b/content/browser/accessibility/browser_accessibility_delegate_mac.h @@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef CHROME_BROWSER_ACCESSIBILITY_BROWSER_ACCESSIBILITY_DELEGATE_MAC_H_ -#define CHROME_BROWSER_ACCESSIBILITY_BROWSER_ACCESSIBILITY_DELEGATE_MAC_H_ +#ifndef CONTENT_BROWSER_ACCESSIBILITY_BROWSER_ACCESSIBILITY_DELEGATE_MAC_H_ +#define CONTENT_BROWSER_ACCESSIBILITY_BROWSER_ACCESSIBILITY_DELEGATE_MAC_H_ #pragma once @class BrowserAccessibilityCocoa; @@ -21,4 +21,4 @@ - (NSWindow*)window; @end -#endif // CHROME_BROWSER_ACCESSIBILITY_BROWSER_ACCESSIBILITY_DELEGATE_MAC_H_ +#endif // CONTENT_BROWSER_ACCESSIBILITY_BROWSER_ACCESSIBILITY_DELEGATE_MAC_H_ diff --git a/chrome/browser/accessibility/browser_accessibility_mac.h b/content/browser/accessibility/browser_accessibility_mac.h index 027ab94..ee6cfca 100644 --- a/chrome/browser/accessibility/browser_accessibility_mac.h +++ b/content/browser/accessibility/browser_accessibility_mac.h @@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef CHROME_BROWSER_ACCESSIBILITY_BROWSER_ACCESSIBILITY_MAC_H_ -#define CHROME_BROWSER_ACCESSIBILITY_BROWSER_ACCESSIBILITY_MAC_H_ +#ifndef CONTENT_BROWSER_ACCESSIBILITY_BROWSER_ACCESSIBILITY_MAC_H_ +#define CONTENT_BROWSER_ACCESSIBILITY_BROWSER_ACCESSIBILITY_MAC_H_ #pragma once #include <map> @@ -11,7 +11,7 @@ #include <vector> #include "base/memory/scoped_nsobject.h" -#include "chrome/browser/accessibility/browser_accessibility.h" +#include "content/browser/accessibility/browser_accessibility.h" @class BrowserAccessibilityCocoa; @@ -43,4 +43,4 @@ class BrowserAccessibilityMac : public BrowserAccessibility { DISALLOW_COPY_AND_ASSIGN(BrowserAccessibilityMac); }; -#endif // CHROME_BROWSER_ACCESSIBILITY_BROWSER_ACCESSIBILITY_MAC_H_ +#endif // CONTENT_BROWSER_ACCESSIBILITY_BROWSER_ACCESSIBILITY_MAC_H_ diff --git a/chrome/browser/accessibility/browser_accessibility_mac.mm b/content/browser/accessibility/browser_accessibility_mac.mm index 6594c7e..145294d 100644 --- a/chrome/browser/accessibility/browser_accessibility_mac.mm +++ b/content/browser/accessibility/browser_accessibility_mac.mm @@ -4,12 +4,11 @@ #import <Cocoa/Cocoa.h> -#import "chrome/browser/accessibility/browser_accessibility_mac.h" +#import "content/browser/accessibility/browser_accessibility_mac.h" -#import "chrome/browser/accessibility/browser_accessibility_cocoa.h" -#import "chrome/browser/accessibility/browser_accessibility_delegate_mac.h" -#include "chrome/browser/accessibility/browser_accessibility_manager.h" -#import "chrome/browser/renderer_host/render_widget_host_view_mac.h" +#import "content/browser/accessibility/browser_accessibility_cocoa.h" +#import "content/browser/accessibility/browser_accessibility_delegate_mac.h" +#include "content/browser/accessibility/browser_accessibility_manager.h" // Static. @@ -30,7 +29,8 @@ void BrowserAccessibilityMac::Initialize() { // We take ownership of the cocoa obj here. browser_accessibility_cocoa_ = [[BrowserAccessibilityCocoa alloc] initWithObject:this - delegate:(RenderWidgetHostViewCocoa*)manager_->GetParentView()]; + delegate: + (id<BrowserAccessibilityDelegateCocoa>)manager_->GetParentView()]; } void BrowserAccessibilityMac::NativeReleaseReference() { diff --git a/chrome/browser/accessibility/browser_accessibility_manager.cc b/content/browser/accessibility/browser_accessibility_manager.cc index 4c58228..a99c782 100644 --- a/chrome/browser/accessibility/browser_accessibility_manager.cc +++ b/content/browser/accessibility/browser_accessibility_manager.cc @@ -2,10 +2,10 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "chrome/browser/accessibility/browser_accessibility_manager.h" +#include "content/browser/accessibility/browser_accessibility_manager.h" #include "base/logging.h" -#include "chrome/browser/accessibility/browser_accessibility.h" +#include "content/browser/accessibility/browser_accessibility.h" #include "content/common/view_messages.h" using webkit_glue::WebAccessibility; diff --git a/chrome/browser/accessibility/browser_accessibility_manager.h b/content/browser/accessibility/browser_accessibility_manager.h index 1014f33..bbb7d77 100644 --- a/chrome/browser/accessibility/browser_accessibility_manager.h +++ b/content/browser/accessibility/browser_accessibility_manager.h @@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef CHROME_BROWSER_ACCESSIBILITY_BROWSER_ACCESSIBILITY_MANAGER_H_ -#define CHROME_BROWSER_ACCESSIBILITY_BROWSER_ACCESSIBILITY_MANAGER_H_ +#ifndef CONTENT_BROWSER_ACCESSIBILITY_BROWSER_ACCESSIBILITY_MANAGER_H_ +#define CONTENT_BROWSER_ACCESSIBILITY_BROWSER_ACCESSIBILITY_MANAGER_H_ #pragma once #include <vector> @@ -174,4 +174,4 @@ class BrowserAccessibilityManager { DISALLOW_COPY_AND_ASSIGN(BrowserAccessibilityManager); }; -#endif // CHROME_BROWSER_ACCESSIBILITY_BROWSER_ACCESSIBILITY_MANAGER_H_ +#endif // CONTENT_BROWSER_ACCESSIBILITY_BROWSER_ACCESSIBILITY_MANAGER_H_ diff --git a/chrome/browser/accessibility/browser_accessibility_manager_mac.h b/content/browser/accessibility/browser_accessibility_manager_mac.h index dc35d6f..c7c5089 100644 --- a/chrome/browser/accessibility/browser_accessibility_manager_mac.h +++ b/content/browser/accessibility/browser_accessibility_manager_mac.h @@ -2,13 +2,13 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef CHROME_BROWSER_ACCESSIBILITY_BROWSER_ACCESSIBILITY_MANAGER_MAC_H_ -#define CHROME_BROWSER_ACCESSIBILITY_BROWSER_ACCESSIBILITY_MANAGER_MAC_H_ +#ifndef CONTENT_BROWSER_ACCESSIBILITY_BROWSER_ACCESSIBILITY_MANAGER_MAC_H_ +#define CONTENT_BROWSER_ACCESSIBILITY_BROWSER_ACCESSIBILITY_MANAGER_MAC_H_ #pragma once #import <Cocoa/Cocoa.h> -#include "chrome/browser/accessibility/browser_accessibility_manager.h" +#include "content/browser/accessibility/browser_accessibility_manager.h" class BrowserAccessibilityManagerMac : public BrowserAccessibilityManager { public: @@ -28,4 +28,4 @@ class BrowserAccessibilityManagerMac : public BrowserAccessibilityManager { DISALLOW_COPY_AND_ASSIGN(BrowserAccessibilityManagerMac); }; -#endif // CHROME_BROWSER_ACCESSIBILITY_BROWSER_ACCESSIBILITY_MANAGER_MAC_H_ +#endif // CONTENT_BROWSER_ACCESSIBILITY_BROWSER_ACCESSIBILITY_MANAGER_MAC_H_ diff --git a/chrome/browser/accessibility/browser_accessibility_manager_mac.mm b/content/browser/accessibility/browser_accessibility_manager_mac.mm index 5c876e3..b5618fe3 100644 --- a/chrome/browser/accessibility/browser_accessibility_manager_mac.mm +++ b/content/browser/accessibility/browser_accessibility_manager_mac.mm @@ -2,10 +2,10 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "chrome/browser/accessibility/browser_accessibility_manager_mac.h" +#include "content/browser/accessibility/browser_accessibility_manager_mac.h" #import "base/logging.h" -#import "chrome/browser/accessibility/browser_accessibility_cocoa.h" +#import "content/browser/accessibility/browser_accessibility_cocoa.h" #include "content/common/view_messages.h" // static diff --git a/chrome/browser/accessibility/browser_accessibility_manager_win.cc b/content/browser/accessibility/browser_accessibility_manager_win.cc index 92a290c..7b992e7 100644 --- a/chrome/browser/accessibility/browser_accessibility_manager_win.cc +++ b/content/browser/accessibility/browser_accessibility_manager_win.cc @@ -2,9 +2,9 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "chrome/browser/accessibility/browser_accessibility_manager_win.h" +#include "content/browser/accessibility/browser_accessibility_manager_win.h" -#include "chrome/browser/accessibility/browser_accessibility_win.h" +#include "content/browser/accessibility/browser_accessibility_win.h" #include "content/common/view_messages.h" using webkit_glue::WebAccessibility; diff --git a/chrome/browser/accessibility/browser_accessibility_manager_win.h b/content/browser/accessibility/browser_accessibility_manager_win.h index 59af0a2..04ea53f 100644 --- a/chrome/browser/accessibility/browser_accessibility_manager_win.h +++ b/content/browser/accessibility/browser_accessibility_manager_win.h @@ -2,14 +2,14 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef CHROME_BROWSER_ACCESSIBILITY_BROWSER_ACCESSIBILITY_MANAGER_WIN_H_ -#define CHROME_BROWSER_ACCESSIBILITY_BROWSER_ACCESSIBILITY_MANAGER_WIN_H_ +#ifndef CONTENT_BROWSER_ACCESSIBILITY_BROWSER_ACCESSIBILITY_MANAGER_WIN_H_ +#define CONTENT_BROWSER_ACCESSIBILITY_BROWSER_ACCESSIBILITY_MANAGER_WIN_H_ #pragma once #include <oleacc.h> #include "base/win/scoped_comptr.h" -#include "chrome/browser/accessibility/browser_accessibility_manager.h" +#include "content/browser/accessibility/browser_accessibility_manager.h" #include "webkit/glue/webaccessibility.h" class BrowserAccessibilityWin; @@ -45,4 +45,4 @@ class BrowserAccessibilityManagerWin : public BrowserAccessibilityManager { DISALLOW_COPY_AND_ASSIGN(BrowserAccessibilityManagerWin); }; -#endif // CHROME_BROWSER_ACCESSIBILITY_BROWSER_ACCESSIBILITY_MANAGER_WIN_H_ +#endif // CONTENT_BROWSER_ACCESSIBILITY_BROWSER_ACCESSIBILITY_MANAGER_WIN_H_ diff --git a/chrome/browser/accessibility/browser_accessibility_state.cc b/content/browser/accessibility/browser_accessibility_state.cc index bc818d3..45b3a3b 100644 --- a/chrome/browser/accessibility/browser_accessibility_state.cc +++ b/content/browser/accessibility/browser_accessibility_state.cc @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "chrome/browser/accessibility/browser_accessibility_state.h" +#include "content/browser/accessibility/browser_accessibility_state.h" #include "base/memory/singleton.h" diff --git a/chrome/browser/accessibility/browser_accessibility_state.h b/content/browser/accessibility/browser_accessibility_state.h index 710f18a..82cb8a3 100644 --- a/chrome/browser/accessibility/browser_accessibility_state.h +++ b/content/browser/accessibility/browser_accessibility_state.h @@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef CHROME_BROWSER_ACCESSIBILITY_BROWSER_ACCESSIBILITY_STATE_H_ -#define CHROME_BROWSER_ACCESSIBILITY_BROWSER_ACCESSIBILITY_STATE_H_ +#ifndef CONTENT_BROWSER_ACCESSIBILITY_BROWSER_ACCESSIBILITY_STATE_H_ +#define CONTENT_BROWSER_ACCESSIBILITY_BROWSER_ACCESSIBILITY_STATE_H_ #pragma once #include "base/basictypes.h" @@ -37,7 +37,7 @@ class BrowserAccessibilityState { // Called when screen reader client is detected. void OnScreenReaderDetected(); - // Returns true if the Chrome browser should be customized for accessibility. + // Returns true if the browser should be customized for accessibility. bool IsAccessibleBrowser(); private: @@ -50,4 +50,4 @@ class BrowserAccessibilityState { DISALLOW_COPY_AND_ASSIGN(BrowserAccessibilityState); }; -#endif // CHROME_BROWSER_ACCESSIBILITY_BROWSER_ACCESSIBILITY_STATE_H_ +#endif // CONTENT_BROWSER_ACCESSIBILITY_BROWSER_ACCESSIBILITY_STATE_H_ diff --git a/chrome/browser/accessibility/browser_accessibility_win.cc b/content/browser/accessibility/browser_accessibility_win.cc index a543c12..8cd1566 100644 --- a/chrome/browser/accessibility/browser_accessibility_win.cc +++ b/content/browser/accessibility/browser_accessibility_win.cc @@ -2,12 +2,12 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "chrome/browser/accessibility/browser_accessibility_win.h" +#include "content/browser/accessibility/browser_accessibility_win.h" #include "base/string_number_conversions.h" #include "base/string_util.h" #include "base/utf_string_conversions.h" -#include "chrome/browser/accessibility/browser_accessibility_manager_win.h" +#include "content/browser/accessibility/browser_accessibility_manager_win.h" #include "net/base/escape.h" using webkit_glue::WebAccessibility; diff --git a/chrome/browser/accessibility/browser_accessibility_win.h b/content/browser/accessibility/browser_accessibility_win.h index 78d0ecd..fb8e014 100644 --- a/chrome/browser/accessibility/browser_accessibility_win.h +++ b/content/browser/accessibility/browser_accessibility_win.h @@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef CHROME_BROWSER_ACCESSIBILITY_BROWSER_ACCESSIBILITY_WIN_H_ -#define CHROME_BROWSER_ACCESSIBILITY_BROWSER_ACCESSIBILITY_WIN_H_ +#ifndef CONTENT_BROWSER_ACCESSIBILITY_BROWSER_ACCESSIBILITY_WIN_H_ +#define CONTENT_BROWSER_ACCESSIBILITY_BROWSER_ACCESSIBILITY_WIN_H_ #pragma once #include <atlbase.h> @@ -12,7 +12,7 @@ #include <vector> -#include "chrome/browser/accessibility/browser_accessibility.h" +#include "content/browser/accessibility/browser_accessibility.h" #include "ia2_api_all.h" // Generated #include "ISimpleDOMDocument.h" // Generated #include "ISimpleDOMNode.h" // Generated @@ -496,4 +496,4 @@ class BrowserAccessibilityWin DISALLOW_COPY_AND_ASSIGN(BrowserAccessibilityWin); }; -#endif // CHROME_BROWSER_ACCESSIBILITY_BROWSER_ACCESSIBILITY_WIN_H_ +#endif // CONTENT_BROWSER_ACCESSIBILITY_BROWSER_ACCESSIBILITY_WIN_H_ diff --git a/content/browser/renderer_host/render_widget_host.cc b/content/browser/renderer_host/render_widget_host.cc index 1f98484..b962f6e 100644 --- a/content/browser/renderer_host/render_widget_host.cc +++ b/content/browser/renderer_host/render_widget_host.cc @@ -11,6 +11,7 @@ #include "base/message_loop.h" #include "base/metrics/histogram.h" #include "base/utf_string_conversions.h" +#include "content/browser/accessibility/browser_accessibility_state.h" #include "content/browser/gpu/gpu_process_host.h" #include "content/browser/renderer_host/backing_store.h" #include "content/browser/renderer_host/backing_store_manager.h" @@ -90,7 +91,8 @@ RenderWidgetHost::RenderWidgetHost(RenderProcessHost* process, process_->WidgetRestored(); if (CommandLine::ForCurrentProcess()->HasSwitch( - switches::kForceRendererAccessibility)) { + switches::kForceRendererAccessibility) || + BrowserAccessibilityState::GetInstance()->IsAccessibleBrowser()) { EnableRendererAccessibility(); } } diff --git a/content/content_browser.gypi b/content/content_browser.gypi index 909478f..54fc51b 100644 --- a/content/content_browser.gypi +++ b/content/content_browser.gypi @@ -20,11 +20,31 @@ '../third_party/WebKit/Source/WebKit/chromium/WebKit.gyp:webkit', '../third_party/zlib/zlib.gyp:zlib', '../ui/ui.gyp:ui_base', + '../webkit/support/webkit_support.gyp:webkit_resources', + '../webkit/support/webkit_support.gyp:webkit_strings', ], 'include_dirs': [ '..', + '<(INTERMEDIATE_DIR)', ], 'sources': [ + 'browser/accessibility/browser_accessibility.cc', + 'browser/accessibility/browser_accessibility.h', + 'browser/accessibility/browser_accessibility_cocoa.h', + 'browser/accessibility/browser_accessibility_cocoa.mm', + 'browser/accessibility/browser_accessibility_delegate_mac.h', + 'browser/accessibility/browser_accessibility_mac.h', + 'browser/accessibility/browser_accessibility_mac.mm', + 'browser/accessibility/browser_accessibility_manager.cc', + 'browser/accessibility/browser_accessibility_manager.h', + 'browser/accessibility/browser_accessibility_manager_mac.h', + 'browser/accessibility/browser_accessibility_manager_mac.mm', + 'browser/accessibility/browser_accessibility_manager_win.cc', + 'browser/accessibility/browser_accessibility_manager_win.h', + 'browser/accessibility/browser_accessibility_state.cc', + 'browser/accessibility/browser_accessibility_state.h', + 'browser/accessibility/browser_accessibility_win.cc', + 'browser/accessibility/browser_accessibility_win.h', 'browser/appcache/appcache_dispatcher_host.cc', 'browser/appcache/appcache_dispatcher_host.h', 'browser/appcache/appcache_frontend_proxy.cc', @@ -426,6 +446,9 @@ 'dependencies': [ # For enable-handle-auditing switch '../sandbox/sandbox.gyp:sandbox', + # For accessibility + '../third_party/iaccessible2/iaccessible2.gyp:iaccessible2', + '../third_party/isimpledom/isimpledom.gyp:isimpledom', ], }], ['toolkit_uses_gtk == 1', { diff --git a/webkit/glue/webkit_glue.gypi b/webkit/glue/webkit_glue.gypi index 8446100..a0942c6 100644 --- a/webkit/glue/webkit_glue.gypi +++ b/webkit/glue/webkit_glue.gypi @@ -36,6 +36,9 @@ }, ], 'includes': [ '../../build/grit_target.gypi' ], + 'direct_dependent_settings': { + 'include_dirs': [ '<(grit_out_dir)' ], + }, }, { 'target_name': 'webkit_strings', |