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_mac.h" | 5 #include "content/browser/renderer_host/render_widget_host_view_mac.h" |
6 | 6 |
7 #import <objc/runtime.h> | 7 #import <objc/runtime.h> |
8 #include <QuartzCore/QuartzCore.h> | 8 #include <QuartzCore/QuartzCore.h> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
(...skipping 2016 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2027 helper.ShowDefinitionForSelection(); | 2027 helper.ShowDefinitionForSelection(); |
2028 } | 2028 } |
2029 | 2029 |
2030 void RenderWidgetHostViewMac::SetBackground(const SkBitmap& background) { | 2030 void RenderWidgetHostViewMac::SetBackground(const SkBitmap& background) { |
2031 RenderWidgetHostViewBase::SetBackground(background); | 2031 RenderWidgetHostViewBase::SetBackground(background); |
2032 if (render_widget_host_) | 2032 if (render_widget_host_) |
2033 render_widget_host_->Send(new ViewMsg_SetBackground( | 2033 render_widget_host_->Send(new ViewMsg_SetBackground( |
2034 render_widget_host_->GetRoutingID(), background)); | 2034 render_widget_host_->GetRoutingID(), background)); |
2035 } | 2035 } |
2036 | 2036 |
2037 void RenderWidgetHostViewMac::CreateBrowserAccessibilityManagerIfNeeded() { | 2037 void RenderWidgetHostViewMac::CreateBrowserAccessibilityManagerIfNeeded( |
| 2038 BrowserAccessibilityDelegate* delegate) { |
2038 if (!GetBrowserAccessibilityManager()) { | 2039 if (!GetBrowserAccessibilityManager()) { |
2039 SetBrowserAccessibilityManager( | 2040 SetBrowserAccessibilityManager( |
2040 new BrowserAccessibilityManagerMac( | 2041 new BrowserAccessibilityManagerMac( |
2041 cocoa_view_, | 2042 cocoa_view_, |
2042 BrowserAccessibilityManagerMac::GetEmptyDocument(), | 2043 BrowserAccessibilityManagerMac::GetEmptyDocument(), |
2043 render_widget_host_)); | 2044 delegate)); |
2044 } | 2045 } |
2045 } | 2046 } |
2046 | 2047 |
2047 gfx::Point RenderWidgetHostViewMac::AccessibilityOriginInScreen( | 2048 gfx::Point RenderWidgetHostViewMac::AccessibilityOriginInScreen( |
2048 const gfx::Rect& bounds) { | 2049 const gfx::Rect& bounds) { |
2049 NSPoint origin = NSMakePoint(bounds.x(), bounds.y()); | 2050 NSPoint origin = NSMakePoint(bounds.x(), bounds.y()); |
2050 NSSize size = NSMakeSize(bounds.width(), bounds.height()); | 2051 NSSize size = NSMakeSize(bounds.width(), bounds.height()); |
2051 origin.y = NSHeight([cocoa_view_ bounds]) - origin.y; | 2052 origin.y = NSHeight([cocoa_view_ bounds]) - origin.y; |
2052 NSPoint originInWindow = [cocoa_view_ convertPoint:origin toView:nil]; | 2053 NSPoint originInWindow = [cocoa_view_ convertPoint:origin toView:nil]; |
2053 NSPoint originInScreen = | 2054 NSPoint originInScreen = |
(...skipping 2225 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4279 } | 4280 } |
4280 | 4281 |
4281 - (void)disableRendering { | 4282 - (void)disableRendering { |
4282 // Disable the fade-out animation as the layer is removed. | 4283 // Disable the fade-out animation as the layer is removed. |
4283 ScopedCAActionDisabler disabler; | 4284 ScopedCAActionDisabler disabler; |
4284 [self removeFromSuperlayer]; | 4285 [self removeFromSuperlayer]; |
4285 renderWidgetHostView_ = nil; | 4286 renderWidgetHostView_ = nil; |
4286 } | 4287 } |
4287 | 4288 |
4288 @end // implementation SoftwareLayer | 4289 @end // implementation SoftwareLayer |
OLD | NEW |