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

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: Fix more compile errors 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 ui::TextInputClient* RenderWidgetHostViewAura::GetTextInputClient() { 649 ui::TextInputClient* RenderWidgetHostViewAura::GetTextInputClient() {
(...skipping 534 matching lines...) Expand 10 before | Expand all | Expand 10 after
1184 RenderWidgetHostViewAura::CreateSyntheticGestureTarget() { 1184 RenderWidgetHostViewAura::CreateSyntheticGestureTarget() {
1185 return scoped_ptr<SyntheticGestureTarget>( 1185 return scoped_ptr<SyntheticGestureTarget>(
1186 new SyntheticGestureTargetAura(host_)); 1186 new SyntheticGestureTargetAura(host_));
1187 } 1187 }
1188 1188
1189 void RenderWidgetHostViewAura::SetScrollOffsetPinning( 1189 void RenderWidgetHostViewAura::SetScrollOffsetPinning(
1190 bool is_pinned_to_left, bool is_pinned_to_right) { 1190 bool is_pinned_to_left, bool is_pinned_to_right) {
1191 // Not needed. Mac-only. 1191 // Not needed. Mac-only.
1192 } 1192 }
1193 1193
1194 void RenderWidgetHostViewAura::CreateBrowserAccessibilityManagerIfNeeded() { 1194 void RenderWidgetHostViewAura::CreateBrowserAccessibilityManagerIfNeeded(
1195 if (GetBrowserAccessibilityManager()) 1195 BrowserAccessibilityDelegate* delegate) {
1196 if (GetBrowserAccessibilityManager()) {
1197 if (delegate)
1198 GetBrowserAccessibilityManager()->set_delegate(delegate);
ncarter (slow) 2014/05/14 23:56:23 Is this delegate relationship correct? Previously
dmazzoni 2014/05/19 07:25:01 This is a great question. I don't think I fully un
ncarter (slow) 2014/05/28 00:50:11 I think you have it right. Where possible I think
1196 return; 1199 return;
1200 }
1197 1201
1198 BrowserAccessibilityManager* manager = NULL; 1202 BrowserAccessibilityManager* manager = NULL;
1199 #if defined(OS_WIN) 1203 #if defined(OS_WIN)
1200 aura::WindowTreeHost* host = window_->GetHost(); 1204 aura::WindowTreeHost* host = window_->GetHost();
1201 if (!host) 1205 if (!host)
1202 return; 1206 return;
1203 HWND hwnd = host->GetAcceleratedWidget(); 1207 HWND hwnd = host->GetAcceleratedWidget();
1204 1208
1205 // The accessible_parent may be NULL at this point. The WebContents will pass 1209 // The accessible_parent may be NULL at this point. The WebContents will pass
1206 // it down to this instance (by way of the RenderViewHost and 1210 // it down to this instance (by way of the RenderViewHost and
1207 // RenderWidgetHost) when it is known. This instance will then set it on its 1211 // RenderWidgetHost) when it is known. This instance will then set it on its
1208 // BrowserAccessibilityManager. 1212 // BrowserAccessibilityManager.
1213 RenderViewHost* rvh = RenderViewHost::From(host_);
1214 RenderFrameHostImpl* rfh =
1215 rvh->GetDelegate()->GetFrameTree()->GetMainFrame();
1209 gfx::NativeViewAccessible accessible_parent = 1216 gfx::NativeViewAccessible accessible_parent =
1210 host_->GetParentNativeViewAccessible(); 1217 rfh->GetParentNativeViewAccessible();
1211 1218
1212 if (legacy_render_widget_host_HWND_) { 1219 if (legacy_render_widget_host_HWND_) {
1213 manager = new BrowserAccessibilityManagerWin( 1220 manager = new BrowserAccessibilityManagerWin(
1214 legacy_render_widget_host_HWND_.get(), accessible_parent, 1221 legacy_render_widget_host_HWND_.get(), accessible_parent,
1215 BrowserAccessibilityManagerWin::GetEmptyDocument(), host_); 1222 BrowserAccessibilityManagerWin::GetEmptyDocument(), delegate);
ncarter (slow) 2014/05/14 23:56:23 Since this delegate is sometimes null, I wonder if
dmazzoni 2014/05/19 07:25:01 This would also be simplified if the RFHI owns the
1216 } 1223 }
1217 #else 1224 #else
1218 manager = BrowserAccessibilityManager::Create( 1225 manager = BrowserAccessibilityManager::Create(
1219 BrowserAccessibilityManager::GetEmptyDocument(), host_); 1226 BrowserAccessibilityManager::GetEmptyDocument(), delegate);
1220 #endif 1227 #endif
1221 SetBrowserAccessibilityManager(manager); 1228 SetBrowserAccessibilityManager(manager);
1222 } 1229 }
1223 1230
1224 gfx::GLSurfaceHandle RenderWidgetHostViewAura::GetCompositingSurface() { 1231 gfx::GLSurfaceHandle RenderWidgetHostViewAura::GetCompositingSurface() {
1225 return ImageTransportFactory::GetInstance()->GetSharedSurfaceHandle(); 1232 return ImageTransportFactory::GetInstance()->GetSharedSurfaceHandle();
1226 } 1233 }
1227 1234
1228 bool RenderWidgetHostViewAura::LockMouse() { 1235 bool RenderWidgetHostViewAura::LockMouse() {
1229 aura::Window* root_window = window_->GetRootWindow(); 1236 aura::Window* root_window = window_->GetRootWindow();
(...skipping 1152 matching lines...) Expand 10 before | Expand all | Expand 10 after
2382 2389
2383 //////////////////////////////////////////////////////////////////////////////// 2390 ////////////////////////////////////////////////////////////////////////////////
2384 // RenderWidgetHostViewBase, public: 2391 // RenderWidgetHostViewBase, public:
2385 2392
2386 // static 2393 // static
2387 void RenderWidgetHostViewBase::GetDefaultScreenInfo(WebScreenInfo* results) { 2394 void RenderWidgetHostViewBase::GetDefaultScreenInfo(WebScreenInfo* results) {
2388 GetScreenInfoForWindow(results, NULL); 2395 GetScreenInfoForWindow(results, NULL);
2389 } 2396 }
2390 2397
2391 } // namespace content 2398 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698