| 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 284 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 295 const ui::Event& event) OVERRIDE; | 295 const ui::Event& event) OVERRIDE; |
| 296 | 296 |
| 297 // views::DialogDelegateView: | 297 // views::DialogDelegateView: |
| 298 virtual bool CanResize() const OVERRIDE; | 298 virtual bool CanResize() const OVERRIDE; |
| 299 virtual bool CanMaximize() const OVERRIDE; | 299 virtual bool CanMaximize() const OVERRIDE; |
| 300 virtual bool ExecuteWindowsCommand(int command_id) OVERRIDE; | 300 virtual bool ExecuteWindowsCommand(int command_id) OVERRIDE; |
| 301 virtual string16 GetWindowTitle() const OVERRIDE; | 301 virtual string16 GetWindowTitle() const OVERRIDE; |
| 302 virtual std::string GetWindowName() const OVERRIDE; | 302 virtual std::string GetWindowName() const OVERRIDE; |
| 303 virtual int GetDialogButtons() const OVERRIDE; | 303 virtual int GetDialogButtons() const OVERRIDE; |
| 304 virtual void WindowClosing() OVERRIDE; | 304 virtual void WindowClosing() OVERRIDE; |
| 305 virtual views::View* GetContentsView() OVERRIDE; | |
| 306 | 305 |
| 307 // views::TableViewObserver: | 306 // views::TableViewObserver: |
| 308 virtual void OnSelectionChanged() OVERRIDE; | 307 virtual void OnSelectionChanged() OVERRIDE; |
| 309 virtual void OnDoubleClick() OVERRIDE; | 308 virtual void OnDoubleClick() OVERRIDE; |
| 310 virtual void OnKeyDown(ui::KeyboardCode keycode) OVERRIDE; | 309 virtual void OnKeyDown(ui::KeyboardCode keycode) OVERRIDE; |
| 311 | 310 |
| 312 // views::LinkListener: | 311 // views::LinkListener: |
| 313 virtual void LinkClicked(views::Link* source, int event_flags) OVERRIDE; | 312 virtual void LinkClicked(views::Link* source, int event_flags) OVERRIDE; |
| 314 | 313 |
| 315 // Called by the column picker to pick up any new stat counters that | 314 // Called by the column picker to pick up any new stat counters that |
| (...skipping 363 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 679 | 678 |
| 680 void TaskManagerView::WindowClosing() { | 679 void TaskManagerView::WindowClosing() { |
| 681 // Now that the window is closed, we can allow a new one to be opened. | 680 // Now that the window is closed, we can allow a new one to be opened. |
| 682 // (WindowClosing comes in asynchronously from the call to Close() and we | 681 // (WindowClosing comes in asynchronously from the call to Close() and we |
| 683 // may have already opened a new instance). | 682 // may have already opened a new instance). |
| 684 if (instance_ == this) | 683 if (instance_ == this) |
| 685 instance_ = NULL; | 684 instance_ = NULL; |
| 686 task_manager_->OnWindowClosed(); | 685 task_manager_->OnWindowClosed(); |
| 687 } | 686 } |
| 688 | 687 |
| 689 views::View* TaskManagerView::GetContentsView() { | |
| 690 return this; | |
| 691 } | |
| 692 | |
| 693 // views::TableViewObserver implementation. | 688 // views::TableViewObserver implementation. |
| 694 void TaskManagerView::OnSelectionChanged() { | 689 void TaskManagerView::OnSelectionChanged() { |
| 695 bool selection_contains_browser_process = false; | 690 bool selection_contains_browser_process = false; |
| 696 for (views::TableSelectionIterator iter = tab_table_->SelectionBegin(); | 691 for (views::TableSelectionIterator iter = tab_table_->SelectionBegin(); |
| 697 iter != tab_table_->SelectionEnd(); ++iter) { | 692 iter != tab_table_->SelectionEnd(); ++iter) { |
| 698 if (task_manager_->IsBrowserProcess(*iter)) { | 693 if (task_manager_->IsBrowserProcess(*iter)) { |
| 699 selection_contains_browser_process = true; | 694 selection_contains_browser_process = true; |
| 700 break; | 695 break; |
| 701 } | 696 } |
| 702 } | 697 } |
| (...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 806 // Declared in browser_dialogs.h so others don't need to depend on our header. | 801 // Declared in browser_dialogs.h so others don't need to depend on our header. |
| 807 void ShowTaskManager() { | 802 void ShowTaskManager() { |
| 808 TaskManagerView::Show(false); | 803 TaskManagerView::Show(false); |
| 809 } | 804 } |
| 810 | 805 |
| 811 void ShowBackgroundPages() { | 806 void ShowBackgroundPages() { |
| 812 TaskManagerView::Show(true); | 807 TaskManagerView::Show(true); |
| 813 } | 808 } |
| 814 | 809 |
| 815 } // namespace chrome | 810 } // namespace chrome |
| OLD | NEW |