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