| 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 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 156 CHECK_EQ(err_none, err); | 156 CHECK_EQ(err_none, err); |
| 157 } | 157 } |
| 158 | 158 |
| 159 // Enable the sandbox. | 159 // Enable the sandbox. |
| 160 bool sandbox_initialized = InitializeSandbox(); | 160 bool sandbox_initialized = InitializeSandbox(); |
| 161 | 161 |
| 162 if (needs_ime_hack) { | 162 if (needs_ime_hack) { |
| 163 // After the sandbox is initialized, call into TIS. Doing this before | 163 // After the sandbox is initialized, call into TIS. Doing this before |
| 164 // the sandbox is in place will open up renderer access to the | 164 // the sandbox is in place will open up renderer access to the |
| 165 // pasteboard and an XPC connection to "com.apple.hiservices-xpcservice". | 165 // pasteboard and an XPC connection to "com.apple.hiservices-xpcservice". |
| 166 base::mac::ScopedCFTypeRef<TISInputSourceRef> layout_source( | 166 base::ScopedCFTypeRef<TISInputSourceRef> layout_source( |
| 167 TISCopyCurrentKeyboardLayoutInputSource()); | 167 TISCopyCurrentKeyboardLayoutInputSource()); |
| 168 base::mac::ScopedCFTypeRef<TISInputSourceRef> input_source( | 168 base::ScopedCFTypeRef<TISInputSourceRef> input_source( |
| 169 TISCopyCurrentKeyboardInputSource()); | 169 TISCopyCurrentKeyboardInputSource()); |
| 170 | 170 |
| 171 CFTypeRef source_list[] = { layout_source.get(), input_source.get() }; | 171 CFTypeRef source_list[] = { layout_source.get(), input_source.get() }; |
| 172 g_text_input_services_source_list_ = CFArrayCreate(kCFAllocatorDefault, | 172 g_text_input_services_source_list_ = CFArrayCreate(kCFAllocatorDefault, |
| 173 source_list, arraysize(source_list), &kCFTypeArrayCallBacks); | 173 source_list, arraysize(source_list), &kCFTypeArrayCallBacks); |
| 174 } | 174 } |
| 175 | 175 |
| 176 return sandbox_initialized; | 176 return sandbox_initialized; |
| 177 } | 177 } |
| 178 | 178 |
| 179 void RendererMainPlatformDelegate::RunSandboxTests(bool no_sandbox) { | 179 void RendererMainPlatformDelegate::RunSandboxTests(bool no_sandbox) { |
| 180 Class tests_runner = objc_getClass("RendererSandboxTestsRunner"); | 180 Class tests_runner = objc_getClass("RendererSandboxTestsRunner"); |
| 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 |