| 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/chrome_notification_types.h" | 16 #include "chrome/browser/chrome_notification_types.h" |
| 17 #include "chrome/browser/task_manager/task_manager_interface.h" | 17 #include "chrome/browser/task_manager/task_manager_interface.h" |
| 18 #include "chrome/browser/ui/browser.h" | 18 #include "chrome/browser/ui/browser.h" |
| 19 #include "chrome/browser/ui/browser_dialogs.h" | 19 #include "chrome/browser/ui/browser_dialogs.h" |
| 20 #import "chrome/browser/ui/cocoa/window_size_autosaver.h" | 20 #import "chrome/browser/ui/cocoa/window_size_autosaver.h" |
| 21 #include "chrome/browser/ui/task_manager/task_manager_columns.h" | 21 #include "chrome/browser/ui/task_manager/task_manager_columns.h" |
| 22 #include "chrome/common/pref_names.h" | 22 #include "chrome/common/pref_names.h" |
| 23 #include "chrome/grit/generated_resources.h" | 23 #include "chrome/grit/generated_resources.h" |
| 24 #include "components/prefs/pref_service.h" | 24 #include "components/prefs/pref_service.h" |
| 25 #include "content/public/browser/notification_service.h" | 25 #include "content/public/browser/notification_service.h" |
| 26 #include "content/public/browser/notification_source.h" | 26 #include "content/public/browser/notification_source.h" |
| 27 #include "third_party/skia/include/core/SkBitmap.h" | 27 #include "third_party/skia/include/core/SkBitmap.h" |
| 28 #include "ui/base/l10n/l10n_util_mac.h" | 28 #include "ui/base/l10n/l10n_util_mac.h" |
| 29 #include "ui/base/material_design/material_design_controller.h" | |
| 30 #include "ui/gfx/image/image_skia.h" | 29 #include "ui/gfx/image/image_skia.h" |
| 31 #include "ui/gfx/image/image_skia_util_mac.h" | 30 #include "ui/gfx/image/image_skia_util_mac.h" |
| 32 | 31 |
| 33 namespace { | 32 namespace { |
| 34 | 33 |
| 35 NSString* ColumnIdentifier(int id) { | 34 NSString* ColumnIdentifier(int id) { |
| 36 return [NSString stringWithFormat:@"%d", id]; | 35 return [NSString stringWithFormat:@"%d", id]; |
| 37 } | 36 } |
| 38 | 37 |
| 39 } // namespace | 38 } // namespace |
| (...skipping 593 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 633 if (instance_) | 632 if (instance_) |
| 634 [instance_->window_controller_ close]; | 633 [instance_->window_controller_ close]; |
| 635 } | 634 } |
| 636 | 635 |
| 637 } // namespace task_manager | 636 } // namespace task_manager |
| 638 | 637 |
| 639 namespace chrome { | 638 namespace chrome { |
| 640 | 639 |
| 641 // Declared in browser_dialogs.h. | 640 // Declared in browser_dialogs.h. |
| 642 task_manager::TaskManagerTableModel* ShowTaskManager(Browser* browser) { | 641 task_manager::TaskManagerTableModel* ShowTaskManager(Browser* browser) { |
| 643 if (ui::MaterialDesignController::IsSecondaryUiMaterial()) | |
| 644 return chrome::ShowTaskManagerViews(browser); | |
| 645 | |
| 646 return task_manager::TaskManagerMac::Show(); | 642 return task_manager::TaskManagerMac::Show(); |
| 647 } | 643 } |
| 648 | 644 |
| 649 void HideTaskManager() { | 645 void HideTaskManager() { |
| 650 if (ui::MaterialDesignController::IsSecondaryUiMaterial()) { | |
| 651 chrome::HideTaskManagerViews(); | |
| 652 return; | |
| 653 } | |
| 654 | |
| 655 task_manager::TaskManagerMac::Hide(); | 646 task_manager::TaskManagerMac::Hide(); |
| 656 } | 647 } |
| 657 | 648 |
| 658 } // namespace chrome | 649 } // namespace chrome |
| OLD | NEW |