| 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/ui/webui/task_manager_dialog.h" | 5 #include "chrome/browser/ui/webui/task_manager_dialog.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/memory/singleton.h" | 8 #include "base/memory/singleton.h" |
| 9 #include "base/utf_string_conversions.h" | 9 #include "base/utf_string_conversions.h" |
| 10 #include "chrome/browser/browser_process.h" | 10 #include "chrome/browser/browser_process.h" |
| (...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 87 virtual void OnDialogClosed(const std::string& json_retval) OVERRIDE { | 87 virtual void OnDialogClosed(const std::string& json_retval) OVERRIDE { |
| 88 OnCloseDialog(); | 88 OnCloseDialog(); |
| 89 } | 89 } |
| 90 virtual void OnCloseContents(WebContents* source, bool* out_close_dialog) | 90 virtual void OnCloseContents(WebContents* source, bool* out_close_dialog) |
| 91 OVERRIDE { | 91 OVERRIDE { |
| 92 *out_close_dialog = true; | 92 *out_close_dialog = true; |
| 93 } | 93 } |
| 94 virtual bool ShouldShowDialogTitle() const OVERRIDE { | 94 virtual bool ShouldShowDialogTitle() const OVERRIDE { |
| 95 return false; | 95 return false; |
| 96 } | 96 } |
| 97 virtual bool HandleContextMenu(const ContextMenuParams& params) OVERRIDE { | 97 virtual bool HandleContextMenu( |
| 98 const content::ContextMenuParams& params) OVERRIDE { |
| 98 return true; | 99 return true; |
| 99 } | 100 } |
| 100 virtual void StoreDialogSize(const gfx::Size& dialog_size) OVERRIDE { | 101 virtual void StoreDialogSize(const gfx::Size& dialog_size) OVERRIDE { |
| 101 // Store the dialog's bounds so that it can be restored with the same bounds | 102 // Store the dialog's bounds so that it can be restored with the same bounds |
| 102 // the next time it's opened. | 103 // the next time it's opened. |
| 103 if (g_browser_process->local_state()) { | 104 if (g_browser_process->local_state()) { |
| 104 DictionaryPrefUpdate update(g_browser_process->local_state(), | 105 DictionaryPrefUpdate update(g_browser_process->local_state(), |
| 105 prefs::kTaskManagerWindowPlacement); | 106 prefs::kTaskManagerWindowPlacement); |
| 106 DictionaryValue* placement_pref = update.Get(); | 107 DictionaryValue* placement_pref = update.Get(); |
| 107 placement_pref->SetInteger("width", dialog_size.width()); | 108 placement_pref->SetInteger("width", dialog_size.width()); |
| (...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 185 BrowserThread::UI, FROM_HERE, | 186 BrowserThread::UI, FROM_HERE, |
| 186 base::Bind(&TaskManagerDialogImpl::Show, false)); | 187 base::Bind(&TaskManagerDialogImpl::Show, false)); |
| 187 } | 188 } |
| 188 | 189 |
| 189 // static | 190 // static |
| 190 void TaskManagerDialog::ShowBackgroundPages() { | 191 void TaskManagerDialog::ShowBackgroundPages() { |
| 191 BrowserThread::PostTask( | 192 BrowserThread::PostTask( |
| 192 BrowserThread::UI, FROM_HERE, | 193 BrowserThread::UI, FROM_HERE, |
| 193 base::Bind(&TaskManagerDialogImpl::Show, true)); | 194 base::Bind(&TaskManagerDialogImpl::Show, true)); |
| 194 } | 195 } |
| OLD | NEW |