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/renderer/renderer_main_platform_delegate.h" | 5 #include "content/renderer/renderer_main_platform_delegate.h" |
6 | 6 |
7 #include <Carbon/Carbon.h> | 7 #include <Carbon/Carbon.h> |
8 #import <Cocoa/Cocoa.h> | 8 #import <Cocoa/Cocoa.h> |
9 #include <objc/runtime.h> | 9 #include <objc/runtime.h> |
10 | 10 |
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
120 NOTREACHED() << "Failed to load bundle"; | 120 NOTREACHED() << "Failed to load bundle"; |
121 return false; | 121 return false; |
122 } | 122 } |
123 sandbox_tests_bundle_ = [tests_bundle retain]; | 123 sandbox_tests_bundle_ = [tests_bundle retain]; |
124 [objc_getClass("RendererSandboxTestsRunner") setLogFunction:LogTestMessage]; | 124 [objc_getClass("RendererSandboxTestsRunner") setLogFunction:LogTestMessage]; |
125 } | 125 } |
126 return true; | 126 return true; |
127 } | 127 } |
128 | 128 |
129 bool RendererMainPlatformDelegate::EnableSandbox() { | 129 bool RendererMainPlatformDelegate::EnableSandbox() { |
130 // http://openradar.appspot.com/radar?id=1156410 is fixed on OS X 10.9+. | 130 // rdar://9251340 http://openradar.me/9251340 |
131 // See http://crbug.com/31225 and http://crbug.com/152566 | 131 // See http://crbug.com/31225 and http://crbug.com/152566 |
132 // To check if this is broken: | 132 // To check if this is broken: |
133 // 1. Enable Multi language input (simplified chinese) | 133 // 1. Enable Multi language input (simplified chinese) |
134 // 2. Ensure "Show/Hide Trackpad Handwriting" shortcut works. | 134 // 2. Ensure "Show/Hide Trackpad Handwriting" shortcut works. |
135 // (ctrl+shift+space). | 135 // (ctrl+shift+space). |
136 // 3. Now open a new tab in Google Chrome or start Google Chrome | 136 // 3. Now open a new tab in Google Chrome or start Google Chrome |
137 // 4. Try ctrl+shift+space shortcut again. Shortcut will not work, IME will | 137 // 4. Try ctrl+shift+space shortcut again. Shortcut will not work, IME will |
138 // either not appear or (worse) not disappear on ctrl-shift-space. | 138 // either not appear or (worse) not disappear on ctrl-shift-space. |
139 // (Run `ps aux | grep Chinese` (10.6/10.7) or `ps aux | grep Trackpad` | 139 // (Run `ps aux | grep Chinese` (10.6/10.7) or `ps aux | grep Trackpad` |
140 // and then kill that pid to make it go away.) | 140 // and then kill that pid to make it go away.) |
141 // | 141 // |
142 // Chinese Handwriting was introduced in 10.6 and is confirmed broken on | 142 // Chinese Handwriting was introduced in 10.6 and is confirmed broken on |
143 // 10.6, 10.7, and 10.8. It's reportedly fixed on 10.9. | 143 // 10.6, 10.7, and 10.8. It's fixed on 10.9. |
144 bool needs_ime_hack = !base::mac::IsOSLaterThanMountainLion_DontCallThis(); | 144 bool needs_ime_hack = !base::mac::IsOSMavericksOrLater(); |
Mark Mentovai
2013/10/01 18:30:59
IsOSMountainLionOrEarlier() reads better because i
Avi (use Gerrit)
2013/10/01 19:24:22
Done.
| |
145 | 145 |
146 if (needs_ime_hack) { | 146 if (needs_ime_hack) { |
147 mach_error_t err = mach_override_ptr( | 147 mach_error_t err = mach_override_ptr( |
148 (void*)&TISCreateInputSourceList, | 148 (void*)&TISCreateInputSourceList, |
149 (void*)&CrTISCreateInputSourceList, | 149 (void*)&CrTISCreateInputSourceList, |
150 NULL); | 150 NULL); |
151 CHECK_EQ(err_none, err); | 151 CHECK_EQ(err_none, err); |
152 | 152 |
153 // Override the private CFLog function so that the console is not spammed | 153 // Override the private CFLog function so that the console is not spammed |
154 // by TIS failing to connect to HIServices over XPC. | 154 // by TIS failing to connect to HIServices over XPC. |
(...skipping 26 matching lines...) Expand all Loading... | |
181 if (tests_runner) { | 181 if (tests_runner) { |
182 if (![tests_runner runTests]) | 182 if (![tests_runner runTests]) |
183 LOG(ERROR) << "Running renderer with failing sandbox tests!"; | 183 LOG(ERROR) << "Running renderer with failing sandbox tests!"; |
184 [sandbox_tests_bundle_ unload]; | 184 [sandbox_tests_bundle_ unload]; |
185 [sandbox_tests_bundle_ release]; | 185 [sandbox_tests_bundle_ release]; |
186 sandbox_tests_bundle_ = nil; | 186 sandbox_tests_bundle_ = nil; |
187 } | 187 } |
188 } | 188 } |
189 | 189 |
190 } // namespace content | 190 } // namespace content |
OLD | NEW |