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 2933 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2944 ui::Range replacement_range(replacementRange); | 2944 ui::Range replacement_range(replacementRange); |
2945 renderWidgetHostView_->render_widget_host_->ImeConfirmComposition( | 2945 renderWidgetHostView_->render_widget_host_->ImeConfirmComposition( |
2946 base::SysNSStringToUTF16(im_text), replacement_range); | 2946 base::SysNSStringToUTF16(im_text), replacement_range); |
2947 } | 2947 } |
2948 | 2948 |
2949 // Inserting text will delete all marked text automatically. | 2949 // Inserting text will delete all marked text automatically. |
2950 hasMarkedText_ = NO; | 2950 hasMarkedText_ = NO; |
2951 } | 2951 } |
2952 | 2952 |
2953 - (void)insertText:(id)string { | 2953 - (void)insertText:(id)string { |
2954 // This is a method on NSTextInput, not NSTextInputClient. But on 10.5, this | |
2955 // gets called anyway. Forward to the right method. http://crbug.com/47890 | |
2956 [self insertText:string replacementRange:NSMakeRange(NSNotFound, 0)]; | 2954 [self insertText:string replacementRange:NSMakeRange(NSNotFound, 0)]; |
Nico
2012/08/07 16:16:58
I think we can delete the whole method. I added it
Robert Sesek
2012/08/07 16:18:08
He did initially, but it was causing test failures
| |
2957 } | 2955 } |
2958 | 2956 |
2959 - (void)viewDidMoveToWindow { | 2957 - (void)viewDidMoveToWindow { |
2960 if (canBeKeyView_) { | 2958 if (canBeKeyView_) { |
2961 NSWindow* newWindow = [self window]; | 2959 NSWindow* newWindow = [self window]; |
2962 // Pointer comparison only, since we don't know if lastWindow_ is still | 2960 // Pointer comparison only, since we don't know if lastWindow_ is still |
2963 // valid. | 2961 // valid. |
2964 if (newWindow) { | 2962 if (newWindow) { |
2965 // If we move into a new window, refresh the frame information. We | 2963 // If we move into a new window, refresh the frame information. We |
2966 // don't need to do it if it was the same window as it used to be in, | 2964 // don't need to do it if it was the same window as it used to be in, |
(...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
3179 if (!string) return NO; | 3177 if (!string) return NO; |
3180 | 3178 |
3181 // If the user is currently using an IME, confirm the IME input, | 3179 // If the user is currently using an IME, confirm the IME input, |
3182 // and then insert the text from the service, the same as TextEdit and Safari. | 3180 // and then insert the text from the service, the same as TextEdit and Safari. |
3183 [self confirmComposition]; | 3181 [self confirmComposition]; |
3184 [self insertText:string]; | 3182 [self insertText:string]; |
3185 return YES; | 3183 return YES; |
3186 } | 3184 } |
3187 | 3185 |
3188 @end | 3186 @end |
OLD | NEW |