Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(99)

Side by Side Diff: content/browser/renderer_host/render_widget_host_view_mac.mm

Issue 10825070: Fix the candidate window position of IME in Retina display. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix Created 8 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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) - NSMaxY(rect);
2816 rect.origin.y -= rect.size.height; 2816 rect = [self convertRect:rect toView:nil];
2817 rect = [self convertRectToBase:rect];
2818 rect.origin = [[self window] convertBaseToScreen:rect.origin]; 2817 rect.origin = [[self window] convertBaseToScreen:rect.origin];
2819 return rect; 2818 return rect;
2820 } 2819 }
2821 2820
2822 - (NSRange)markedRange { 2821 - (NSRange)markedRange {
2823 // An input method calls this method to check if an application really has 2822 // An input method calls this method to check if an application really has
2824 // a text being composed when hasMarkedText call returns true. 2823 // a text being composed when hasMarkedText call returns true.
2825 // Returns the range saved in the setMarkedText method so the input method 2824 // Returns the range saved in the setMarkedText method so the input method
2826 // calls the setMarkedText method and we can update the composition node 2825 // 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 2826 // 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
3212 if (!string) return NO; 3211 if (!string) return NO;
3213 3212
3214 // If the user is currently using an IME, confirm the IME input, 3213 // 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. 3214 // and then insert the text from the service, the same as TextEdit and Safari.
3216 [self confirmComposition]; 3215 [self confirmComposition];
3217 [self insertText:string]; 3216 [self insertText:string];
3218 return YES; 3217 return YES;
3219 } 3218 }
3220 3219
3221 @end 3220 @end
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698