| 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 1851 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1862 // The accessible_parent may be NULL at this point. The WebContents will pass | 1862 // The accessible_parent may be NULL at this point. The WebContents will pass |
| 1863 // it down to this instance (by way of the RenderViewHost and | 1863 // it down to this instance (by way of the RenderViewHost and |
| 1864 // RenderWidgetHost) when it is known. This instance will then set it on its | 1864 // RenderWidgetHost) when it is known. This instance will then set it on its |
| 1865 // BrowserAccessibilityManager. | 1865 // BrowserAccessibilityManager. |
| 1866 gfx::NativeViewAccessible accessible_parent = | 1866 gfx::NativeViewAccessible accessible_parent = |
| 1867 host_->GetParentNativeViewAccessible(); | 1867 host_->GetParentNativeViewAccessible(); |
| 1868 | 1868 |
| 1869 if (legacy_render_widget_host_HWND_) { | 1869 if (legacy_render_widget_host_HWND_) { |
| 1870 manager = new BrowserAccessibilityManagerWin( | 1870 manager = new BrowserAccessibilityManagerWin( |
| 1871 legacy_render_widget_host_HWND_.get(), accessible_parent, | 1871 legacy_render_widget_host_HWND_.get(), accessible_parent, |
| 1872 BrowserAccessibilityManagerWin::GetEmptyDocument(), this); | 1872 BrowserAccessibilityManagerWin::GetEmptyDocument(), host_); |
| 1873 } | 1873 } |
| 1874 #else | 1874 #else |
| 1875 manager = BrowserAccessibilityManager::Create( | 1875 manager = BrowserAccessibilityManager::Create( |
| 1876 BrowserAccessibilityManager::GetEmptyDocument(), this); | 1876 BrowserAccessibilityManager::GetEmptyDocument(), host_); |
| 1877 #endif | 1877 #endif |
| 1878 SetBrowserAccessibilityManager(manager); | 1878 SetBrowserAccessibilityManager(manager); |
| 1879 } | 1879 } |
| 1880 | 1880 |
| 1881 gfx::GLSurfaceHandle RenderWidgetHostViewAura::GetCompositingSurface() { | 1881 gfx::GLSurfaceHandle RenderWidgetHostViewAura::GetCompositingSurface() { |
| 1882 return ImageTransportFactory::GetInstance()->GetSharedSurfaceHandle(); | 1882 return ImageTransportFactory::GetInstance()->GetSharedSurfaceHandle(); |
| 1883 } | 1883 } |
| 1884 | 1884 |
| 1885 bool RenderWidgetHostViewAura::LockMouse() { | 1885 bool RenderWidgetHostViewAura::LockMouse() { |
| 1886 aura::Window* root_window = window_->GetRootWindow(); | 1886 aura::Window* root_window = window_->GetRootWindow(); |
| (...skipping 900 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2787 } | 2787 } |
| 2788 | 2788 |
| 2789 void RenderWidgetHostViewAura::OnUpdateVSyncParameters( | 2789 void RenderWidgetHostViewAura::OnUpdateVSyncParameters( |
| 2790 base::TimeTicks timebase, | 2790 base::TimeTicks timebase, |
| 2791 base::TimeDelta interval) { | 2791 base::TimeDelta interval) { |
| 2792 if (IsShowing()) | 2792 if (IsShowing()) |
| 2793 host_->UpdateVSyncParameters(timebase, interval); | 2793 host_->UpdateVSyncParameters(timebase, interval); |
| 2794 } | 2794 } |
| 2795 | 2795 |
| 2796 //////////////////////////////////////////////////////////////////////////////// | 2796 //////////////////////////////////////////////////////////////////////////////// |
| 2797 // RenderWidgetHostViewAura, BrowserAccessibilityDelegate implementation: | |
| 2798 | |
| 2799 void RenderWidgetHostViewAura::SetAccessibilityFocus(int acc_obj_id) { | |
| 2800 if (!host_) | |
| 2801 return; | |
| 2802 | |
| 2803 host_->AccessibilitySetFocus(acc_obj_id); | |
| 2804 } | |
| 2805 | |
| 2806 void RenderWidgetHostViewAura::AccessibilityDoDefaultAction(int acc_obj_id) { | |
| 2807 if (!host_) | |
| 2808 return; | |
| 2809 | |
| 2810 host_->AccessibilityDoDefaultAction(acc_obj_id); | |
| 2811 } | |
| 2812 | |
| 2813 void RenderWidgetHostViewAura::AccessibilityScrollToMakeVisible( | |
| 2814 int acc_obj_id, gfx::Rect subfocus) { | |
| 2815 if (!host_) | |
| 2816 return; | |
| 2817 | |
| 2818 host_->AccessibilityScrollToMakeVisible(acc_obj_id, subfocus); | |
| 2819 } | |
| 2820 | |
| 2821 void RenderWidgetHostViewAura::AccessibilityScrollToPoint( | |
| 2822 int acc_obj_id, gfx::Point point) { | |
| 2823 if (!host_) | |
| 2824 return; | |
| 2825 | |
| 2826 host_->AccessibilityScrollToPoint(acc_obj_id, point); | |
| 2827 } | |
| 2828 | |
| 2829 void RenderWidgetHostViewAura::AccessibilitySetTextSelection( | |
| 2830 int acc_obj_id, int start_offset, int end_offset) { | |
| 2831 if (!host_) | |
| 2832 return; | |
| 2833 | |
| 2834 host_->AccessibilitySetTextSelection( | |
| 2835 acc_obj_id, start_offset, end_offset); | |
| 2836 } | |
| 2837 | |
| 2838 gfx::Point RenderWidgetHostViewAura::GetLastTouchEventLocation() const { | |
| 2839 // Only needed for Win 8 non-aura. | |
| 2840 return gfx::Point(); | |
| 2841 } | |
| 2842 | |
| 2843 void RenderWidgetHostViewAura::FatalAccessibilityTreeError() { | |
| 2844 host_->FatalAccessibilityTreeError(); | |
| 2845 SetBrowserAccessibilityManager(NULL); | |
| 2846 } | |
| 2847 | |
| 2848 //////////////////////////////////////////////////////////////////////////////// | |
| 2849 // RenderWidgetHostViewAura, ImageTransportFactoryObserver implementation: | 2797 // RenderWidgetHostViewAura, ImageTransportFactoryObserver implementation: |
| 2850 | 2798 |
| 2851 void RenderWidgetHostViewAura::OnLostResources() { | 2799 void RenderWidgetHostViewAura::OnLostResources() { |
| 2852 if (frame_provider_.get()) | 2800 if (frame_provider_.get()) |
| 2853 EvictDelegatedFrame(); | 2801 EvictDelegatedFrame(); |
| 2854 idle_frame_subscriber_textures_.clear(); | 2802 idle_frame_subscriber_textures_.clear(); |
| 2855 yuv_readback_pipeline_.reset(); | 2803 yuv_readback_pipeline_.reset(); |
| 2856 | 2804 |
| 2857 host_->ScheduleComposite(); | 2805 host_->ScheduleComposite(); |
| 2858 } | 2806 } |
| (...skipping 328 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3187 RenderWidgetHost* widget) { | 3135 RenderWidgetHost* widget) { |
| 3188 return new RenderWidgetHostViewAura(widget); | 3136 return new RenderWidgetHostViewAura(widget); |
| 3189 } | 3137 } |
| 3190 | 3138 |
| 3191 // static | 3139 // static |
| 3192 void RenderWidgetHostViewPort::GetDefaultScreenInfo(WebScreenInfo* results) { | 3140 void RenderWidgetHostViewPort::GetDefaultScreenInfo(WebScreenInfo* results) { |
| 3193 GetScreenInfoForWindow(results, NULL); | 3141 GetScreenInfoForWindow(results, NULL); |
| 3194 } | 3142 } |
| 3195 | 3143 |
| 3196 } // namespace content | 3144 } // namespace content |
| OLD | NEW |