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 #ifndef CHROME_BROWSER_UI_VIEWS_ABOUT_IPC_DIALOG_H_
6 #define CHROME_BROWSER_UI_VIEWS_ABOUT_IPC_DIALOG_H_
8 #include "ipc/ipc_message.h" // For IPC_MESSAGE_LOG_ENABLED.
10 #if defined(OS_WIN) && defined(IPC_MESSAGE_LOG_ENABLED)
17 #include "ipc/ipc_logging.h"
18 #include "ui/views/controls/button/button.h"
19 #include "ui/views/window/dialog_delegate.h"
21 template <typename T
> struct DefaultSingletonTraits
;
28 class AboutIPCDialog
: public views::DialogDelegateView
,
29 public views::ButtonListener
,
30 public IPC::Logging::Consumer
{
32 // This dialog is a singleton. If the dialog is already opened, it won't do
33 // anything, so you can just blindly call this function all you want.
34 static void RunDialog();
36 virtual ~AboutIPCDialog();
39 friend struct DefaultSingletonTraits
<AboutIPCDialog
>;
43 // Sets up all UI controls for the dialog.
46 // views::View overrides.
47 virtual gfx::Size
GetPreferredSize() OVERRIDE
;
48 virtual int GetDialogButtons() const OVERRIDE
;
49 virtual base::string16
GetWindowTitle() const OVERRIDE
;
50 virtual void Layout() OVERRIDE
;
52 // IPC::Logging::Consumer implementation.
53 virtual void Log(const IPC::LogData
& data
) OVERRIDE
;
55 // views::WidgetDelegate (via views::DialogDelegateView).
56 virtual bool CanResize() const OVERRIDE
;
57 virtual bool UseNewStyleForThisDialog() const OVERRIDE
;
59 // views::ButtonListener.
60 virtual void ButtonPressed(views::Button
* button
,
61 const ui::Event
& event
) OVERRIDE
;
63 WTL::CListViewCtrl message_list_
;
65 views::LabelButton
* track_toggle_
;
66 views::LabelButton
* clear_button_
;
67 views::LabelButton
* filter_button_
;
68 views::NativeViewHost
* table_
;
70 // Set to true when we're tracking network status.
73 DISALLOW_COPY_AND_ASSIGN(AboutIPCDialog
);
76 #endif // OS_WIN && IPC_MESSAGE_LOG_ENABLED
78 #endif // CHROME_BROWSER_UI_VIEWS_ABOUT_IPC_DIALOG_H_