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 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
154 public ui::SimpleMenuModel::Delegate { | 154 public ui::SimpleMenuModel::Delegate { |
155 public: | 155 public: |
156 explicit TaskManagerView(chrome::HostDesktopType desktop_type); | 156 explicit TaskManagerView(chrome::HostDesktopType desktop_type); |
157 virtual ~TaskManagerView(); | 157 virtual ~TaskManagerView(); |
158 | 158 |
159 // Shows the Task manager window, or re-activates an existing one. | 159 // Shows the Task manager window, or re-activates an existing one. |
160 static void Show(Browser* browser); | 160 static void Show(Browser* browser); |
161 | 161 |
162 // views::View: | 162 // views::View: |
163 virtual void Layout() OVERRIDE; | 163 virtual void Layout() OVERRIDE; |
164 virtual gfx::Size GetPreferredSize() OVERRIDE; | 164 virtual gfx::Size GetPreferredSize() const OVERRIDE; |
165 virtual bool AcceleratorPressed(const ui::Accelerator& accelerator) OVERRIDE; | 165 virtual bool AcceleratorPressed(const ui::Accelerator& accelerator) OVERRIDE; |
166 virtual void ViewHierarchyChanged( | 166 virtual void ViewHierarchyChanged( |
167 const ViewHierarchyChangedDetails& details) OVERRIDE; | 167 const ViewHierarchyChangedDetails& details) OVERRIDE; |
168 | 168 |
169 // views::ButtonListener: | 169 // views::ButtonListener: |
170 virtual void ButtonPressed(views::Button* sender, | 170 virtual void ButtonPressed(views::Button* sender, |
171 const ui::Event& event) OVERRIDE; | 171 const ui::Event& event) OVERRIDE; |
172 | 172 |
173 // views::DialogDelegateView: | 173 // views::DialogDelegateView: |
174 virtual bool CanResize() const OVERRIDE; | 174 virtual bool CanResize() const OVERRIDE; |
(...skipping 265 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
440 y_buttons + (kill_button_->height() - size.height()) / 2, | 440 y_buttons + (kill_button_->height() - size.height()) / 2, |
441 size.width(), size.height()); | 441 size.width(), size.height()); |
442 | 442 |
443 gfx::Rect rect = GetLocalBounds(); | 443 gfx::Rect rect = GetLocalBounds(); |
444 rect.Inset(horizontal_margin, views::kPanelVertMargin); | 444 rect.Inset(horizontal_margin, views::kPanelVertMargin); |
445 rect.Inset(0, 0, 0, | 445 rect.Inset(0, 0, 0, |
446 kill_button_->height() + views::kUnrelatedControlVerticalSpacing); | 446 kill_button_->height() + views::kUnrelatedControlVerticalSpacing); |
447 tab_table_parent_->SetBoundsRect(rect); | 447 tab_table_parent_->SetBoundsRect(rect); |
448 } | 448 } |
449 | 449 |
450 gfx::Size TaskManagerView::GetPreferredSize() { | 450 gfx::Size TaskManagerView::GetPreferredSize() const { |
451 return gfx::Size(460, 270); | 451 return gfx::Size(460, 270); |
452 } | 452 } |
453 | 453 |
454 bool TaskManagerView::AcceleratorPressed(const ui::Accelerator& accelerator) { | 454 bool TaskManagerView::AcceleratorPressed(const ui::Accelerator& accelerator) { |
455 DCHECK_EQ(ui::VKEY_W, accelerator.key_code()); | 455 DCHECK_EQ(ui::VKEY_W, accelerator.key_code()); |
456 DCHECK_EQ(ui::EF_CONTROL_DOWN, accelerator.modifiers()); | 456 DCHECK_EQ(ui::EF_CONTROL_DOWN, accelerator.modifiers()); |
457 GetWidget()->Close(); | 457 GetWidget()->Close(); |
458 return true; | 458 return true; |
459 } | 459 } |
460 | 460 |
(...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
648 } // namespace | 648 } // namespace |
649 | 649 |
650 namespace chrome { | 650 namespace chrome { |
651 | 651 |
652 // Declared in browser_dialogs.h so others don't need to depend on our header. | 652 // Declared in browser_dialogs.h so others don't need to depend on our header. |
653 void ShowTaskManager(Browser* browser) { | 653 void ShowTaskManager(Browser* browser) { |
654 TaskManagerView::Show(browser); | 654 TaskManagerView::Show(browser); |
655 } | 655 } |
656 | 656 |
657 } // namespace chrome | 657 } // namespace chrome |
OLD | NEW |