| OLD | NEW |
| 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 1837 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1848 // The accessible_parent may be NULL at this point. The WebContents will pass | 1848 // The accessible_parent may be NULL at this point. The WebContents will pass |
| 1849 // it down to this instance (by way of the RenderViewHost and | 1849 // it down to this instance (by way of the RenderViewHost and |
| 1850 // RenderWidgetHost) when it is known. This instance will then set it on its | 1850 // RenderWidgetHost) when it is known. This instance will then set it on its |
| 1851 // BrowserAccessibilityManager. | 1851 // BrowserAccessibilityManager. |
| 1852 gfx::NativeViewAccessible accessible_parent = | 1852 gfx::NativeViewAccessible accessible_parent = |
| 1853 host_->GetParentNativeViewAccessible(); | 1853 host_->GetParentNativeViewAccessible(); |
| 1854 | 1854 |
| 1855 if (legacy_render_widget_host_HWND_) { | 1855 if (legacy_render_widget_host_HWND_) { |
| 1856 manager = new BrowserAccessibilityManagerWin( | 1856 manager = new BrowserAccessibilityManagerWin( |
| 1857 legacy_render_widget_host_HWND_.get(), accessible_parent, | 1857 legacy_render_widget_host_HWND_.get(), accessible_parent, |
| 1858 BrowserAccessibilityManagerWin::GetEmptyDocument(), this); | 1858 BrowserAccessibilityManagerWin::GetEmptyDocument(), host_); |
| 1859 } | 1859 } |
| 1860 #else | 1860 #else |
| 1861 manager = BrowserAccessibilityManager::Create( | 1861 manager = BrowserAccessibilityManager::Create( |
| 1862 BrowserAccessibilityManager::GetEmptyDocument(), this); | 1862 BrowserAccessibilityManager::GetEmptyDocument(), host_); |
| 1863 #endif | 1863 #endif |
| 1864 SetBrowserAccessibilityManager(manager); | 1864 SetBrowserAccessibilityManager(manager); |
| 1865 } | 1865 } |
| 1866 | 1866 |
| 1867 gfx::GLSurfaceHandle RenderWidgetHostViewAura::GetCompositingSurface() { | 1867 gfx::GLSurfaceHandle RenderWidgetHostViewAura::GetCompositingSurface() { |
| 1868 return ImageTransportFactory::GetInstance()->GetSharedSurfaceHandle(); | 1868 return ImageTransportFactory::GetInstance()->GetSharedSurfaceHandle(); |
| 1869 } | 1869 } |
| 1870 | 1870 |
| 1871 bool RenderWidgetHostViewAura::LockMouse() { | 1871 bool RenderWidgetHostViewAura::LockMouse() { |
| 1872 aura::Window* root_window = window_->GetRootWindow(); | 1872 aura::Window* root_window = window_->GetRootWindow(); |
| (...skipping 897 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2770 } | 2770 } |
| 2771 | 2771 |
| 2772 void RenderWidgetHostViewAura::OnUpdateVSyncParameters( | 2772 void RenderWidgetHostViewAura::OnUpdateVSyncParameters( |
| 2773 base::TimeTicks timebase, | 2773 base::TimeTicks timebase, |
| 2774 base::TimeDelta interval) { | 2774 base::TimeDelta interval) { |
| 2775 if (IsShowing()) | 2775 if (IsShowing()) |
| 2776 host_->UpdateVSyncParameters(timebase, interval); | 2776 host_->UpdateVSyncParameters(timebase, interval); |
| 2777 } | 2777 } |
| 2778 | 2778 |
| 2779 //////////////////////////////////////////////////////////////////////////////// | 2779 //////////////////////////////////////////////////////////////////////////////// |
| 2780 // RenderWidgetHostViewAura, BrowserAccessibilityDelegate implementation: | |
| 2781 | |
| 2782 void RenderWidgetHostViewAura::SetAccessibilityFocus(int acc_obj_id) { | |
| 2783 if (!host_) | |
| 2784 return; | |
| 2785 | |
| 2786 host_->AccessibilitySetFocus(acc_obj_id); | |
| 2787 } | |
| 2788 | |
| 2789 void RenderWidgetHostViewAura::AccessibilityDoDefaultAction(int acc_obj_id) { | |
| 2790 if (!host_) | |
| 2791 return; | |
| 2792 | |
| 2793 host_->AccessibilityDoDefaultAction(acc_obj_id); | |
| 2794 } | |
| 2795 | |
| 2796 void RenderWidgetHostViewAura::AccessibilityScrollToMakeVisible( | |
| 2797 int acc_obj_id, gfx::Rect subfocus) { | |
| 2798 if (!host_) | |
| 2799 return; | |
| 2800 | |
| 2801 host_->AccessibilityScrollToMakeVisible(acc_obj_id, subfocus); | |
| 2802 } | |
| 2803 | |
| 2804 void RenderWidgetHostViewAura::AccessibilityScrollToPoint( | |
| 2805 int acc_obj_id, gfx::Point point) { | |
| 2806 if (!host_) | |
| 2807 return; | |
| 2808 | |
| 2809 host_->AccessibilityScrollToPoint(acc_obj_id, point); | |
| 2810 } | |
| 2811 | |
| 2812 void RenderWidgetHostViewAura::AccessibilitySetTextSelection( | |
| 2813 int acc_obj_id, int start_offset, int end_offset) { | |
| 2814 if (!host_) | |
| 2815 return; | |
| 2816 | |
| 2817 host_->AccessibilitySetTextSelection( | |
| 2818 acc_obj_id, start_offset, end_offset); | |
| 2819 } | |
| 2820 | |
| 2821 gfx::Point RenderWidgetHostViewAura::GetLastTouchEventLocation() const { | |
| 2822 // Only needed for Win 8 non-aura. | |
| 2823 return gfx::Point(); | |
| 2824 } | |
| 2825 | |
| 2826 void RenderWidgetHostViewAura::FatalAccessibilityTreeError() { | |
| 2827 host_->FatalAccessibilityTreeError(); | |
| 2828 SetBrowserAccessibilityManager(NULL); | |
| 2829 } | |
| 2830 | |
| 2831 //////////////////////////////////////////////////////////////////////////////// | |
| 2832 // RenderWidgetHostViewAura, ImageTransportFactoryObserver implementation: | 2780 // RenderWidgetHostViewAura, ImageTransportFactoryObserver implementation: |
| 2833 | 2781 |
| 2834 void RenderWidgetHostViewAura::OnLostResources() { | 2782 void RenderWidgetHostViewAura::OnLostResources() { |
| 2835 if (frame_provider_.get()) | 2783 if (frame_provider_.get()) |
| 2836 EvictDelegatedFrame(); | 2784 EvictDelegatedFrame(); |
| 2837 idle_frame_subscriber_textures_.clear(); | 2785 idle_frame_subscriber_textures_.clear(); |
| 2838 yuv_readback_pipeline_.reset(); | 2786 yuv_readback_pipeline_.reset(); |
| 2839 | 2787 |
| 2840 host_->ScheduleComposite(); | 2788 host_->ScheduleComposite(); |
| 2841 } | 2789 } |
| (...skipping 328 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3170 RenderWidgetHost* widget) { | 3118 RenderWidgetHost* widget) { |
| 3171 return new RenderWidgetHostViewAura(widget); | 3119 return new RenderWidgetHostViewAura(widget); |
| 3172 } | 3120 } |
| 3173 | 3121 |
| 3174 // static | 3122 // static |
| 3175 void RenderWidgetHostViewPort::GetDefaultScreenInfo(WebScreenInfo* results) { | 3123 void RenderWidgetHostViewPort::GetDefaultScreenInfo(WebScreenInfo* results) { |
| 3176 GetScreenInfoForWindow(results, NULL); | 3124 GetScreenInfoForWindow(results, NULL); |
| 3177 } | 3125 } |
| 3178 | 3126 |
| 3179 } // namespace content | 3127 } // namespace content |
| OLD | NEW |