OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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.h" | 5 #include "chrome/browser/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/stats_table.h" | 9 #include "base/stats_table.h" |
10 #include "chrome/app/chrome_dll_resource.h" | 10 #include "chrome/app/chrome_dll_resource.h" |
11 #include "chrome/browser/browser_list.h" | 11 #include "chrome/browser/browser_list.h" |
12 #include "chrome/browser/browser_process.h" | 12 #include "chrome/browser/browser_process.h" |
13 #include "chrome/browser/browser_window.h" | 13 #include "chrome/browser/browser_window.h" |
14 #include "chrome/browser/views/browser_dialogs.h" | 14 #include "chrome/browser/views/browser_dialogs.h" |
15 #include "chrome/common/pref_names.h" | 15 #include "chrome/common/pref_names.h" |
16 #include "chrome/common/pref_service.h" | 16 #include "chrome/common/pref_service.h" |
| 17 #include "chrome/common/url_constants.h" |
17 #include "grit/chromium_strings.h" | 18 #include "grit/chromium_strings.h" |
18 #include "grit/generated_resources.h" | 19 #include "grit/generated_resources.h" |
19 #include "grit/theme_resources.h" | 20 #include "grit/theme_resources.h" |
20 #include "views/accelerator.h" | 21 #include "views/accelerator.h" |
21 #include "views/background.h" | 22 #include "views/background.h" |
22 #include "views/controls/button/native_button.h" | 23 #include "views/controls/button/native_button.h" |
23 #include "views/controls/link.h" | 24 #include "views/controls/link.h" |
24 #include "views/controls/menu/menu.h" | 25 #include "views/controls/menu/menu.h" |
25 #include "views/controls/table/group_table_view.h" | 26 #include "views/controls/table/group_table_view.h" |
26 #include "views/controls/table/table_view_observer.h" | 27 #include "views/controls/table/table_view_observer.h" |
(...skipping 485 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
512 void TaskManagerView::OnKeyDown(unsigned short virtual_keycode) { | 513 void TaskManagerView::OnKeyDown(unsigned short virtual_keycode) { |
513 if (virtual_keycode == VK_RETURN) | 514 if (virtual_keycode == VK_RETURN) |
514 ActivateFocusedTab(); | 515 ActivateFocusedTab(); |
515 } | 516 } |
516 | 517 |
517 // views::LinkController implementation | 518 // views::LinkController implementation |
518 void TaskManagerView::LinkActivated(views::Link* source, int event_flags) { | 519 void TaskManagerView::LinkActivated(views::Link* source, int event_flags) { |
519 DCHECK(source == about_memory_link_); | 520 DCHECK(source == about_memory_link_); |
520 Browser* browser = BrowserList::GetLastActive(); | 521 Browser* browser = BrowserList::GetLastActive(); |
521 DCHECK(browser); | 522 DCHECK(browser); |
522 browser->OpenURL(GURL("about:memory"), GURL(), NEW_FOREGROUND_TAB, | 523 browser->OpenURL(GURL(chrome::kAboutMemoryURL), GURL(), NEW_FOREGROUND_TAB, |
523 PageTransition::LINK); | 524 PageTransition::LINK); |
524 // In case the browser window is minimzed, show it. If this is an application | 525 // In case the browser window is minimzed, show it. If this is an application |
525 // or popup, we can only have one tab, hence we need to process this in a | 526 // or popup, we can only have one tab, hence we need to process this in a |
526 // tabbed browser window. Currently, |browser| is pointing to the application, | 527 // tabbed browser window. Currently, |browser| is pointing to the application, |
527 // popup window. Therefore, we have to retrieve the last active tab again, | 528 // popup window. Therefore, we have to retrieve the last active tab again, |
528 // since a new window has been used. | 529 // since a new window has been used. |
529 if (browser->type() & Browser::TYPE_APP_POPUP) { | 530 if (browser->type() & Browser::TYPE_APP_POPUP) { |
530 browser = BrowserList::GetLastActive(); | 531 browser = BrowserList::GetLastActive(); |
531 DCHECK(browser); | 532 DCHECK(browser); |
532 } | 533 } |
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
615 | 616 |
616 namespace browser { | 617 namespace browser { |
617 | 618 |
618 // Declared in browser_dialogs.h so others don't need to depend on our header. | 619 // Declared in browser_dialogs.h so others don't need to depend on our header. |
619 void ShowTaskManager() { | 620 void ShowTaskManager() { |
620 TaskManagerView::Show(); | 621 TaskManagerView::Show(); |
621 } | 622 } |
622 | 623 |
623 } // namespace browser | 624 } // namespace browser |
624 | 625 |
OLD | NEW |