| 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> |
| 11 | 11 |
| 12 #include "base/mac/bundle_locations.h" | 12 #include "base/mac/bundle_locations.h" |
| 13 #include "base/macros.h" | 13 #include "base/macros.h" |
| 14 #include "base/strings/sys_string_conversions.h" | 14 #include "base/strings/sys_string_conversions.h" |
| 15 #include "chrome/browser/browser_process.h" | 15 #include "chrome/browser/browser_process.h" |
| 16 #include "chrome/browser/task_management/task_manager_interface.h" |
| 17 #include "chrome/browser/task_manager/task_manager.h" |
| 16 #include "chrome/browser/ui/browser.h" | 18 #include "chrome/browser/ui/browser.h" |
| 17 #include "chrome/browser/ui/browser_dialogs.h" | 19 #include "chrome/browser/ui/browser_dialogs.h" |
| 18 #import "chrome/browser/ui/cocoa/window_size_autosaver.h" | 20 #import "chrome/browser/ui/cocoa/window_size_autosaver.h" |
| 19 #include "chrome/common/pref_names.h" | 21 #include "chrome/common/pref_names.h" |
| 20 #include "chrome/grit/generated_resources.h" | 22 #include "chrome/grit/generated_resources.h" |
| 21 #include "components/prefs/pref_service.h" | 23 #include "components/prefs/pref_service.h" |
| 22 #include "third_party/skia/include/core/SkBitmap.h" | 24 #include "third_party/skia/include/core/SkBitmap.h" |
| 23 #include "ui/base/l10n/l10n_util_mac.h" | 25 #include "ui/base/l10n/l10n_util_mac.h" |
| 24 #include "ui/gfx/image/image_skia.h" | 26 #include "ui/gfx/image/image_skia.h" |
| 25 | 27 |
| (...skipping 380 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 406 | 408 |
| 407 TaskManagerModel::GroupRange rangePair = | 409 TaskManagerModel::GroupRange rangePair = |
| 408 model_->GetGroupRangeForResource(modelIndex); | 410 model_->GetGroupRangeForResource(modelIndex); |
| 409 NSMutableIndexSet* indexSet = [NSMutableIndexSet indexSet]; | 411 NSMutableIndexSet* indexSet = [NSMutableIndexSet indexSet]; |
| 410 for (int j = 0; j < rangePair.second; ++j) | 412 for (int j = 0; j < rangePair.second; ++j) |
| 411 [indexSet addIndex:modelToViewMap_[rangePair.first + j]]; | 413 [indexSet addIndex:modelToViewMap_[rangePair.first + j]]; |
| 412 [tableView_ selectRowIndexes:indexSet byExtendingSelection:YES]; | 414 [tableView_ selectRowIndexes:indexSet byExtendingSelection:YES]; |
| 413 } | 415 } |
| 414 | 416 |
| 415 bool enabled = [selection count] > 0 && !selectionContainsBrowserProcess && | 417 bool enabled = [selection count] > 0 && !selectionContainsBrowserProcess && |
| 416 TaskManager::IsEndProcessEnabled(); | 418 task_management::TaskManagerInterface::IsEndProcessEnabled(); |
| 417 [endProcessButton_ setEnabled:enabled]; | 419 [endProcessButton_ setEnabled:enabled]; |
| 418 } | 420 } |
| 419 | 421 |
| 420 - (void)deselectRows { | 422 - (void)deselectRows { |
| 421 [tableView_ deselectAll:self]; | 423 [tableView_ deselectAll:self]; |
| 422 } | 424 } |
| 423 | 425 |
| 424 // Table view delegate methods. | 426 // Table view delegate methods. |
| 425 | 427 |
| 426 // The selection is being changed by mouse (drag/click). | 428 // The selection is being changed by mouse (drag/click). |
| (...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 605 | 607 |
| 606 void HideTaskManager() { | 608 void HideTaskManager() { |
| 607 if (chrome::ToolkitViewsDialogsEnabled()) { | 609 if (chrome::ToolkitViewsDialogsEnabled()) { |
| 608 chrome::HideTaskManagerViews(); | 610 chrome::HideTaskManagerViews(); |
| 609 return; | 611 return; |
| 610 } | 612 } |
| 611 | 613 |
| 612 TaskManagerMac::Hide(); | 614 TaskManagerMac::Hide(); |
| 613 } | 615 } |
| 614 | 616 |
| 617 bool NotifyOldTaskManagerBytesRead(const net::URLRequest& request, |
| 618 int64_t bytes_read) { |
| 619 if (task_management::TaskManagerInterface::IsNewTaskManagerEnabled()) |
| 620 return false; |
| 621 |
| 622 TaskManager::GetInstance()->model()->NotifyBytesRead(request, bytes_read); |
| 623 return true; |
| 624 } |
| 625 |
| 615 } // namespace chrome | 626 } // namespace chrome |
| 616 | 627 |
| OLD | NEW |