[Metrics] Make MetricsStateManager take a callback param to check if UMA is enabled.
[chromium-blink-merge.git] / chrome / browser / ui / cocoa / about_ipc_dialog.mm
blobefb932e9b8cae964a0f6fbffdc9818789093a306
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
3 // found in the LICENSE file.
5 #include "chrome/browser/ui/browser_dialogs.h"
6 #include "chrome/browser/ui/cocoa/about_ipc_controller.h"
7 #include "chrome/browser/ui/cocoa/about_ipc_dialog.h"
9 #if defined(IPC_MESSAGE_LOG_ENABLED)
11 namespace chrome {
13 void ShowAboutIPCDialog() {
14   // The controller gets deallocated when then window is closed,
15   // so it is safe to "fire and forget".
16   AboutIPCController* controller = [AboutIPCController sharedController];
17   [[controller window] makeKeyAndOrderFront:controller];
20 }  // namespace chrome
22 void AboutIPCBridge::Log(const IPC::LogData& data) {
23   CocoaLogData* cocoa_data = [[CocoaLogData alloc] initWithLogData:data];
24   if ([NSThread isMainThread]) {
25     [controller_ log:cocoa_data];
26   } else {
27     [controller_ performSelectorOnMainThread:@selector(log:)
28                                   withObject:cocoa_data
29                                waitUntilDone:NO];
30   }
33 #endif  // IPC_MESSAGE_LOG_ENABLED