| 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/task_manager/task_manager.h" | 5 #include "chrome/browser/task_manager/task_manager.h" |
| 6 | 6 |
| 7 #include "base/compiler_specific.h" | 7 #include "base/compiler_specific.h" |
| 8 #include "base/metrics/stats_table.h" | 8 #include "base/metrics/stats_table.h" |
| 9 #include "base/prefs/pref_service.h" | 9 #include "base/prefs/pref_service.h" |
| 10 #include "base/prefs/scoped_user_pref_update.h" | 10 #include "base/prefs/scoped_user_pref_update.h" |
| (...skipping 23 matching lines...) Expand all Loading... |
| 34 #include "ui/views/controls/link_listener.h" | 34 #include "ui/views/controls/link_listener.h" |
| 35 #include "ui/views/controls/menu/menu_runner.h" | 35 #include "ui/views/controls/menu/menu_runner.h" |
| 36 #include "ui/views/controls/table/table_grouper.h" | 36 #include "ui/views/controls/table/table_grouper.h" |
| 37 #include "ui/views/controls/table/table_view.h" | 37 #include "ui/views/controls/table/table_view.h" |
| 38 #include "ui/views/controls/table/table_view_observer.h" | 38 #include "ui/views/controls/table/table_view_observer.h" |
| 39 #include "ui/views/layout/layout_constants.h" | 39 #include "ui/views/layout/layout_constants.h" |
| 40 #include "ui/views/widget/widget.h" | 40 #include "ui/views/widget/widget.h" |
| 41 #include "ui/views/window/dialog_delegate.h" | 41 #include "ui/views/window/dialog_delegate.h" |
| 42 | 42 |
| 43 #if defined(USE_ASH) | 43 #if defined(USE_ASH) |
| 44 #include "ash/shelf/shelf_util.h" |
| 44 #include "ash/wm/window_util.h" | 45 #include "ash/wm/window_util.h" |
| 45 #include "chrome/browser/ui/ash/launcher/launcher_item_util.h" | |
| 46 #include "grit/ash_resources.h" | 46 #include "grit/ash_resources.h" |
| 47 #endif | 47 #endif |
| 48 | 48 |
| 49 #if defined(OS_WIN) | 49 #if defined(OS_WIN) |
| 50 #include "chrome/browser/shell_integration.h" | 50 #include "chrome/browser/shell_integration.h" |
| 51 #include "ui/base/win/shell.h" | 51 #include "ui/base/win/shell.h" |
| 52 #include "ui/views/win/hwnd_util.h" | 52 #include "ui/views/win/hwnd_util.h" |
| 53 #endif | 53 #endif |
| 54 | 54 |
| 55 namespace { | 55 namespace { |
| (...skipping 433 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 489 } | 489 } |
| 490 #endif | 490 #endif |
| 491 instance_->GetWidget()->Show(); | 491 instance_->GetWidget()->Show(); |
| 492 | 492 |
| 493 // Set the initial focus to the list of tasks. | 493 // Set the initial focus to the list of tasks. |
| 494 views::FocusManager* focus_manager = instance_->GetFocusManager(); | 494 views::FocusManager* focus_manager = instance_->GetFocusManager(); |
| 495 if (focus_manager) | 495 if (focus_manager) |
| 496 focus_manager->SetFocusedView(instance_->tab_table_); | 496 focus_manager->SetFocusedView(instance_->tab_table_); |
| 497 | 497 |
| 498 #if defined(USE_ASH) | 498 #if defined(USE_ASH) |
| 499 CreateShelfItemForDialog(IDR_ASH_SHELF_ICON_TASK_MANAGER, | 499 ash::SetShelfItemDetailsForDialogWindow( |
| 500 instance_->GetWidget()->GetNativeWindow()); | 500 instance_->GetWidget()->GetNativeWindow(), |
| 501 IDR_ASH_SHELF_ICON_TASK_MANAGER); |
| 501 #endif | 502 #endif |
| 502 } | 503 } |
| 503 | 504 |
| 504 // ButtonListener implementation. | 505 // ButtonListener implementation. |
| 505 void TaskManagerView::ButtonPressed( | 506 void TaskManagerView::ButtonPressed( |
| 506 views::Button* sender, | 507 views::Button* sender, |
| 507 const ui::Event& event) { | 508 const ui::Event& event) { |
| 508 typedef ui::ListSelectionModel::SelectedIndices SelectedIndices; | 509 typedef ui::ListSelectionModel::SelectedIndices SelectedIndices; |
| 509 DCHECK_EQ(kill_button_, sender); | 510 DCHECK_EQ(kill_button_, sender); |
| 510 SelectedIndices selection(tab_table_->selection_model().selected_indices()); | 511 SelectedIndices selection(tab_table_->selection_model().selected_indices()); |
| (...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 645 } // namespace | 646 } // namespace |
| 646 | 647 |
| 647 namespace chrome { | 648 namespace chrome { |
| 648 | 649 |
| 649 // Declared in browser_dialogs.h so others don't need to depend on our header. | 650 // Declared in browser_dialogs.h so others don't need to depend on our header. |
| 650 void ShowTaskManager(Browser* browser) { | 651 void ShowTaskManager(Browser* browser) { |
| 651 TaskManagerView::Show(browser); | 652 TaskManagerView::Show(browser); |
| 652 } | 653 } |
| 653 | 654 |
| 654 } // namespace chrome | 655 } // namespace chrome |
| OLD | NEW |