From a13e0ee509d4bcbc3cb44b689d0b7575fe1bd031 Mon Sep 17 00:00:00 2001 From: "evan@chromium.org" Date: Thu, 4 Jun 2009 01:36:22 +0000 Subject: Revert "It looks like the unit tests instantiate the TaskManagerView..." This reverts commit r17573, on beng's request. git-svn-id: svn://svn.chromium.org/chrome/trunk/src@17581 0039d316-1c4b-4281-b951-d872f2087c98 --- chrome/browser/task_manager_win.cc | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) (limited to 'chrome/browser') diff --git a/chrome/browser/task_manager_win.cc b/chrome/browser/task_manager_win.cc index 511d881..e88024d 100644 --- a/chrome/browser/task_manager_win.cc +++ b/chrome/browser/task_manager_win.cc @@ -260,13 +260,7 @@ TaskManagerViewImpl::TaskManagerViewImpl(TaskManager* task_manager, : task_manager_(task_manager), model_(model), is_always_on_top_(false) { - kill_button_.reset(new views::NativeButton( - this, l10n_util::GetString(IDS_TASK_MANAGER_KILL))); - kill_button_->AddAccelerator(views::Accelerator('E', false, false, false)); - kill_button_->SetAccessibleKeyboardShortcut(L"E"); - about_memory_link_.reset(new views::Link( - l10n_util::GetString(IDS_TASK_MANAGER_ABOUT_MEMORY_LINK))); - about_memory_link_->SetController(this); + Init(); } TaskManagerViewImpl::~TaskManagerViewImpl() { @@ -302,7 +296,6 @@ void TaskManagerViewImpl::Init() { tab_table_ = new views::GroupTableView(table_model_.get(), columns_, views::ICON_AND_TEXT, false, true, true); - AddChildView(tab_table_); // Hide some columns by default tab_table_->SetColumnVisibility(IDS_TASK_MANAGER_PROCESS_ID_COLUMN, false); @@ -317,6 +310,13 @@ void TaskManagerViewImpl::Init() { tab_table_->AddColumn(col); tab_table_->SetObserver(this); SetContextMenuController(this); + kill_button_.reset(new views::NativeButton( + this, l10n_util::GetString(IDS_TASK_MANAGER_KILL))); + kill_button_->AddAccelerator(views::Accelerator('E', false, false, false)); + kill_button_->SetAccessibleKeyboardShortcut(L"E"); + about_memory_link_.reset(new views::Link( + l10n_util::GetString(IDS_TASK_MANAGER_ABOUT_MEMORY_LINK))); + about_memory_link_->SetController(this); // Makes sure our state is consistent. OnSelectionChanged(); @@ -357,7 +357,8 @@ void TaskManagerViewImpl::ViewHierarchyChanged(bool is_add, if (is_add) { parent->AddChildView(kill_button_.get()); parent->AddChildView(about_memory_link_.get()); - Init(); + if (tab_table_->GetParent() != this) + AddChildView(tab_table_); } else { parent->RemoveChildView(kill_button_.get()); parent->RemoveChildView(about_memory_link_.get()); -- cgit v1.1