| 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 "app/app_switches.h" | 9 #include "app/app_switches.h" |
| 10 #include "app/surface/io_surface_support_mac.h" | 10 #include "app/surface/io_surface_support_mac.h" |
| (...skipping 2509 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2520 if (pluginImeIdentifier_ == -1) | 2520 if (pluginImeIdentifier_ == -1) |
| 2521 return false; | 2521 return false; |
| 2522 | 2522 |
| 2523 // ComplexTextInputPanel only works on 10.6+. | 2523 // ComplexTextInputPanel only works on 10.6+. |
| 2524 static BOOL sImeSupported = NO; | 2524 static BOOL sImeSupported = NO; |
| 2525 static BOOL sHaveCheckedSupport = NO; | 2525 static BOOL sHaveCheckedSupport = NO; |
| 2526 if (!sHaveCheckedSupport) { | 2526 if (!sHaveCheckedSupport) { |
| 2527 int32 major, minor, bugfix; | 2527 int32 major, minor, bugfix; |
| 2528 base::SysInfo::OperatingSystemVersionNumbers(&major, &minor, &bugfix); | 2528 base::SysInfo::OperatingSystemVersionNumbers(&major, &minor, &bugfix); |
| 2529 sImeSupported = major > 10 || (major == 10 && minor > 5); | 2529 sImeSupported = major > 10 || (major == 10 && minor > 5); |
| 2530 sHaveCheckedSupport = YES; |
| 2530 } | 2531 } |
| 2531 if (!sImeSupported) | 2532 if (!sImeSupported) |
| 2532 return false; | 2533 return false; |
| 2533 | 2534 |
| 2534 ComplexTextInputPanel* inputPanel = | 2535 ComplexTextInputPanel* inputPanel = |
| 2535 [ComplexTextInputPanel sharedComplexTextInputPanel]; | 2536 [ComplexTextInputPanel sharedComplexTextInputPanel]; |
| 2536 NSString* composited_string = nil; | 2537 NSString* composited_string = nil; |
| 2537 BOOL handled = [inputPanel interpretKeyEvent:event | 2538 BOOL handled = [inputPanel interpretKeyEvent:event |
| 2538 string:&composited_string]; | 2539 string:&composited_string]; |
| 2539 if (composited_string) { | 2540 if (composited_string) { |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2595 if (!string) return NO; | 2596 if (!string) return NO; |
| 2596 | 2597 |
| 2597 // If the user is currently using an IME, confirm the IME input, | 2598 // If the user is currently using an IME, confirm the IME input, |
| 2598 // and then insert the text from the service, the same as TextEdit and Safari. | 2599 // and then insert the text from the service, the same as TextEdit and Safari. |
| 2599 [self confirmComposition]; | 2600 [self confirmComposition]; |
| 2600 [self insertText:string]; | 2601 [self insertText:string]; |
| 2601 return YES; | 2602 return YES; |
| 2602 } | 2603 } |
| 2603 | 2604 |
| 2604 @end | 2605 @end |
| OLD | NEW |