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

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

Issue 10827110: Merge 148916 - Fix the candidate window position of IME in Retina display. (Closed) Base URL: svn://svn.chromium.org/chrome/branches/1180/src/
Patch Set: 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 2667 matching lines...) Expand 10 before | Expand all | Expand 10 after
2678 // TODO(thakis): Pipe |actualRange| through TextInputClientMac machinery. 2678 // TODO(thakis): Pipe |actualRange| through TextInputClientMac machinery.
2679 if (actualRange) 2679 if (actualRange)
2680 *actualRange = theRange; 2680 *actualRange = theRange;
2681 NSRect rect = TextInputClientMac::GetInstance()->GetFirstRectForRange( 2681 NSRect rect = TextInputClientMac::GetInstance()->GetFirstRectForRange(
2682 renderWidgetHostView_->render_widget_host_, theRange); 2682 renderWidgetHostView_->render_widget_host_, theRange);
2683 2683
2684 // The returned rectangle is in WebKit coordinates (upper left origin), so 2684 // The returned rectangle is in WebKit coordinates (upper left origin), so
2685 // flip the coordinate system and then convert it into screen coordinates for 2685 // flip the coordinate system and then convert it into screen coordinates for
2686 // return. 2686 // return.
2687 NSRect viewFrame = [self frame]; 2687 NSRect viewFrame = [self frame];
2688 rect.origin.y = NSHeight(viewFrame) - rect.origin.y; 2688 rect.origin.y = NSHeight(viewFrame) - NSMaxY(rect);
2689 rect.origin.y -= rect.size.height; 2689 rect = [self convertRect:rect toView:nil];
2690 rect = [self convertRectToBase:rect];
2691 rect.origin = [[self window] convertBaseToScreen:rect.origin]; 2690 rect.origin = [[self window] convertBaseToScreen:rect.origin];
2692 return rect; 2691 return rect;
2693 } 2692 }
2694 2693
2695 - (NSRange)markedRange { 2694 - (NSRange)markedRange {
2696 // An input method calls this method to check if an application really has 2695 // An input method calls this method to check if an application really has
2697 // a text being composed when hasMarkedText call returns true. 2696 // a text being composed when hasMarkedText call returns true.
2698 // Returns the range saved in the setMarkedText method so the input method 2697 // Returns the range saved in the setMarkedText method so the input method
2699 // calls the setMarkedText method and we can update the composition node 2698 // calls the setMarkedText method and we can update the composition node
2700 // there. (When this method returns an empty range, the input method doesn't 2699 // 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
3085 if (!string) return NO; 3084 if (!string) return NO;
3086 3085
3087 // If the user is currently using an IME, confirm the IME input, 3086 // If the user is currently using an IME, confirm the IME input,
3088 // and then insert the text from the service, the same as TextEdit and Safari. 3087 // and then insert the text from the service, the same as TextEdit and Safari.
3089 [self confirmComposition]; 3088 [self confirmComposition];
3090 [self insertText:string]; 3089 [self insertText:string];
3091 return YES; 3090 return YES;
3092 } 3091 }
3093 3092
3094 @end 3093 @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