| 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 #ifndef CHROME_BROWSER_TASK_MANAGEMENT_TASK_MANAGER_TESTER_H_ | 5 #ifndef CHROME_BROWSER_TASK_MANAGEMENT_TASK_MANAGER_TESTER_H_ |
| 6 #define CHROME_BROWSER_TASK_MANAGEMENT_TASK_MANAGER_TESTER_H_ | 6 #define CHROME_BROWSER_TASK_MANAGEMENT_TASK_MANAGER_TESTER_H_ |
| 7 | 7 |
| 8 #include <stddef.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <memory> | 10 #include <memory> |
| 11 | 11 |
| 12 #include "base/callback_forward.h" | 12 #include "base/callback_forward.h" |
| 13 #include "base/strings/string16.h" | 13 #include "base/strings/string16.h" |
| 14 #include "chrome/browser/task_manager/task_manager_browsertest_util.h" | 14 #include "chrome/browser/task_management/task_manager_browsertest_util.h" |
| 15 | 15 |
| 16 namespace task_management { | 16 namespace task_management { |
| 17 | 17 |
| 18 // An adapter that abstracts away the difference of old vs. new task manager. | 18 // An adapter that abstracts away the difference of old vs. new task manager. |
| 19 class TaskManagerTester { | 19 class TaskManagerTester { |
| 20 public: | 20 public: |
| 21 using ColumnSpecifier = task_manager::browsertest_util::ColumnSpecifier; | 21 using ColumnSpecifier = browsertest_util::ColumnSpecifier; |
| 22 | 22 |
| 23 // Creates a TaskManagerTester backed by the current task manager. The task | 23 // Creates a TaskManagerTester backed by the current task manager. The task |
| 24 // manager should already be visible when you call this function. |callback|, | 24 // manager should already be visible when you call this function. |callback|, |
| 25 // if not a null callback, will be invoked when the underlying model changes. | 25 // if not a null callback, will be invoked when the underlying model changes. |
| 26 static std::unique_ptr<TaskManagerTester> Create( | 26 static std::unique_ptr<TaskManagerTester> Create( |
| 27 const base::Closure& callback); | 27 const base::Closure& callback); |
| 28 | 28 |
| 29 virtual ~TaskManagerTester() {} | 29 virtual ~TaskManagerTester() {} |
| 30 | 30 |
| 31 // Get the number of rows currently in the task manager. | 31 // Get the number of rows currently in the task manager. |
| (...skipping 13 matching lines...) Expand all Loading... |
| 45 // return -1. | 45 // return -1. |
| 46 virtual int32_t GetTabId(int row) = 0; | 46 virtual int32_t GetTabId(int row) = 0; |
| 47 | 47 |
| 48 // Kill the process of |row|. | 48 // Kill the process of |row|. |
| 49 virtual void Kill(int row) = 0; | 49 virtual void Kill(int row) = 0; |
| 50 }; | 50 }; |
| 51 | 51 |
| 52 } // namespace task_management | 52 } // namespace task_management |
| 53 | 53 |
| 54 #endif // CHROME_BROWSER_TASK_MANAGEMENT_TASK_MANAGER_TESTER_H_ | 54 #endif // CHROME_BROWSER_TASK_MANAGEMENT_TASK_MANAGER_TESTER_H_ |
| OLD | NEW |