| 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 "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
| 9 #include "base/metrics/stats_table.h" | 9 #include "base/metrics/stats_table.h" |
| 10 #include "base/utf_string_conversions.h" | 10 #include "base/utf_string_conversions.h" |
| (...skipping 608 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 619 menu_info.cbSize = sizeof(MENUITEMINFO); | 619 menu_info.cbSize = sizeof(MENUITEMINFO); |
| 620 BOOL r = GetMenuItemInfo(system_menu, IDC_ALWAYS_ON_TOP, | 620 BOOL r = GetMenuItemInfo(system_menu, IDC_ALWAYS_ON_TOP, |
| 621 FALSE, &menu_info); | 621 FALSE, &menu_info); |
| 622 DCHECK(r); | 622 DCHECK(r); |
| 623 menu_info.fMask = MIIM_STATE; | 623 menu_info.fMask = MIIM_STATE; |
| 624 if (is_always_on_top_) | 624 if (is_always_on_top_) |
| 625 menu_info.fState = MFS_CHECKED; | 625 menu_info.fState = MFS_CHECKED; |
| 626 r = SetMenuItemInfo(system_menu, IDC_ALWAYS_ON_TOP, FALSE, &menu_info); | 626 r = SetMenuItemInfo(system_menu, IDC_ALWAYS_ON_TOP, FALSE, &menu_info); |
| 627 | 627 |
| 628 // Now change the actual window's behavior. | 628 // Now change the actual window's behavior. |
| 629 window()->SetAlwaysOnTop(is_always_on_top_); | 629 window()->SetIsAlwaysOnTop(is_always_on_top_); |
| 630 | 630 |
| 631 // Save the state. | 631 // Save the state. |
| 632 if (g_browser_process->local_state()) { | 632 if (g_browser_process->local_state()) { |
| 633 DictionaryPrefUpdate update(g_browser_process->local_state(), | 633 DictionaryPrefUpdate update(g_browser_process->local_state(), |
| 634 WideToUTF8(GetWindowName()).c_str()); | 634 WideToUTF8(GetWindowName()).c_str()); |
| 635 DictionaryValue* window_preferences = update.Get(); | 635 DictionaryValue* window_preferences = update.Get(); |
| 636 window_preferences->SetBoolean("always_on_top", is_always_on_top_); | 636 window_preferences->SetBoolean("always_on_top", is_always_on_top_); |
| 637 } | 637 } |
| 638 return true; | 638 return true; |
| 639 } | 639 } |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 711 return tab_table_->IsColumnVisible(id); | 711 return tab_table_->IsColumnVisible(id); |
| 712 } | 712 } |
| 713 | 713 |
| 714 void TaskManagerView::ExecuteCommand(int id) { | 714 void TaskManagerView::ExecuteCommand(int id) { |
| 715 tab_table_->SetColumnVisibility(id, !tab_table_->IsColumnVisible(id)); | 715 tab_table_->SetColumnVisibility(id, !tab_table_->IsColumnVisible(id)); |
| 716 } | 716 } |
| 717 | 717 |
| 718 void TaskManagerView::InitAlwaysOnTopState() { | 718 void TaskManagerView::InitAlwaysOnTopState() { |
| 719 is_always_on_top_ = false; | 719 is_always_on_top_ = false; |
| 720 if (GetSavedAlwaysOnTopState(&is_always_on_top_)) | 720 if (GetSavedAlwaysOnTopState(&is_always_on_top_)) |
| 721 window()->SetAlwaysOnTop(is_always_on_top_); | 721 window()->SetIsAlwaysOnTop(is_always_on_top_); |
| 722 AddAlwaysOnTopSystemMenuItem(); | 722 AddAlwaysOnTopSystemMenuItem(); |
| 723 } | 723 } |
| 724 | 724 |
| 725 void TaskManagerView::ActivateFocusedTab() { | 725 void TaskManagerView::ActivateFocusedTab() { |
| 726 int row_count = tab_table_->RowCount(); | 726 int row_count = tab_table_->RowCount(); |
| 727 for (int i = 0; i < row_count; ++i) { | 727 for (int i = 0; i < row_count; ++i) { |
| 728 if (tab_table_->ItemHasTheFocus(i)) { | 728 if (tab_table_->ItemHasTheFocus(i)) { |
| 729 task_manager_->ActivateProcess(i); | 729 task_manager_->ActivateProcess(i); |
| 730 break; | 730 break; |
| 731 } | 731 } |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 782 // Declared in browser_dialogs.h so others don't need to depend on our header. | 782 // Declared in browser_dialogs.h so others don't need to depend on our header. |
| 783 void ShowTaskManager() { | 783 void ShowTaskManager() { |
| 784 TaskManagerView::Show(false); | 784 TaskManagerView::Show(false); |
| 785 } | 785 } |
| 786 | 786 |
| 787 void ShowBackgroundPages() { | 787 void ShowBackgroundPages() { |
| 788 TaskManagerView::Show(true); | 788 TaskManagerView::Show(true); |
| 789 } | 789 } |
| 790 | 790 |
| 791 } // namespace browser | 791 } // namespace browser |
| OLD | NEW |