| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 <QuartzCore/QuartzCore.h> | 5 #include <QuartzCore/QuartzCore.h> |
| 6 | 6 |
| 7 #include "chrome/browser/renderer_host/render_widget_host_view_mac.h" | 7 #include "chrome/browser/renderer_host/render_widget_host_view_mac.h" |
| 8 | 8 |
| 9 #include "chrome/browser/chrome_thread.h" | 9 #include "chrome/browser/chrome_thread.h" |
| 10 #include "app/app_switches.h" | 10 #include "app/app_switches.h" |
| (...skipping 2500 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2511 if (pluginImeIdentifier_ == -1) | 2511 if (pluginImeIdentifier_ == -1) |
| 2512 return false; | 2512 return false; |
| 2513 | 2513 |
| 2514 // ComplexTextInputPanel only works on 10.6+. | 2514 // ComplexTextInputPanel only works on 10.6+. |
| 2515 static BOOL sImeSupported = NO; | 2515 static BOOL sImeSupported = NO; |
| 2516 static BOOL sHaveCheckedSupport = NO; | 2516 static BOOL sHaveCheckedSupport = NO; |
| 2517 if (!sHaveCheckedSupport) { | 2517 if (!sHaveCheckedSupport) { |
| 2518 int32 major, minor, bugfix; | 2518 int32 major, minor, bugfix; |
| 2519 base::SysInfo::OperatingSystemVersionNumbers(&major, &minor, &bugfix); | 2519 base::SysInfo::OperatingSystemVersionNumbers(&major, &minor, &bugfix); |
| 2520 sImeSupported = major > 10 || (major == 10 && minor > 5); | 2520 sImeSupported = major > 10 || (major == 10 && minor > 5); |
| 2521 sHaveCheckedSupport = YES; |
| 2521 } | 2522 } |
| 2522 if (!sImeSupported) | 2523 if (!sImeSupported) |
| 2523 return false; | 2524 return false; |
| 2524 | 2525 |
| 2525 ComplexTextInputPanel* inputPanel = | 2526 ComplexTextInputPanel* inputPanel = |
| 2526 [ComplexTextInputPanel sharedComplexTextInputPanel]; | 2527 [ComplexTextInputPanel sharedComplexTextInputPanel]; |
| 2527 NSString* composited_string = nil; | 2528 NSString* composited_string = nil; |
| 2528 BOOL handled = [inputPanel interpretKeyEvent:event | 2529 BOOL handled = [inputPanel interpretKeyEvent:event |
| 2529 string:&composited_string]; | 2530 string:&composited_string]; |
| 2530 if (composited_string) { | 2531 if (composited_string) { |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2586 if (!string) return NO; | 2587 if (!string) return NO; |
| 2587 | 2588 |
| 2588 // If the user is currently using an IME, confirm the IME input, | 2589 // If the user is currently using an IME, confirm the IME input, |
| 2589 // and then insert the text from the service, the same as TextEdit and Safari. | 2590 // and then insert the text from the service, the same as TextEdit and Safari. |
| 2590 [self confirmComposition]; | 2591 [self confirmComposition]; |
| 2591 [self insertText:string]; | 2592 [self insertText:string]; |
| 2592 return YES; | 2593 return YES; |
| 2593 } | 2594 } |
| 2594 | 2595 |
| 2595 @end | 2596 @end |
| OLD | NEW |