| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "chrome/browser/task_manager.h" | 5 #include "chrome/browser/task_manager.h" |
| 6 | 6 |
| 7 #include "app/l10n_util.h" | 7 #include "app/l10n_util.h" |
| 8 #include "app/table_model_observer.h" | 8 #include "app/table_model_observer.h" |
| 9 #include "base/stats_table.h" | 9 #include "base/stats_table.h" |
| 10 #include "chrome/app/chrome_dll_resource.h" | 10 #include "chrome/app/chrome_dll_resource.h" |
| (...skipping 466 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 477 void TaskManagerView::Show() { | 477 void TaskManagerView::Show() { |
| 478 if (instance_) { | 478 if (instance_) { |
| 479 // If there's a Task manager window open already, just activate it. | 479 // If there's a Task manager window open already, just activate it. |
| 480 instance_->window()->Activate(); | 480 instance_->window()->Activate(); |
| 481 } else { | 481 } else { |
| 482 instance_ = new TaskManagerView; | 482 instance_ = new TaskManagerView; |
| 483 views::Window::CreateChromeWindow(NULL, gfx::Rect(), instance_); | 483 views::Window::CreateChromeWindow(NULL, gfx::Rect(), instance_); |
| 484 instance_->InitAlwaysOnTopState(); | 484 instance_->InitAlwaysOnTopState(); |
| 485 instance_->model_->StartUpdating(); | 485 instance_->model_->StartUpdating(); |
| 486 instance_->window()->Show(); | 486 instance_->window()->Show(); |
| 487 |
| 488 // Set the initial focus to the list of tasks. |
| 489 views::FocusManager* focus_manager = instance_->GetFocusManager(); |
| 490 if (focus_manager) |
| 491 focus_manager->SetFocusedView(instance_->tab_table_); |
| 487 } | 492 } |
| 488 } | 493 } |
| 489 | 494 |
| 490 // ButtonListener implementation. | 495 // ButtonListener implementation. |
| 491 void TaskManagerView::ButtonPressed( | 496 void TaskManagerView::ButtonPressed( |
| 492 views::Button* sender, const views::Event& event) { | 497 views::Button* sender, const views::Event& event) { |
| 493 if (purge_memory_button_ && (sender == purge_memory_button_)) { | 498 if (purge_memory_button_ && (sender == purge_memory_button_)) { |
| 494 MemoryPurger::PurgeAll(); | 499 MemoryPurger::PurgeAll(); |
| 495 } else { | 500 } else { |
| 496 DCHECK_EQ(sender, kill_button_); | 501 DCHECK_EQ(sender, kill_button_); |
| (...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 674 } // namespace | 679 } // namespace |
| 675 | 680 |
| 676 namespace browser { | 681 namespace browser { |
| 677 | 682 |
| 678 // Declared in browser_dialogs.h so others don't need to depend on our header. | 683 // Declared in browser_dialogs.h so others don't need to depend on our header. |
| 679 void ShowTaskManager() { | 684 void ShowTaskManager() { |
| 680 TaskManagerView::Show(); | 685 TaskManagerView::Show(); |
| 681 } | 686 } |
| 682 | 687 |
| 683 } // namespace browser | 688 } // namespace browser |
| OLD | NEW |