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 <algorithm> | 7 #include <algorithm> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
| 10 #include "base/command_line.h" |
10 #include "base/mac/bundle_locations.h" | 11 #include "base/mac/bundle_locations.h" |
11 #include "base/mac/mac_util.h" | 12 #include "base/mac/mac_util.h" |
12 #include "base/prefs/pref_service.h" | 13 #include "base/prefs/pref_service.h" |
13 #include "base/strings/sys_string_conversions.h" | 14 #include "base/strings/sys_string_conversions.h" |
14 #include "chrome/browser/browser_process.h" | 15 #include "chrome/browser/browser_process.h" |
| 16 #include "chrome/browser/ui/browser_dialogs.h" |
15 #import "chrome/browser/ui/cocoa/window_size_autosaver.h" | 17 #import "chrome/browser/ui/cocoa/window_size_autosaver.h" |
16 #include "chrome/browser/ui/host_desktop.h" | 18 #include "chrome/browser/ui/host_desktop.h" |
| 19 #include "chrome/common/chrome_switches.h" |
17 #include "chrome/common/pref_names.h" | 20 #include "chrome/common/pref_names.h" |
18 #include "chrome/grit/generated_resources.h" | 21 #include "chrome/grit/generated_resources.h" |
19 #include "third_party/skia/include/core/SkBitmap.h" | 22 #include "third_party/skia/include/core/SkBitmap.h" |
20 #include "ui/base/l10n/l10n_util_mac.h" | 23 #include "ui/base/l10n/l10n_util_mac.h" |
21 #include "ui/gfx/image/image_skia.h" | 24 #include "ui/gfx/image/image_skia.h" |
22 | 25 |
23 namespace { | 26 namespace { |
24 | 27 |
25 // Width of "a" and most other letters/digits in "small" table views. | 28 // Width of "a" and most other letters/digits in "small" table views. |
26 const int kCharWidth = 6; | 29 const int kCharWidth = 6; |
(...skipping 515 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
542 // static | 545 // static |
543 void TaskManagerMac::Hide() { | 546 void TaskManagerMac::Hide() { |
544 if (instance_) | 547 if (instance_) |
545 [instance_->window_controller_ close]; | 548 [instance_->window_controller_ close]; |
546 } | 549 } |
547 | 550 |
548 namespace chrome { | 551 namespace chrome { |
549 | 552 |
550 // Declared in browser_dialogs.h. | 553 // Declared in browser_dialogs.h. |
551 void ShowTaskManager(Browser* browser) { | 554 void ShowTaskManager(Browser* browser) { |
| 555 #if 0 && defined(TOOLKIT_VIEWS) |
| 556 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kUseToolkitViews)) { |
| 557 TaskManagerView::Show(browser); |
| 558 return; |
| 559 } |
| 560 #endif |
| 561 |
552 TaskManagerMac::Show(); | 562 TaskManagerMac::Show(); |
553 } | 563 } |
554 | 564 |
555 void HideTaskManager() { | 565 void HideTaskManager() { |
556 TaskManagerMac::Hide(); | 566 TaskManagerMac::Hide(); |
557 } | 567 } |
558 | 568 |
559 } // namespace chrome | 569 } // namespace chrome |
560 | |
OLD | NEW |