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 "base/base_switches.h" | 5 #include "base/base_switches.h" |
6 #include "base/command_line.h" | 6 #include "base/command_line.h" |
7 #include "base/debug/debugger.h" | 7 #include "base/debug/debugger.h" |
8 #include "base/debug/trace_event.h" | 8 #include "base/debug/trace_event.h" |
9 #include "base/hi_res_timer_manager.h" | 9 #include "base/hi_res_timer_manager.h" |
10 #include "base/i18n/rtl.h" | 10 #include "base/i18n/rtl.h" |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
49 Boolean includeAllInstalled) { | 49 Boolean includeAllInstalled) { |
50 CFTypeRef values[] = { CFSTR("") }; | 50 CFTypeRef values[] = { CFSTR("") }; |
51 return CFArrayCreate( | 51 return CFArrayCreate( |
52 kCFAllocatorDefault, values, arraysize(values), &kCFTypeArrayCallBacks); | 52 kCFAllocatorDefault, values, arraysize(values), &kCFTypeArrayCallBacks); |
53 } | 53 } |
54 | 54 |
55 void InstallFrameworkHacks() { | 55 void InstallFrameworkHacks() { |
56 // See http://crbug.com/31225 | 56 // See http://crbug.com/31225 |
57 // TODO: Don't do this on newer OS X revisions that have a fix for | 57 // TODO: Don't do this on newer OS X revisions that have a fix for |
58 // http://openradar.appspot.com/radar?id=1156410 | 58 // http://openradar.appspot.com/radar?id=1156410 |
59 if (base::mac::IsOSSnowLeopardOrLater()) { | 59 // To check if this is broken: |
60 // Chinese Handwriting was introduced in 10.6. Since doing this override | 60 // 1. Enable Multi language input (simplified chinese) |
61 // regresses page cycler memory usage on 10.5, don't do the unnecessary | 61 // 2. Ensure "Show/Hide Trackpad Handwriting" shortcut works. |
62 // override there. | 62 // (ctrl+shift+space). |
63 mach_error_t err = mach_override_ptr( | 63 // 3. Now open a new tab in Google Chrome or start Google Chrome |
64 (void*)&TISCreateInputSourceList, | 64 // 4. Try ctrl+shift+space shortcut again. Shortcut will not work, IME will |
65 (void*)&ChromeTISCreateInputSourceList, | 65 // either not appear or (worse) not disappear on ctrl-shift-space. |
66 NULL); | 66 // (Run `ps aux | grep Chinese` (10.6/10.7) or `ps aux | grep Trackpad` |
67 CHECK_EQ(err_none, err); | 67 // and then kill that pid to make it go away.) |
68 } | 68 |
| 69 // Chinese Handwriting was introduced in 10.6 and is confirmed broken on |
| 70 // 10.6, 10.7, and 10.8. |
| 71 mach_error_t err = mach_override_ptr( |
| 72 (void*)&TISCreateInputSourceList, |
| 73 (void*)&ChromeTISCreateInputSourceList, |
| 74 NULL); |
| 75 CHECK_EQ(err_none, err); |
69 } | 76 } |
70 | 77 |
71 #endif // OS_MACOSX | 78 #endif // OS_MACOSX |
72 | 79 |
73 } // namespace | 80 } // namespace |
74 | 81 |
75 // This function provides some ways to test crash and assertion handling | 82 // This function provides some ways to test crash and assertion handling |
76 // behavior of the renderer. | 83 // behavior of the renderer. |
77 static void HandleRendererErrorTestParameters(const CommandLine& command_line) { | 84 static void HandleRendererErrorTestParameters(const CommandLine& command_line) { |
78 if (command_line.HasSwitch(switches::kWaitForDebugger)) | 85 if (command_line.HasSwitch(switches::kWaitForDebugger)) |
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
218 #endif | 225 #endif |
219 TRACE_EVENT_BEGIN_ETW("RendererMain.START_MSG_LOOP", 0, 0); | 226 TRACE_EVENT_BEGIN_ETW("RendererMain.START_MSG_LOOP", 0, 0); |
220 MessageLoop::current()->Run(); | 227 MessageLoop::current()->Run(); |
221 TRACE_EVENT_END_ETW("RendererMain.START_MSG_LOOP", 0, 0); | 228 TRACE_EVENT_END_ETW("RendererMain.START_MSG_LOOP", 0, 0); |
222 } | 229 } |
223 } | 230 } |
224 platform.PlatformUninitialize(); | 231 platform.PlatformUninitialize(); |
225 TRACE_EVENT_END_ETW("RendererMain", 0, ""); | 232 TRACE_EVENT_END_ETW("RendererMain", 0, ""); |
226 return 0; | 233 return 0; |
227 } | 234 } |
OLD | NEW |