summaryrefslogtreecommitdiffstats
path: root/chrome/browser/tab_contents
diff options
context:
space:
mode:
authorbrettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-02-06 03:32:12 +0000
committerbrettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-02-06 03:32:12 +0000
commit807e90d8ea383e85645ad33522e9f9e17a9f25f3 (patch)
treecdac30c9e09e0c4cacf9694eeabb650c6f5bcce1 /chrome/browser/tab_contents
parent260cdeef79ce2e2a641a981de51b6d35b758422a (diff)
downloadchromium_src-807e90d8ea383e85645ad33522e9f9e17a9f25f3.zip
chromium_src-807e90d8ea383e85645ad33522e9f9e17a9f25f3.tar.gz
chromium_src-807e90d8ea383e85645ad33522e9f9e17a9f25f3.tar.bz2
Move the about:ipc tab to a dialog. This patch is kind of a hack, the Windows
specific code for the settings dialog and the table view are just copied from the old dialog. I tried to change as little as possible. The only significant change should be that I commented out saving the settings in the profile. This is a re-land of my previous patch which didn't ifdef the code based on the IPC logging preprocessor define. Previous review URL: http://codereview.chromium.org/19741 Review URL: http://codereview.chromium.org/20033 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@9303 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/tab_contents')
-rw-r--r--chrome/browser/tab_contents/ipc_status_view.cc372
-rw-r--r--chrome/browser/tab_contents/ipc_status_view.h89
-rw-r--r--chrome/browser/tab_contents/status_view.cc74
-rw-r--r--chrome/browser/tab_contents/status_view.h84
-rw-r--r--chrome/browser/tab_contents/tab_contents_factory.cc6
-rw-r--r--chrome/browser/tab_contents/tab_contents_type.h1
6 files changed, 0 insertions, 626 deletions
diff --git a/chrome/browser/tab_contents/ipc_status_view.cc b/chrome/browser/tab_contents/ipc_status_view.cc
deleted file mode 100644
index a317aac..0000000
--- a/chrome/browser/tab_contents/ipc_status_view.cc
+++ /dev/null
@@ -1,372 +0,0 @@
-// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-// Need to include this before any other file because it defines
-// IPC_MESSAGE_LOG_ENABLED.
-#include "chrome/common/ipc_message.h"
-
-#ifdef IPC_MESSAGE_LOG_ENABLED
-#define IPC_MESSAGE_MACROS_LOG_ENABLED
-
-#include "chrome/browser/tab_contents/ipc_status_view.h"
-
-#include <stdio.h>
-
-#include "base/logging.h"
-#include "base/string_util.h"
-#include "chrome/app/chrome_dll_resource.h"
-#include "chrome/browser/profile.h"
-#include "chrome/common/chrome_constants.h"
-#include "chrome/common/ipc_logging.h"
-#include "chrome/common/plugin_messages.h"
-#include "chrome/common/pref_names.h"
-#include "chrome/common/pref_service.h"
-#include "chrome/common/render_messages.h"
-
-using base::Time;
-
-namespace {
-const wchar_t kTitleMsg[] = L"IPC Messages";
-
-const wchar_t kStartLoggingMsg[] = L"Start IPC Logging";
-const wchar_t kStopLoggingMsg[] = L"Stop IPC Logging";
-const wchar_t kClearMsg[] = L"Clear";
-const wchar_t kSettingsMsg[] = L"Filter";
-
-enum {
- kTimeColumn = 0,
- kChannelColumn,
- kMessageColumn,
- kFlagsColumn,
- kDispatchColumn,
- kProcessColumn,
- kParamsColumn,
-};
-
-} // namespace
-
-IPCStatusView* IPCStatusView::current_;
-
-IPCStatusView::IPCStatusView()
- : StatusView(TAB_CONTENTS_IPC_STATUS_VIEW) {
- DCHECK(!current_);
- current_ = this;
- settings_dialog_ = NULL;
- init_done_ = false;
- view_ = NULL;
- view_host_ = NULL;
- plugin_ = NULL;
- plugin_host_ = NULL;
- npobject_ = NULL;
- plugin_process_ = NULL;
- plugin_process_host_ = NULL;
-
- IPC::Logging* log = IPC::Logging::current();
- log->RegisterMessageLogger(ViewStart, ViewMsgLog);
- log->RegisterMessageLogger(ViewHostStart, ViewHostMsgLog);
- log->RegisterMessageLogger(PluginProcessStart, PluginProcessMsgLog);
- log->RegisterMessageLogger(PluginProcessHostStart, PluginProcessHostMsgLog);
- log->RegisterMessageLogger(PluginStart, PluginMsgLog);
- log->RegisterMessageLogger(PluginHostStart, PluginHostMsgLog);
- log->RegisterMessageLogger(NPObjectStart, NPObjectMsgLog);
-
- log->SetConsumer(this);
-}
-
-IPCStatusView::~IPCStatusView() {
- current_ = NULL;
- IPC::Logging::current()->SetConsumer(NULL);
-
- if (settings_dialog_ != NULL)
- ::DestroyWindow(settings_dialog_);
-}
-
-const std::wstring IPCStatusView::GetDefaultTitle() {
- return kTitleMsg;
-}
-
-void IPCStatusView::SetActive(bool active) {
- StatusView::set_is_active(active);
-
- if (!disabled_messages_.empty() || !active)
- return;
-
- Profile* current_profile = profile();
- if (!current_profile)
- return;
- PrefService* prefs = current_profile->GetPrefs();
- if (prefs->IsPrefRegistered(prefs::kIpcDisabledMessages))
- return;
- prefs->RegisterListPref(prefs::kIpcDisabledMessages);
- const ListValue* list = prefs->GetList(prefs::kIpcDisabledMessages);
- if (!list)
- return;
- for (ListValue::const_iterator itr = list->begin();
- itr != list->end();
- ++itr) {
- if (!(*itr)->IsType(Value::TYPE_INTEGER))
- continue;
- int value = 0;
- if (!(*itr)->GetAsInteger(&value))
- continue;
- disabled_messages_.insert(value);
- }
-}
-
-void IPCStatusView::OnCreate(const CRect& rect) {
- CreateButton(IDC_START_LOGGING, kStartLoggingMsg);
- CreateButton(IDC_STOP_LOGGING, kStopLoggingMsg);
- CreateButton(IDC_CLEAR, kClearMsg);
- CreateButton(IDC_SETTINGS, kSettingsMsg);
-
- // Initialize the list view for messages.
- // Don't worry about the size, we'll resize when we get WM_SIZE
- message_list_.Create(GetContainerHWND(), const_cast<CRect&>(rect), NULL,
- WS_CHILD | WS_VISIBLE | LVS_SORTASCENDING);
- message_list_.SetViewType(LVS_REPORT);
- message_list_.SetExtendedListViewStyle(LVS_EX_FULLROWSELECT);
-
- int column_index = 0;
- message_list_.InsertColumn(kTimeColumn, L"time", LVCFMT_LEFT, 80);
- message_list_.InsertColumn(kChannelColumn, L"channel", LVCFMT_LEFT, 110);
- message_list_.InsertColumn(kMessageColumn, L"message", LVCFMT_LEFT, 240);
- message_list_.InsertColumn(kFlagsColumn, L"flags", LVCFMT_LEFT, 50);
- message_list_.InsertColumn(kDispatchColumn, L"dispatch (ms)", LVCFMT_RIGHT, 80);
- message_list_.InsertColumn(kProcessColumn, L"process (ms)", LVCFMT_RIGHT, 80);
- message_list_.InsertColumn(kParamsColumn, L"parameters", LVCFMT_LEFT, 500);
-}
-
-void IPCStatusView::Log(const IPC::LogData& data) {
- if (disabled_messages_.find(data.type) != disabled_messages_.end())
- return; // Message type is filtered out.
-
- Time sent = Time::FromInternalValue(data.sent);
- Time::Exploded exploded;
- sent.LocalExplode(&exploded);
- if (exploded.hour > 12)
- exploded.hour -= 12;
-
- std::wstring sent_str = StringPrintf(L"%02d:%02d:%02d.%03d",
- exploded.hour, exploded.minute, exploded.second, exploded.millisecond);
-
- int count = message_list_.GetItemCount();
- int index = message_list_.InsertItem(count, sent_str.c_str());
-
- message_list_.SetItemText(index, kTimeColumn, sent_str.c_str());
- message_list_.SetItemText(index, kChannelColumn, data.channel.c_str());
-
- std::wstring message_name;
- IPC::Logging::GetMessageText(data.type, &message_name, NULL, NULL);
- message_list_.SetItemText(index, kMessageColumn, message_name.c_str());
- message_list_.SetItemText(index, kFlagsColumn, data.flags.c_str());
-
- int64 time_to_send = (Time::FromInternalValue(data.receive) -
- sent).InMilliseconds();
- // time can go backwards by a few ms (see Time), don't show that.
- time_to_send = std::max(static_cast<int>(time_to_send), 0);
- std::wstring temp = StringPrintf(L"%d", time_to_send);
- message_list_.SetItemText(index, kDispatchColumn, temp.c_str());
-
- int64 time_to_process = (Time::FromInternalValue(data.dispatch) -
- Time::FromInternalValue(data.receive)).InMilliseconds();
- time_to_process = std::max(static_cast<int>(time_to_process), 0);
- temp = StringPrintf(L"%d", time_to_process);
- message_list_.SetItemText(index, kProcessColumn, temp.c_str());
-
- message_list_.SetItemText(index, kParamsColumn, data.params.c_str());
- message_list_.EnsureVisible(index, FALSE);
-}
-
-void IPCStatusView::OnSize(const CRect& rect) {
- message_list_.MoveWindow(rect);
-}
-
-void IPCStatusView::OnStartLogging(UINT code, int button_id, HWND hwnd) {
- IPC::Logging::current()->Enable();
-}
-
-void IPCStatusView::OnStopLogging(UINT code, int button_id, HWND hwnd) {
- IPC::Logging::current()->Disable();
-}
-
-void IPCStatusView::OnClear(UINT code, int button_id, HWND hwnd) {
- message_list_.DeleteAllItems();
-}
-
-INT_PTR CALLBACK IPCStatusView::DialogProc(
- HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam) {
- switch (msg) {
- case WM_INITDIALOG:
- current()->InitDialog(hwnd);
- return FALSE; // Don't set keyboard focus.
- case WM_SYSCOMMAND:
- if (wparam == SC_CLOSE) {
- current()->CloseDialog();
- return FALSE;
- }
- break;
- case WM_NOTIFY: {
- NMLISTVIEW* info = reinterpret_cast<NM_LISTVIEW*>(lparam);
- if ((wparam == IDC_View || wparam == IDC_ViewHost || wparam == IDC_Plugin ||
- wparam == IDC_PluginHost || wparam == IDC_NPObject ||
- wparam == IDC_PluginProcess || wparam == IDC_PluginProcessHost) &&
- info->hdr.code == LVN_ITEMCHANGED) {
- if (info->uChanged & LVIF_STATE) {
- bool checked = (info->uNewState >> 12) == 2;
- current()->OnCheck(static_cast<int>(info->lParam), checked);
- }
- return FALSE;
- }
- break;
- }
- case WM_COMMAND:
- if (HIWORD(wparam) == BN_CLICKED)
- current()->OnButtonClick(LOWORD(wparam));
-
- break;
- }
- return FALSE;
-}
-
-void IPCStatusView::InitDialog(HWND hwnd) {
- CreateColumn(ViewStart, ViewEnd, ::GetDlgItem(hwnd, IDC_View), &view_);
- CreateColumn(ViewHostStart, ViewHostEnd, ::GetDlgItem(hwnd, IDC_ViewHost),
- &view_host_);
- CreateColumn(PluginStart, PluginEnd, ::GetDlgItem(hwnd, IDC_Plugin), &plugin_);
- CreateColumn(PluginHostStart, PluginHostEnd,
- ::GetDlgItem(hwnd, IDC_PluginHost), &plugin_host_);
- CreateColumn(NPObjectStart, NPObjectEnd, ::GetDlgItem(hwnd, IDC_NPObject),
- &npobject_);
- CreateColumn(PluginProcessStart, PluginProcessEnd,
- ::GetDlgItem(hwnd, IDC_PluginProcess), &plugin_process_);
- CreateColumn(PluginProcessHostStart, PluginProcessHostEnd,
- ::GetDlgItem(hwnd, IDC_PluginProcessHost), &plugin_process_host_);
- init_done_ = true;
-}
-
-void IPCStatusView::CreateColumn(
- uint16 start, uint16 end, HWND hwnd, CListViewCtrl** control) {
- DCHECK(*control == NULL);
- *control = new CListViewCtrl(hwnd);
- CListViewCtrl* control_ptr = *control;
- control_ptr->SetViewType(LVS_REPORT);
- control_ptr->SetExtendedListViewStyle(LVS_EX_CHECKBOXES);
- control_ptr->ModifyStyle(0, LVS_SORTASCENDING | LVS_NOCOLUMNHEADER);
- control_ptr->InsertColumn(0, L"id", LVCFMT_LEFT, 230);
-
- std::set<int>* disabled_messages = &current()->disabled_messages_;
- for (uint16 i = start; i < end; i++) {
- std::wstring name;
- IPC::Logging::GetMessageText(i, &name, NULL, NULL);
-
- int index = control_ptr->InsertItem(
- LVIF_TEXT | LVIF_PARAM, 0, name.c_str(), 0, 0, 0, i);
-
- control_ptr->SetItemText(index, 0, name.c_str());
-
- if (disabled_messages->find(i) == disabled_messages->end())
- control_ptr->SetCheckState(index, TRUE);
- }
-}
-
-void IPCStatusView::CloseDialog() {
- delete view_;
- delete view_host_;
- delete plugin_host_;
- delete npobject_;
- delete plugin_process_;
- delete plugin_process_host_;
- view_ = NULL;
- view_host_ = NULL;
- plugin_ = NULL;
- plugin_host_ = NULL;
- npobject_ = NULL;
- plugin_process_ = NULL;
- plugin_process_host_ = NULL;
- init_done_ = false;
-
- ::DestroyWindow(settings_dialog_);
- settings_dialog_ = NULL;
-
- Profile* current_profile = profile();
- if (!current_profile)
- return;
- PrefService* prefs = current_profile->GetPrefs();
- if (!prefs->IsPrefRegistered(prefs::kIpcDisabledMessages))
- return;
- ListValue* list = prefs->GetMutableList(prefs::kIpcDisabledMessages);
- list->Clear();
- for (std::set<int>::const_iterator itr = disabled_messages_.begin();
- itr != disabled_messages_.end();
- ++itr) {
- list->Append(Value::CreateIntegerValue(*itr));
- }
-}
-
-void IPCStatusView::OnCheck(int id, bool checked) {
- if (!init_done_)
- return;
-
- if (checked) {
- disabled_messages_.erase(id);
- } else {
- disabled_messages_.insert(id);
- }
-}
-
-void IPCStatusView::OnButtonClick(int id) {
- switch(id) {
- case IDC_ViewAll:
- CheckButtons(view_, true);
- break;
- case IDC_ViewNone:
- CheckButtons(view_, false);
- break;
- case IDC_ViewHostAll:
- CheckButtons(view_host_, true);
- break;
- case IDC_ViewHostNone:
- CheckButtons(view_host_, false);
- break;
- case IDC_PluginAll:
- CheckButtons(plugin_, true);
- break;
- case IDC_PluginNone:
- CheckButtons(plugin_, false);
- break;
- case IDC_PluginHostAll:
- CheckButtons(plugin_host_, true);
- break;
- case IDC_PluginHostNone:
- CheckButtons(plugin_host_, false);
- break;
- case IDC_NPObjectAll:
- CheckButtons(npobject_, true);
- break;
- case IDC_NPObjectNone:
- CheckButtons(npobject_, false);
- break;
- }
-}
-
-void IPCStatusView::CheckButtons(CListViewCtrl* control, bool check) {
- int count = control->GetItemCount();
- for (int i = 0; i < count; ++i)
- control->SetCheckState(i, check);
-}
-
-void IPCStatusView::OnSettings(UINT code, int button_id, HWND hwnd) {
- if (settings_dialog_ != NULL)
- return;
-
- HINSTANCE module_handle = GetModuleHandle(chrome::kBrowserResourcesDll);
-
- settings_dialog_ = CreateDialog(module_handle,
- MAKEINTRESOURCE(IDD_IPC_SETTINGS),
- NULL,
- IPCStatusView::DialogProc);
- ::ShowWindow(settings_dialog_, SW_SHOW);
-}
-
-#endif // IPC_MESSAGE_LOG_ENABLED
diff --git a/chrome/browser/tab_contents/ipc_status_view.h b/chrome/browser/tab_contents/ipc_status_view.h
deleted file mode 100644
index d0f28b1..0000000
--- a/chrome/browser/tab_contents/ipc_status_view.h
+++ /dev/null
@@ -1,89 +0,0 @@
-// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef CHROME_BROWSER_TAB_CONTENTS_IPC_STATUS_VIEW_H_
-#define CHROME_BROWSER_TAB_CONTENTS_IPC_STATUS_VIEW_H_
-
-#include <set>
-
-#include "base/basictypes.h"
-#include "chrome/browser/tab_contents/status_view.h"
-#include "chrome/common/ipc_logging.h"
-#include "chrome/common/ipc_message_utils.h"
-
-#ifdef IPC_MESSAGE_LOG_ENABLED
-
-class IPCStatusView : public StatusView,
- public IPC::Logging::Consumer {
- public:
- // button types
- enum {
- IDC_START_LOGGING = 101,
- IDC_STOP_LOGGING,
- IDC_CLEAR,
- IDC_SETTINGS,
- };
-
- IPCStatusView();
- virtual ~IPCStatusView();
-
- static IPCStatusView* current() { return current_; }
- void Log(const IPC::LogData& data);
-
- // TabContents overrides
- virtual const std::wstring GetDefaultTitle();
- virtual void SetActive(bool active);
-
- // StatusView implementation
- virtual void OnCreate(const CRect& rect);
- virtual void OnSize(const CRect& rect);
-
- BEGIN_MSG_MAP(IPCStatusView)
- COMMAND_HANDLER_EX(IDC_START_LOGGING, BN_CLICKED, OnStartLogging)
- COMMAND_HANDLER_EX(IDC_STOP_LOGGING, BN_CLICKED, OnStopLogging)
- COMMAND_HANDLER_EX(IDC_CLEAR, BN_CLICKED, OnClear)
- COMMAND_HANDLER_EX(IDC_SETTINGS, BN_CLICKED, OnSettings)
- CHAIN_MSG_MAP(StatusView);
- END_MSG_MAP()
-
- static INT_PTR CALLBACK DialogProc(
- HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam);
- void InitDialog(HWND hwnd);
- void CloseDialog();
- static void CreateColumn(
- uint16 start, uint16 end, HWND hwnd, CListViewCtrl** control);
- void OnCheck(int id, bool checked);
- void OnButtonClick(int id);
- static void CheckButtons(CListViewCtrl* control, bool check);
-
- private:
-
- // Event handlers
- void OnStartLogging(UINT code, int button_id, HWND hwnd);
- void OnStopLogging(UINT code, int button_id, HWND hwnd);
- void OnClear(UINT code, int button_id, HWND hwnd);
- void OnSettings(UINT code, int button_id, HWND hwnd);
-
- static IPCStatusView* current_;
- CListViewCtrl message_list_;
-
- // Used for the filter dialog.
- CListViewCtrl* view_;
- CListViewCtrl* view_host_;
- CListViewCtrl* plugin_;
- CListViewCtrl* plugin_host_;
- CListViewCtrl* npobject_;
- CListViewCtrl* plugin_process_;
- CListViewCtrl* plugin_process_host_;
- bool init_done_;
- HWND settings_dialog_;
- std::set<int> disabled_messages_;
-
- DISALLOW_COPY_AND_ASSIGN(IPCStatusView);
-};
-
-#endif // IPC_MESSAGE_LOG_ENABLED
-
-#endif // #ifndef CHROME_BROWSER_TAB_CONTENTS_IPC_STATUS_VIEW_H_
-
diff --git a/chrome/browser/tab_contents/status_view.cc b/chrome/browser/tab_contents/status_view.cc
deleted file mode 100644
index 349ac53..0000000
--- a/chrome/browser/tab_contents/status_view.cc
+++ /dev/null
@@ -1,74 +0,0 @@
-// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "chrome/browser/tab_contents/status_view.h"
-
-const int StatusView::kLayoutPadding = 5;
-const int StatusView::kButtonWidth = 200;
-const int StatusView::kButtonHeight = 30;
-
-StatusView::StatusView(TabContentsType type) : TabContents(type) {
-}
-
-StatusView::~StatusView() {
- for (size_t i = 0; i < buttons_.size(); ++i)
- delete buttons_[i].button;
-}
-
-void StatusView::CreateView() {
- Create(GetDesktopWindow());
-}
-
-LRESULT StatusView::OnCreate(LPCREATESTRUCT create_struct) {
- CRect rect(kLayoutPadding, kButtonHeight + kLayoutPadding * 2, 200, 200);
- OnCreate(rect);
- return 0;
-}
-
-void StatusView::OnSize(WPARAM wParam, const CSize& size) {
- int start_x = kLayoutPadding;
- int start_y = kButtonHeight + kLayoutPadding * 2;
- int end_x = size.cx - kLayoutPadding;
- int end_y = size.cy - kLayoutPadding;
- CRect rect(start_x, start_y, end_x, end_y);
- OnSize(rect);
-}
-
-LRESULT StatusView::OnEraseBkgnd(HDC hdc) {
- HBRUSH brush = GetSysColorBrush(COLOR_3DFACE);
- HGDIOBJ old_brush = SelectObject(hdc, brush);
-
- RECT rc;
- GetClientRect(&rc);
- FillRect(hdc, &rc, brush);
-
- SelectObject(hdc, old_brush);
- return 1;
-}
-
-void StatusView::CreateButton(int id, const wchar_t* title) {
- int button_count = static_cast<int>(buttons_.size());
- int width_offset =
- kLayoutPadding + button_count * (kButtonWidth + kLayoutPadding);
- CRect rect(0, 0, kButtonWidth, kButtonHeight);
- rect.OffsetRect(width_offset, kLayoutPadding);
- ButtonInfo bi;
- bi.button = new CButton();
- bi.id = id;
- bi.button->Create(m_hWnd, rect, NULL, WS_CHILD | WS_VISIBLE, 0, bi.id);
- bi.button->SetWindowText(title);
- buttons_.push_back(bi);
-}
-
-void StatusView::SetButtonText(int id, const wchar_t* title) {
- for (size_t i = 0; i < buttons_.size(); ++i) {
- if (buttons_[i].id == id) {
- buttons_[i].button->SetWindowText(title);
- return;
- }
- }
-
- DLOG(INFO) << "No button with id " << id << " to set title " << title;
-}
-
diff --git a/chrome/browser/tab_contents/status_view.h b/chrome/browser/tab_contents/status_view.h
deleted file mode 100644
index 88d1b91..0000000
--- a/chrome/browser/tab_contents/status_view.h
+++ /dev/null
@@ -1,84 +0,0 @@
-// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef CHROME_BROWSER_TAB_CONTENTS_STATUS_VIEW_H_
-#define CHROME_BROWSER_TAB_CONTENTS_STATUS_VIEW_H_
-
-#include <atlbase.h>
-#include <atlapp.h>
-#include <atlcrack.h>
-#include <atlctrls.h>
-#include <atlmisc.h>
-#include <vector>
-
-#include "base/basictypes.h"
-#include "chrome/browser/tab_contents/tab_contents.h"
-
-typedef CWinTraits<WS_CHILD | WS_CLIPCHILDREN | WS_CLIPSIBLINGS>
- StatusViewTraits;
-
-// A base class for about:network, about:ipc etc. It handles creating a row of
-// buttons at the top of the page. Derived classes get a rect of the remaining
-// area and can create their own controls there.
-class StatusView : public TabContents,
- public CWindowImpl<StatusView, CWindow, StatusViewTraits> {
- public:
- StatusView(TabContentsType type);
-
- BEGIN_MSG_MAP(StatusView)
- MSG_WM_CREATE(OnCreate)
- MSG_WM_ERASEBKGND(OnEraseBkgnd)
- MSG_WM_SIZE(OnSize)
- END_MSG_MAP()
-
- virtual void CreateView();
- virtual HWND GetContainerHWND() const { return m_hWnd; }
-
- // Derived classes should implement the following functions
- // TabContents override, to set the page title.
- // virtual const std::wstring GetDefaultTitle() = 0;
- // Gives a rect whose top left corner is after the buttons. The size of the
- // controls that are added by derived classes will be set in the next OnSize,
- // for now can use any height/width.
- virtual void OnCreate(const CRect& rect) = 0;
- virtual void OnSize(const CRect& rect) = 0;
-
- protected:
- // Should be deleted via CloseContents.
- virtual ~StatusView();
-
- // Creates and adds a button to the top row of the page. Button ids should
- // be unique and start at 101.
- void CreateButton(int id, const wchar_t* title);
- void SetButtonText(int id, const wchar_t* title);
-
- static const int kLayoutPadding;
- static const int kButtonWidth;
- static const int kButtonHeight;
-
- private:
- // FocusTraversal Implementation
- // TODO (jcampan): make focus traversal work
- views::View* FindNextFocusableView(views::View* starting_view, bool reverse,
- bool dont_loop) {
- return NULL;
- }
-
- // Event handlers
- LRESULT OnCreate(LPCREATESTRUCT create_struct);
- void OnSize(UINT size_command, const CSize& new_size);
- LRESULT OnEraseBkgnd(HDC hdc);
-
- struct ButtonInfo {
- CButton* button;
- int id;
- };
-
- std::vector<ButtonInfo> buttons_;
-
- DISALLOW_EVIL_CONSTRUCTORS(StatusView);
-};
-
-#endif // #ifndef CHROME_BROWSER_TAB_CONTENTS_STATUS_VIEW_H_
-
diff --git a/chrome/browser/tab_contents/tab_contents_factory.cc b/chrome/browser/tab_contents/tab_contents_factory.cc
index 2367592..18f3569 100644
--- a/chrome/browser/tab_contents/tab_contents_factory.cc
+++ b/chrome/browser/tab_contents/tab_contents_factory.cc
@@ -11,7 +11,6 @@
#include "chrome/browser/profile.h"
#include "chrome/browser/renderer_host/render_process_host.h"
#include "chrome/browser/debugger/debugger_contents.h"
-#include "chrome/browser/tab_contents/ipc_status_view.h"
#include "chrome/browser/tab_contents/native_ui_contents.h"
#include "chrome/browser/tab_contents/tab_contents.h"
#include "chrome/browser/tab_contents/tab_contents_factory.h"
@@ -44,11 +43,6 @@ TabContents* TabContents::CreateWithType(TabContentsType type,
case TAB_CONTENTS_WEB:
contents = new WebContents(profile, instance, NULL, MSG_ROUTING_NONE, NULL);
break;
-#ifdef IPC_MESSAGE_LOG_ENABLED
- case TAB_CONTENTS_IPC_STATUS_VIEW:
- contents = new IPCStatusView();
- break;
-#endif
case TAB_CONTENTS_NEW_TAB_UI:
contents = new NewTabUIContents(profile, instance, NULL);
break;
diff --git a/chrome/browser/tab_contents/tab_contents_type.h b/chrome/browser/tab_contents/tab_contents_type.h
index 73fc81f..87cd6452 100644
--- a/chrome/browser/tab_contents/tab_contents_type.h
+++ b/chrome/browser/tab_contents/tab_contents_type.h
@@ -13,7 +13,6 @@ enum TabContentsType {
TAB_CONTENTS_UNKNOWN_TYPE = 0,
TAB_CONTENTS_WEB,
TAB_CONTENTS_DOWNLOAD_VIEW,
- TAB_CONTENTS_IPC_STATUS_VIEW,
TAB_CONTENTS_CHROME_VIEW_CONTENTS,
TAB_CONTENTS_NEW_TAB_UI,
TAB_CONTENTS_NATIVE_UI,