| 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 604 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 615 menu_info.fMask = MIIM_STATE; | 615 menu_info.fMask = MIIM_STATE; |
| 616 if (is_always_on_top_) | 616 if (is_always_on_top_) |
| 617 menu_info.fState = MFS_CHECKED; | 617 menu_info.fState = MFS_CHECKED; |
| 618 r = SetMenuItemInfo(system_menu, IDC_ALWAYS_ON_TOP, FALSE, &menu_info); | 618 r = SetMenuItemInfo(system_menu, IDC_ALWAYS_ON_TOP, FALSE, &menu_info); |
| 619 | 619 |
| 620 // Now change the actual window's behavior. | 620 // Now change the actual window's behavior. |
| 621 window()->SetIsAlwaysOnTop(is_always_on_top_); | 621 window()->SetIsAlwaysOnTop(is_always_on_top_); |
| 622 | 622 |
| 623 // Save the state. | 623 // Save the state. |
| 624 if (g_browser_process->local_state()) { | 624 if (g_browser_process->local_state()) { |
| 625 DictionaryValue* window_preferences = | 625 DictionaryPrefsUpdate update(g_browser_process->local_state(), |
| 626 g_browser_process->local_state()->GetMutableDictionary( | 626 WideToUTF8(GetWindowName()).c_str()); |
| 627 WideToUTF8(GetWindowName()).c_str()); | 627 DictionaryValue* window_preferences = update.GetMutableValue(); |
| 628 window_preferences->SetBoolean("always_on_top", is_always_on_top_); | 628 window_preferences->SetBoolean("always_on_top", is_always_on_top_); |
| 629 } | 629 } |
| 630 return true; | 630 return true; |
| 631 } | 631 } |
| 632 return false; | 632 return false; |
| 633 } | 633 } |
| 634 | 634 |
| 635 std::wstring TaskManagerView::GetWindowTitle() const { | 635 std::wstring TaskManagerView::GetWindowTitle() const { |
| 636 return UTF16ToWide(l10n_util::GetStringUTF16(IDS_TASK_MANAGER_TITLE)); | 636 return UTF16ToWide(l10n_util::GetStringUTF16(IDS_TASK_MANAGER_TITLE)); |
| 637 } | 637 } |
| (...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 772 // Declared in browser_dialogs.h so others don't need to depend on our header. | 772 // Declared in browser_dialogs.h so others don't need to depend on our header. |
| 773 void ShowTaskManager() { | 773 void ShowTaskManager() { |
| 774 TaskManagerView::Show(false); | 774 TaskManagerView::Show(false); |
| 775 } | 775 } |
| 776 | 776 |
| 777 void ShowBackgroundPages() { | 777 void ShowBackgroundPages() { |
| 778 TaskManagerView::Show(true); | 778 TaskManagerView::Show(true); |
| 779 } | 779 } |
| 780 | 780 |
| 781 } // namespace browser | 781 } // namespace browser |
| OLD | NEW |