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 #include <QuartzCore/QuartzCore.h> | 7 #include <QuartzCore/QuartzCore.h> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
(...skipping 2794 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2805 | 2805 |
2806 // TODO(thakis): Pipe |actualRange| through TextInputClientMac machinery. | 2806 // TODO(thakis): Pipe |actualRange| through TextInputClientMac machinery. |
2807 if (actualRange) | 2807 if (actualRange) |
2808 *actualRange = theRange; | 2808 *actualRange = theRange; |
2809 } | 2809 } |
2810 | 2810 |
2811 // The returned rectangle is in WebKit coordinates (upper left origin), so | 2811 // The returned rectangle is in WebKit coordinates (upper left origin), so |
2812 // flip the coordinate system and then convert it into screen coordinates for | 2812 // flip the coordinate system and then convert it into screen coordinates for |
2813 // return. | 2813 // return. |
2814 NSRect viewFrame = [self frame]; | 2814 NSRect viewFrame = [self frame]; |
2815 rect.origin.y = NSHeight(viewFrame) - rect.origin.y; | 2815 rect.origin.y = NSHeight(viewFrame) - rect.origin.y; |
Nico
2012/07/29 02:12:04
nit: Change this line to
... = NSHeight(viewFr
horo
2012/07/29 02:40:07
Done.
| |
2816 rect.origin.y -= rect.size.height; | 2816 rect.origin.y -= rect.size.height; |
2817 rect = [self convertRectToBase:rect]; | 2817 rect = [self convertRect:rect toView:nil]; |
2818 rect.origin = [[self window] convertBaseToScreen:rect.origin]; | 2818 rect.origin = [[self window] convertBaseToScreen:rect.origin]; |
2819 return rect; | 2819 return rect; |
2820 } | 2820 } |
2821 | 2821 |
2822 - (NSRange)markedRange { | 2822 - (NSRange)markedRange { |
2823 // An input method calls this method to check if an application really has | 2823 // An input method calls this method to check if an application really has |
2824 // a text being composed when hasMarkedText call returns true. | 2824 // a text being composed when hasMarkedText call returns true. |
2825 // Returns the range saved in the setMarkedText method so the input method | 2825 // Returns the range saved in the setMarkedText method so the input method |
2826 // calls the setMarkedText method and we can update the composition node | 2826 // calls the setMarkedText method and we can update the composition node |
2827 // there. (When this method returns an empty range, the input method doesn't | 2827 // there. (When this method returns an empty range, the input method doesn't |
(...skipping 384 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
3212 if (!string) return NO; | 3212 if (!string) return NO; |
3213 | 3213 |
3214 // If the user is currently using an IME, confirm the IME input, | 3214 // If the user is currently using an IME, confirm the IME input, |
3215 // and then insert the text from the service, the same as TextEdit and Safari. | 3215 // and then insert the text from the service, the same as TextEdit and Safari. |
3216 [self confirmComposition]; | 3216 [self confirmComposition]; |
3217 [self insertText:string]; | 3217 [self insertText:string]; |
3218 return YES; | 3218 return YES; |
3219 } | 3219 } |
3220 | 3220 |
3221 @end | 3221 @end |
OLD | NEW |