| 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 <OpenGL/gl.h> | 8 #include <OpenGL/gl.h> |
| 9 #include <QuartzCore/QuartzCore.h> | 9 #include <QuartzCore/QuartzCore.h> |
| 10 #include <stdint.h> | 10 #include <stdint.h> |
| (...skipping 1543 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1554 NSPoint origin = NSMakePoint(bounds.x(), bounds.y()); | 1554 NSPoint origin = NSMakePoint(bounds.x(), bounds.y()); |
| 1555 NSSize size = NSMakeSize(bounds.width(), bounds.height()); | 1555 NSSize size = NSMakeSize(bounds.width(), bounds.height()); |
| 1556 origin.y = NSHeight([cocoa_view_ bounds]) - origin.y; | 1556 origin.y = NSHeight([cocoa_view_ bounds]) - origin.y; |
| 1557 NSPoint originInWindow = [cocoa_view_ convertPoint:origin toView:nil]; | 1557 NSPoint originInWindow = [cocoa_view_ convertPoint:origin toView:nil]; |
| 1558 NSPoint originInScreen = | 1558 NSPoint originInScreen = |
| 1559 ui::ConvertPointFromWindowToScreen([cocoa_view_ window], originInWindow); | 1559 ui::ConvertPointFromWindowToScreen([cocoa_view_ window], originInWindow); |
| 1560 originInScreen.y = originInScreen.y - size.height; | 1560 originInScreen.y = originInScreen.y - size.height; |
| 1561 return gfx::Point(originInScreen.x, originInScreen.y); | 1561 return gfx::Point(originInScreen.x, originInScreen.y); |
| 1562 } | 1562 } |
| 1563 | 1563 |
| 1564 NSView* RenderWidgetHostViewMac::AccessibilityGetAcceleratedWidget() { |
| 1565 return cocoa_view_; |
| 1566 } |
| 1567 |
| 1564 void RenderWidgetHostViewMac::SetTextInputActive(bool active) { | 1568 void RenderWidgetHostViewMac::SetTextInputActive(bool active) { |
| 1565 if (active) { | 1569 if (active) { |
| 1566 if (GetTextInputType() == ui::TEXT_INPUT_TYPE_PASSWORD) | 1570 if (GetTextInputType() == ui::TEXT_INPUT_TYPE_PASSWORD) |
| 1567 EnablePasswordInput(); | 1571 EnablePasswordInput(); |
| 1568 else | 1572 else |
| 1569 DisablePasswordInput(); | 1573 DisablePasswordInput(); |
| 1570 } else { | 1574 } else { |
| 1571 if (GetTextInputType() == ui::TEXT_INPUT_TYPE_PASSWORD) | 1575 if (GetTextInputType() == ui::TEXT_INPUT_TYPE_PASSWORD) |
| 1572 DisablePasswordInput(); | 1576 DisablePasswordInput(); |
| 1573 } | 1577 } |
| (...skipping 1687 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3261 | 3265 |
| 3262 // "-webkit-app-region: drag | no-drag" is implemented on Mac by excluding | 3266 // "-webkit-app-region: drag | no-drag" is implemented on Mac by excluding |
| 3263 // regions that are not draggable. (See ControlRegionView in | 3267 // regions that are not draggable. (See ControlRegionView in |
| 3264 // native_app_window_cocoa.mm). This requires the render host view to be | 3268 // native_app_window_cocoa.mm). This requires the render host view to be |
| 3265 // draggable by default. | 3269 // draggable by default. |
| 3266 - (BOOL)mouseDownCanMoveWindow { | 3270 - (BOOL)mouseDownCanMoveWindow { |
| 3267 return YES; | 3271 return YES; |
| 3268 } | 3272 } |
| 3269 | 3273 |
| 3270 @end | 3274 @end |
| OLD | NEW |