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

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

Issue 3779011: Fix one-time version check for Mac plugin IME (Closed)
Patch Set: Created 10 years, 2 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
« 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) 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
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
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
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