OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "chrome/browser/ui/cocoa/about_ipc_dialog.h" | 5 #include "chrome/browser/ui/cocoa/about_ipc_dialog.h" |
6 #include "chrome/browser/ui/cocoa/about_ipc_controller.h" | 6 #include "chrome/browser/ui/cocoa/about_ipc_controller.h" |
7 | 7 |
8 #if defined(IPC_MESSAGE_LOG_ENABLED) | 8 #if defined(IPC_MESSAGE_LOG_ENABLED) |
9 | 9 |
10 namespace AboutIPCDialog { | 10 namespace AboutIPCDialog { |
11 | 11 |
12 void RunDialog() { | 12 void RunDialog() { |
13 // The controller gets deallocated when then window is closed, | 13 // The controller gets deallocated when then window is closed, |
14 // so it is safe to "fire and forget". | 14 // so it is safe to "fire and forget". |
15 AboutIPCController* controller = [AboutIPCController sharedController]; | 15 AboutIPCController* controller = [AboutIPCController sharedController]; |
16 [[controller window] makeKeyAndOrderFront:controller]; | 16 [[controller window] makeKeyAndOrderFront:controller]; |
17 } | 17 } |
18 | 18 |
19 }; // namespace AboutIPCDialog | 19 } // namespace AboutIPCDialog |
| 20 |
| 21 void AboutIPCBridge::Log(const IPC::LogData& data) { |
| 22 CocoaLogData* cocoa_data = [[CocoaLogData alloc] initWithLogData:data]; |
| 23 if ([NSThread isMainThread]) { |
| 24 [controller_ log:cocoa_data]; |
| 25 } else { |
| 26 [controller_ performSelectorOnMainThread:@selector(log:) |
| 27 withObject:cocoa_data |
| 28 waitUntilDone:NO]; |
| 29 } |
| 30 } |
20 | 31 |
21 #endif // IPC_MESSAGE_LOG_ENABLED | 32 #endif // IPC_MESSAGE_LOG_ENABLED |
OLD | NEW |