OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/task_manager/task_manager.h" | 5 #include "chrome/browser/task_manager/task_manager.h" |
6 | 6 |
7 #include "app/l10n_util.h" | 7 #include "app/l10n_util.h" |
8 #include "app/table_model_observer.h" | 8 #include "app/table_model_observer.h" |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
(...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
226 virtual bool ExecuteWindowsCommand(int command_id); | 226 virtual bool ExecuteWindowsCommand(int command_id); |
227 virtual std::wstring GetWindowTitle() const; | 227 virtual std::wstring GetWindowTitle() const; |
228 virtual std::wstring GetWindowName() const; | 228 virtual std::wstring GetWindowName() const; |
229 virtual int GetDialogButtons() const; | 229 virtual int GetDialogButtons() const; |
230 virtual void WindowClosing(); | 230 virtual void WindowClosing(); |
231 virtual views::View* GetContentsView(); | 231 virtual views::View* GetContentsView(); |
232 | 232 |
233 // views::TableViewObserver implementation. | 233 // views::TableViewObserver implementation. |
234 virtual void OnSelectionChanged(); | 234 virtual void OnSelectionChanged(); |
235 virtual void OnDoubleClick(); | 235 virtual void OnDoubleClick(); |
236 virtual void OnKeyDown(app::KeyboardCode keycode); | 236 virtual void OnKeyDown(ui::KeyboardCode keycode); |
237 | 237 |
238 // views::LinkController implementation. | 238 // views::LinkController implementation. |
239 virtual void LinkActivated(views::Link* source, int event_flags); | 239 virtual void LinkActivated(views::Link* source, int event_flags); |
240 | 240 |
241 // Called by the column picker to pick up any new stat counters that | 241 // Called by the column picker to pick up any new stat counters that |
242 // may have appeared since last time. | 242 // may have appeared since last time. |
243 void UpdateStatsCounters(); | 243 void UpdateStatsCounters(); |
244 | 244 |
245 // Menu::Delegate | 245 // Menu::Delegate |
246 virtual void ShowContextMenu(views::View* source, | 246 virtual void ShowContextMenu(views::View* source, |
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
377 tab_table_->SetContextMenuController(this); | 377 tab_table_->SetContextMenuController(this); |
378 SetContextMenuController(this); | 378 SetContextMenuController(this); |
379 // If we're running with --purge-memory-button, add a "Purge memory" button. | 379 // If we're running with --purge-memory-button, add a "Purge memory" button. |
380 if (CommandLine::ForCurrentProcess()->HasSwitch( | 380 if (CommandLine::ForCurrentProcess()->HasSwitch( |
381 switches::kPurgeMemoryButton)) { | 381 switches::kPurgeMemoryButton)) { |
382 purge_memory_button_ = new views::NativeButton(this, | 382 purge_memory_button_ = new views::NativeButton(this, |
383 UTF16ToWide(l10n_util::GetStringUTF16(IDS_TASK_MANAGER_PURGE_MEMORY))); | 383 UTF16ToWide(l10n_util::GetStringUTF16(IDS_TASK_MANAGER_PURGE_MEMORY))); |
384 } | 384 } |
385 kill_button_ = new views::NativeButton( | 385 kill_button_ = new views::NativeButton( |
386 this, UTF16ToWide(l10n_util::GetStringUTF16(IDS_TASK_MANAGER_KILL))); | 386 this, UTF16ToWide(l10n_util::GetStringUTF16(IDS_TASK_MANAGER_KILL))); |
387 kill_button_->AddAccelerator(views::Accelerator(app::VKEY_E, | 387 kill_button_->AddAccelerator(views::Accelerator(ui::VKEY_E, |
388 false, false, false)); | 388 false, false, false)); |
389 kill_button_->SetAccessibleKeyboardShortcut(L"E"); | 389 kill_button_->SetAccessibleKeyboardShortcut(L"E"); |
390 about_memory_link_ = new views::Link(UTF16ToWide( | 390 about_memory_link_ = new views::Link(UTF16ToWide( |
391 l10n_util::GetStringUTF16(IDS_TASK_MANAGER_ABOUT_MEMORY_LINK))); | 391 l10n_util::GetStringUTF16(IDS_TASK_MANAGER_ABOUT_MEMORY_LINK))); |
392 about_memory_link_->SetController(this); | 392 about_memory_link_->SetController(this); |
393 | 393 |
394 // Makes sure our state is consistent. | 394 // Makes sure our state is consistent. |
395 OnSelectionChanged(); | 395 OnSelectionChanged(); |
396 } | 396 } |
397 | 397 |
(...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
593 } | 593 } |
594 } | 594 } |
595 kill_button_->SetEnabled(!selection_contains_browser_process && | 595 kill_button_->SetEnabled(!selection_contains_browser_process && |
596 tab_table_->SelectedRowCount() > 0); | 596 tab_table_->SelectedRowCount() > 0); |
597 } | 597 } |
598 | 598 |
599 void TaskManagerView::OnDoubleClick() { | 599 void TaskManagerView::OnDoubleClick() { |
600 ActivateFocusedTab(); | 600 ActivateFocusedTab(); |
601 } | 601 } |
602 | 602 |
603 void TaskManagerView::OnKeyDown(app::KeyboardCode keycode) { | 603 void TaskManagerView::OnKeyDown(ui::KeyboardCode keycode) { |
604 if (keycode == app::VKEY_RETURN) | 604 if (keycode == ui::VKEY_RETURN) |
605 ActivateFocusedTab(); | 605 ActivateFocusedTab(); |
606 } | 606 } |
607 | 607 |
608 // views::LinkController implementation | 608 // views::LinkController implementation |
609 void TaskManagerView::LinkActivated(views::Link* source, int event_flags) { | 609 void TaskManagerView::LinkActivated(views::Link* source, int event_flags) { |
610 DCHECK(source == about_memory_link_); | 610 DCHECK(source == about_memory_link_); |
611 task_manager_->OpenAboutMemory(); | 611 task_manager_->OpenAboutMemory(); |
612 } | 612 } |
613 | 613 |
614 void TaskManagerView::ShowContextMenu(views::View* source, | 614 void TaskManagerView::ShowContextMenu(views::View* source, |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
696 } // namespace | 696 } // namespace |
697 | 697 |
698 namespace browser { | 698 namespace browser { |
699 | 699 |
700 // Declared in browser_dialogs.h so others don't need to depend on our header. | 700 // Declared in browser_dialogs.h so others don't need to depend on our header. |
701 void ShowTaskManager() { | 701 void ShowTaskManager() { |
702 TaskManagerView::Show(); | 702 TaskManagerView::Show(); |
703 } | 703 } |
704 | 704 |
705 } // namespace browser | 705 } // namespace browser |
OLD | NEW |