| 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/ui/cocoa/task_manager_mac.h" | 5 #include "chrome/browser/ui/cocoa/task_manager_mac.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <algorithm> | 9 #include <algorithm> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 579 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 590 | 590 |
| 591 // static | 591 // static |
| 592 void TaskManagerMac::Hide() { | 592 void TaskManagerMac::Hide() { |
| 593 if (instance_) | 593 if (instance_) |
| 594 [instance_->window_controller_ close]; | 594 [instance_->window_controller_ close]; |
| 595 } | 595 } |
| 596 | 596 |
| 597 namespace chrome { | 597 namespace chrome { |
| 598 | 598 |
| 599 // Declared in browser_dialogs.h. | 599 // Declared in browser_dialogs.h. |
| 600 ui::TableModel* ShowTaskManager(Browser* browser) { | 600 task_management::TaskManagerTableModel* ShowTaskManager(Browser* browser) { |
| 601 if (chrome::ToolkitViewsDialogsEnabled()) | 601 if (chrome::ToolkitViewsDialogsEnabled()) |
| 602 return chrome::ShowTaskManagerViews(browser); | 602 return chrome::ShowTaskManagerViews(browser); |
| 603 | 603 |
| 604 TaskManagerMac::Show(); | 604 TaskManagerMac::Show(); |
| 605 return nullptr; // No ui::TableModel* to return on Mac, so return nullptr. | 605 return nullptr; // No ui::TableModel* to return on Mac, so return nullptr. |
| 606 } | 606 } |
| 607 | 607 |
| 608 void HideTaskManager() { | 608 void HideTaskManager() { |
| 609 if (chrome::ToolkitViewsDialogsEnabled()) { | 609 if (chrome::ToolkitViewsDialogsEnabled()) { |
| 610 chrome::HideTaskManagerViews(); | 610 chrome::HideTaskManagerViews(); |
| 611 return; | 611 return; |
| 612 } | 612 } |
| 613 | 613 |
| 614 TaskManagerMac::Hide(); | 614 TaskManagerMac::Hide(); |
| 615 } | 615 } |
| 616 | 616 |
| 617 bool NotifyOldTaskManagerBytesRead(const net::URLRequest& request, | 617 bool NotifyOldTaskManagerBytesRead(const net::URLRequest& request, |
| 618 int64_t bytes_read) { | 618 int64_t bytes_read) { |
| 619 if (task_management::TaskManagerInterface::IsNewTaskManagerEnabled()) | 619 if (task_management::TaskManagerInterface::IsNewTaskManagerEnabled()) |
| 620 return false; | 620 return false; |
| 621 | 621 |
| 622 TaskManager::GetInstance()->model()->NotifyBytesRead(request, bytes_read); | 622 TaskManager::GetInstance()->model()->NotifyBytesRead(request, bytes_read); |
| 623 return true; | 623 return true; |
| 624 } | 624 } |
| 625 | 625 |
| 626 } // namespace chrome | 626 } // namespace chrome |
| 627 | 627 |
| OLD | NEW |