Disable view source for Developer Tools.
[chromium-blink-merge.git] / chrome / browser / ui / views / about_ipc_dialog.h
blob14e4835d3f8ac913af06c7eb7105db0ba7094592
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)
12 #include <atlbase.h>
13 #include <atlapp.h>
14 #include <atlctrls.h>
15 #include <atlwin.h>
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;
23 namespace views {
24 class LabelButton;
25 class NativeViewHost;
28 class AboutIPCDialog : public views::DialogDelegateView,
29 public views::ButtonListener,
30 public IPC::Logging::Consumer {
31 public:
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();
38 private:
39 friend struct DefaultSingletonTraits<AboutIPCDialog>;
41 AboutIPCDialog();
43 // Sets up all UI controls for the dialog.
44 void SetupControls();
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.
71 bool tracking_;
73 DISALLOW_COPY_AND_ASSIGN(AboutIPCDialog);
76 #endif // OS_WIN && IPC_MESSAGE_LOG_ENABLED
78 #endif // CHROME_BROWSER_UI_VIEWS_ABOUT_IPC_DIALOG_H_