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

Side by Side Diff: content/browser/renderer_host/render_widget_host_view_aura.cc

Issue 273423004: Migrate accessibility from RenderView to RenderFrame. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 7 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 | Annotate | Revision Log
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 #include "content/browser/renderer_host/render_widget_host_view_aura.h" 5 #include "content/browser/renderer_host/render_widget_host_view_aura.h"
6 6
7 #include "base/auto_reset.h" 7 #include "base/auto_reset.h"
8 #include "base/basictypes.h" 8 #include "base/basictypes.h"
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/callback_helpers.h" 10 #include "base/callback_helpers.h"
(...skipping 618 matching lines...) Expand 10 before | Expand all | Expand 10 after
629 return static_cast<gfx::NativeViewId>(NULL); 629 return static_cast<gfx::NativeViewId>(NULL);
630 } 630 }
631 631
632 gfx::NativeViewAccessible RenderWidgetHostViewAura::GetNativeViewAccessible() { 632 gfx::NativeViewAccessible RenderWidgetHostViewAura::GetNativeViewAccessible() {
633 #if defined(OS_WIN) 633 #if defined(OS_WIN)
634 aura::WindowTreeHost* host = window_->GetHost(); 634 aura::WindowTreeHost* host = window_->GetHost();
635 if (!host) 635 if (!host)
636 return static_cast<gfx::NativeViewAccessible>(NULL); 636 return static_cast<gfx::NativeViewAccessible>(NULL);
637 HWND hwnd = host->GetAcceleratedWidget(); 637 HWND hwnd = host->GetAcceleratedWidget();
638 638
639 CreateBrowserAccessibilityManagerIfNeeded(); 639 CreateBrowserAccessibilityManagerIfNeeded(NULL);
640 BrowserAccessibilityManager* manager = GetBrowserAccessibilityManager(); 640 BrowserAccessibilityManager* manager = GetBrowserAccessibilityManager();
641 if (manager) 641 if (manager)
642 return manager->GetRoot()->ToBrowserAccessibilityWin(); 642 return manager->GetRoot()->ToBrowserAccessibilityWin();
643 #endif 643 #endif
644 644
645 NOTIMPLEMENTED(); 645 NOTIMPLEMENTED();
646 return static_cast<gfx::NativeViewAccessible>(NULL); 646 return static_cast<gfx::NativeViewAccessible>(NULL);
647 } 647 }
648 648
649 void RenderWidgetHostViewAura::SetKeyboardFocus() { 649 void RenderWidgetHostViewAura::SetKeyboardFocus() {
(...skipping 530 matching lines...) Expand 10 before | Expand all | Expand 10 after
1180 RenderWidgetHostViewAura::CreateSyntheticGestureTarget() { 1180 RenderWidgetHostViewAura::CreateSyntheticGestureTarget() {
1181 return scoped_ptr<SyntheticGestureTarget>( 1181 return scoped_ptr<SyntheticGestureTarget>(
1182 new SyntheticGestureTargetAura(host_)); 1182 new SyntheticGestureTargetAura(host_));
1183 } 1183 }
1184 1184
1185 void RenderWidgetHostViewAura::SetScrollOffsetPinning( 1185 void RenderWidgetHostViewAura::SetScrollOffsetPinning(
1186 bool is_pinned_to_left, bool is_pinned_to_right) { 1186 bool is_pinned_to_left, bool is_pinned_to_right) {
1187 // Not needed. Mac-only. 1187 // Not needed. Mac-only.
1188 } 1188 }
1189 1189
1190 void RenderWidgetHostViewAura::CreateBrowserAccessibilityManagerIfNeeded() { 1190 void RenderWidgetHostViewAura::CreateBrowserAccessibilityManagerIfNeeded(
1191 if (GetBrowserAccessibilityManager()) 1191 BrowserAccessibilityDelegate* delegate) {
1192 if (GetBrowserAccessibilityManager()) {
1193 if (delegate)
1194 GetBrowserAccessibilityManager()->set_delegate(delegate);
1192 return; 1195 return;
1196 }
1193 1197
1194 BrowserAccessibilityManager* manager = NULL; 1198 BrowserAccessibilityManager* manager = NULL;
1195 #if defined(OS_WIN) 1199 #if defined(OS_WIN)
1196 aura::WindowTreeHost* host = window_->GetHost(); 1200 aura::WindowTreeHost* host = window_->GetHost();
1197 if (!host) 1201 if (!host)
1198 return; 1202 return;
1199 HWND hwnd = host->GetAcceleratedWidget(); 1203 HWND hwnd = host->GetAcceleratedWidget();
1200 1204
1201 // The accessible_parent may be NULL at this point. The WebContents will pass 1205 // The accessible_parent may be NULL at this point. The WebContents will pass
1202 // it down to this instance (by way of the RenderViewHost and 1206 // it down to this instance (by way of the RenderViewHost and
1203 // RenderWidgetHost) when it is known. This instance will then set it on its 1207 // RenderWidgetHost) when it is known. This instance will then set it on its
1204 // BrowserAccessibilityManager. 1208 // BrowserAccessibilityManager.
1205 gfx::NativeViewAccessible accessible_parent = 1209 gfx::NativeViewAccessible accessible_parent =
1206 host_->GetParentNativeViewAccessible(); 1210 host_->GetParentNativeViewAccessible();
1207 1211
1208 if (legacy_render_widget_host_HWND_) { 1212 if (legacy_render_widget_host_HWND_) {
1209 manager = new BrowserAccessibilityManagerWin( 1213 manager = new BrowserAccessibilityManagerWin(
1210 legacy_render_widget_host_HWND_.get(), accessible_parent, 1214 legacy_render_widget_host_HWND_.get(), accessible_parent,
1211 BrowserAccessibilityManagerWin::GetEmptyDocument(), host_); 1215 BrowserAccessibilityManagerWin::GetEmptyDocument(), delegate);
1212 } 1216 }
1213 #else 1217 #else
1214 manager = BrowserAccessibilityManager::Create( 1218 manager = BrowserAccessibilityManager::Create(
1215 BrowserAccessibilityManager::GetEmptyDocument(), host_); 1219 BrowserAccessibilityManager::GetEmptyDocument(), host_);
1216 #endif 1220 #endif
1217 SetBrowserAccessibilityManager(manager); 1221 SetBrowserAccessibilityManager(manager);
1218 } 1222 }
1219 1223
1220 gfx::GLSurfaceHandle RenderWidgetHostViewAura::GetCompositingSurface() { 1224 gfx::GLSurfaceHandle RenderWidgetHostViewAura::GetCompositingSurface() {
1221 return ImageTransportFactory::GetInstance()->GetSharedSurfaceHandle(); 1225 return ImageTransportFactory::GetInstance()->GetSharedSurfaceHandle();
(...skipping 1156 matching lines...) Expand 10 before | Expand all | Expand 10 after
2378 2382
2379 //////////////////////////////////////////////////////////////////////////////// 2383 ////////////////////////////////////////////////////////////////////////////////
2380 // RenderWidgetHostViewBase, public: 2384 // RenderWidgetHostViewBase, public:
2381 2385
2382 // static 2386 // static
2383 void RenderWidgetHostViewBase::GetDefaultScreenInfo(WebScreenInfo* results) { 2387 void RenderWidgetHostViewBase::GetDefaultScreenInfo(WebScreenInfo* results) {
2384 GetScreenInfoForWindow(results, NULL); 2388 GetScreenInfoForWindow(results, NULL);
2385 } 2389 }
2386 2390
2387 } // namespace content 2391 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698