| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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_management/task_manager_tester.h" | 5 #include "chrome/browser/task_management/task_manager_tester.h" |
| 6 | 6 |
| 7 #include "base/memory/ptr_util.h" | 7 #include "base/memory/ptr_util.h" |
| 8 #include "chrome/browser/browser_process.h" | 8 #include "chrome/browser/browser_process.h" |
| 9 #include "chrome/browser/profiles/profile.h" | 9 #include "chrome/browser/profiles/profile.h" |
| 10 #include "chrome/browser/sessions/session_tab_helper.h" | 10 #include "chrome/browser/sessions/session_tab_helper.h" |
| (...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 138 | 138 |
| 139 void Kill(int row) override { model_->KillTask(row); } | 139 void Kill(int row) override { model_->KillTask(row); } |
| 140 | 140 |
| 141 private: | 141 private: |
| 142 task_management::TaskManagerInterface* task_manager() { | 142 task_management::TaskManagerInterface* task_manager() { |
| 143 return model_->observed_task_manager(); | 143 return model_->observed_task_manager(); |
| 144 } | 144 } |
| 145 | 145 |
| 146 // Returns the TaskManagerTableModel for the the visible NewTaskManagerView. | 146 // Returns the TaskManagerTableModel for the the visible NewTaskManagerView. |
| 147 static task_management::TaskManagerTableModel* GetRealModel() { | 147 static task_management::TaskManagerTableModel* GetRealModel() { |
| 148 // This downcast is safe, as long as the new task manager is enabled. | 148 return chrome::ShowTaskManager(nullptr); |
| 149 task_management::TaskManagerTableModel* result = | |
| 150 static_cast<task_management::TaskManagerTableModel*>( | |
| 151 chrome::ShowTaskManager(nullptr)); | |
| 152 return result; | |
| 153 } | 149 } |
| 154 | 150 |
| 155 task_management::TaskManagerTableModel* model_; | 151 task_management::TaskManagerTableModel* model_; |
| 156 std::unique_ptr<ScopedInterceptTableModelObserver> interceptor_; | 152 std::unique_ptr<ScopedInterceptTableModelObserver> interceptor_; |
| 157 }; | 153 }; |
| 158 | 154 |
| 159 // static | 155 // static |
| 160 std::unique_ptr<TaskManagerTester> TaskManagerTester::CreateDefault( | 156 std::unique_ptr<TaskManagerTester> TaskManagerTester::CreateDefault( |
| 161 const base::Closure& callback) { | 157 const base::Closure& callback) { |
| 162 return base::WrapUnique(new TaskManagerTesterImpl(callback)); | 158 return base::WrapUnique(new TaskManagerTesterImpl(callback)); |
| 163 } | 159 } |
| 164 | 160 |
| 165 } // namespace task_management | 161 } // namespace task_management |
| OLD | NEW |