OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 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/task_manager.h" | 5 #include "chrome/browser/task_manager/task_manager.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
9 #include "base/metrics/stats_table.h" | 9 #include "base/metrics/stats_table.h" |
10 #include "base/utf_string_conversions.h" | 10 #include "base/utf_string_conversions.h" |
(...skipping 271 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
282 static void Show(bool highlight_background_resources); | 282 static void Show(bool highlight_background_resources); |
283 | 283 |
284 // views::View: | 284 // views::View: |
285 virtual void Layout() OVERRIDE; | 285 virtual void Layout() OVERRIDE; |
286 virtual gfx::Size GetPreferredSize() OVERRIDE; | 286 virtual gfx::Size GetPreferredSize() OVERRIDE; |
287 virtual void ViewHierarchyChanged(bool is_add, views::View* parent, | 287 virtual void ViewHierarchyChanged(bool is_add, views::View* parent, |
288 views::View* child) OVERRIDE; | 288 views::View* child) OVERRIDE; |
289 | 289 |
290 // views::ButtonListener: | 290 // views::ButtonListener: |
291 virtual void ButtonPressed(views::Button* sender, | 291 virtual void ButtonPressed(views::Button* sender, |
292 const views::Event& event) OVERRIDE; | 292 const ui::Event& event) OVERRIDE; |
293 | 293 |
294 // views::DialogDelegateView: | 294 // views::DialogDelegateView: |
295 virtual bool CanResize() const OVERRIDE; | 295 virtual bool CanResize() const OVERRIDE; |
296 virtual bool CanMaximize() const OVERRIDE; | 296 virtual bool CanMaximize() const OVERRIDE; |
297 virtual bool ExecuteWindowsCommand(int command_id) OVERRIDE; | 297 virtual bool ExecuteWindowsCommand(int command_id) OVERRIDE; |
298 virtual string16 GetWindowTitle() const OVERRIDE; | 298 virtual string16 GetWindowTitle() const OVERRIDE; |
299 virtual std::string GetWindowName() const OVERRIDE; | 299 virtual std::string GetWindowName() const OVERRIDE; |
300 virtual int GetDialogButtons() const OVERRIDE; | 300 virtual int GetDialogButtons() const OVERRIDE; |
301 virtual void WindowClosing() OVERRIDE; | 301 virtual void WindowClosing() OVERRIDE; |
302 virtual views::View* GetContentsView() OVERRIDE; | 302 virtual views::View* GetContentsView() OVERRIDE; |
(...skipping 295 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
598 instance_->GetWidget()->Show(); | 598 instance_->GetWidget()->Show(); |
599 | 599 |
600 // Set the initial focus to the list of tasks. | 600 // Set the initial focus to the list of tasks. |
601 views::FocusManager* focus_manager = instance_->GetFocusManager(); | 601 views::FocusManager* focus_manager = instance_->GetFocusManager(); |
602 if (focus_manager) | 602 if (focus_manager) |
603 focus_manager->SetFocusedView(instance_->tab_table_); | 603 focus_manager->SetFocusedView(instance_->tab_table_); |
604 } | 604 } |
605 | 605 |
606 // ButtonListener implementation. | 606 // ButtonListener implementation. |
607 void TaskManagerView::ButtonPressed( | 607 void TaskManagerView::ButtonPressed( |
608 views::Button* sender, const views::Event& event) { | 608 views::Button* sender, const ui::Event& event) { |
609 if (purge_memory_button_ && (sender == purge_memory_button_)) { | 609 if (purge_memory_button_ && (sender == purge_memory_button_)) { |
610 MemoryPurger::PurgeAll(); | 610 MemoryPurger::PurgeAll(); |
611 } else { | 611 } else { |
612 DCHECK_EQ(kill_button_, sender); | 612 DCHECK_EQ(kill_button_, sender); |
613 for (views::TableSelectionIterator iter = tab_table_->SelectionBegin(); | 613 for (views::TableSelectionIterator iter = tab_table_->SelectionBegin(); |
614 iter != tab_table_->SelectionEnd(); ++iter) | 614 iter != tab_table_->SelectionEnd(); ++iter) |
615 task_manager_->KillProcess(*iter); | 615 task_manager_->KillProcess(*iter); |
616 } | 616 } |
617 } | 617 } |
618 | 618 |
(...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
800 // Declared in browser_dialogs.h so others don't need to depend on our header. | 800 // Declared in browser_dialogs.h so others don't need to depend on our header. |
801 void ShowTaskManager() { | 801 void ShowTaskManager() { |
802 TaskManagerView::Show(false); | 802 TaskManagerView::Show(false); |
803 } | 803 } |
804 | 804 |
805 void ShowBackgroundPages() { | 805 void ShowBackgroundPages() { |
806 TaskManagerView::Show(true); | 806 TaskManagerView::Show(true); |
807 } | 807 } |
808 | 808 |
809 } // namespace chrome | 809 } // namespace chrome |
OLD | NEW |