OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 "app/l10n_util_mac.h" | 10 #include "app/l10n_util_mac.h" |
11 #include "base/mac_util.h" | 11 #include "base/mac/mac_util.h" |
12 #include "base/sys_string_conversions.h" | 12 #include "base/sys_string_conversions.h" |
13 #include "chrome/browser/browser_process.h" | 13 #include "chrome/browser/browser_process.h" |
14 #import "chrome/browser/ui/cocoa/window_size_autosaver.h" | 14 #import "chrome/browser/ui/cocoa/window_size_autosaver.h" |
15 #include "chrome/common/pref_names.h" | 15 #include "chrome/common/pref_names.h" |
16 #include "grit/generated_resources.h" | 16 #include "grit/generated_resources.h" |
17 #include "third_party/skia/include/core/SkBitmap.h" | 17 #include "third_party/skia/include/core/SkBitmap.h" |
18 | 18 |
19 namespace { | 19 namespace { |
20 | 20 |
21 // Width of "a" and most other letters/digits in "small" table views. | 21 // Width of "a" and most other letters/digits in "small" table views. |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
96 - (void)adjustSelectionAndEndProcessButton; | 96 - (void)adjustSelectionAndEndProcessButton; |
97 - (void)deselectRows; | 97 - (void)deselectRows; |
98 @end | 98 @end |
99 | 99 |
100 //////////////////////////////////////////////////////////////////////////////// | 100 //////////////////////////////////////////////////////////////////////////////// |
101 // TaskManagerWindowController implementation: | 101 // TaskManagerWindowController implementation: |
102 | 102 |
103 @implementation TaskManagerWindowController | 103 @implementation TaskManagerWindowController |
104 | 104 |
105 - (id)initWithTaskManagerObserver:(TaskManagerMac*)taskManagerObserver { | 105 - (id)initWithTaskManagerObserver:(TaskManagerMac*)taskManagerObserver { |
106 NSString* nibpath = [mac_util::MainAppBundle() | 106 NSString* nibpath = [base::mac::MainAppBundle() |
107 pathForResource:@"TaskManager" | 107 pathForResource:@"TaskManager" |
108 ofType:@"nib"]; | 108 ofType:@"nib"]; |
109 if ((self = [super initWithWindowNibPath:nibpath owner:self])) { | 109 if ((self = [super initWithWindowNibPath:nibpath owner:self])) { |
110 taskManagerObserver_ = taskManagerObserver; | 110 taskManagerObserver_ = taskManagerObserver; |
111 taskManager_ = taskManagerObserver_->task_manager(); | 111 taskManager_ = taskManagerObserver_->task_manager(); |
112 model_ = taskManager_->model(); | 112 model_ = taskManager_->model(); |
113 | 113 |
114 if (g_browser_process && g_browser_process->local_state()) { | 114 if (g_browser_process && g_browser_process->local_state()) { |
115 size_saver_.reset([[WindowSizeAutosaver alloc] | 115 size_saver_.reset([[WindowSizeAutosaver alloc] |
116 initWithWindow:[self window] | 116 initWithWindow:[self window] |
(...skipping 456 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
573 void TaskManagerMac::Show() { | 573 void TaskManagerMac::Show() { |
574 if (instance_) { | 574 if (instance_) { |
575 // If there's a Task manager window open already, just activate it. | 575 // If there's a Task manager window open already, just activate it. |
576 [[instance_->window_controller_ window] | 576 [[instance_->window_controller_ window] |
577 makeKeyAndOrderFront:instance_->window_controller_]; | 577 makeKeyAndOrderFront:instance_->window_controller_]; |
578 } else { | 578 } else { |
579 instance_ = new TaskManagerMac(TaskManager::GetInstance()); | 579 instance_ = new TaskManagerMac(TaskManager::GetInstance()); |
580 instance_->model_->StartUpdating(); | 580 instance_->model_->StartUpdating(); |
581 } | 581 } |
582 } | 582 } |
OLD | NEW |