| 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/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/platform_util.h" | 10 #include "chrome/browser/platform_util.h" |
| 11 #include "chrome/browser/ui/browser.h" | 11 #include "chrome/browser/ui/browser.h" |
| 12 #include "chrome/browser/ui/browser_dialogs.h" | 12 #include "chrome/browser/ui/browser_dialogs.h" |
| 13 #include "chrome/browser/ui/browser_list.h" | 13 #include "chrome/browser/ui/browser_list.h" |
| 14 #include "chrome/browser/ui/dialog_style.h" |
| 14 #include "chrome/browser/ui/webui/html_dialog_ui.h" | 15 #include "chrome/browser/ui/webui/html_dialog_ui.h" |
| 15 #include "chrome/common/url_constants.h" | 16 #include "chrome/common/url_constants.h" |
| 16 #include "grit/google_chrome_strings.h" | 17 #include "grit/google_chrome_strings.h" |
| 17 #include "ui/base/l10n/l10n_util.h" | 18 #include "ui/base/l10n/l10n_util.h" |
| 18 | 19 |
| 19 #if defined(OS_CHROMEOS) | 20 #if defined(OS_CHROMEOS) |
| 20 #include "views/widget/widget.h" | 21 #include "views/widget/widget.h" |
| 21 #endif | 22 #endif |
| 22 | 23 |
| 23 using content::BrowserThread; | 24 using content::BrowserThread; |
| (...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 128 ++show_count_; | 129 ++show_count_; |
| 129 } | 130 } |
| 130 | 131 |
| 131 void TaskManagerDialogImpl::OnCloseDialog() { | 132 void TaskManagerDialogImpl::OnCloseDialog() { |
| 132 if (show_count_ > 0) | 133 if (show_count_ > 0) |
| 133 --show_count_; | 134 --show_count_; |
| 134 } | 135 } |
| 135 | 136 |
| 136 void TaskManagerDialogImpl::OpenHtmlDialog() { | 137 void TaskManagerDialogImpl::OpenHtmlDialog() { |
| 137 Browser* browser = BrowserList::GetLastActive(); | 138 Browser* browser = BrowserList::GetLastActive(); |
| 138 window_ = browser->BrowserShowHtmlDialog(this, NULL); | 139 window_ = browser->BrowserShowHtmlDialog(this, NULL, STYLE_GENERIC); |
| 139 } | 140 } |
| 140 | 141 |
| 141 // **************************************************** | 142 // **************************************************** |
| 142 // | 143 // |
| 143 // static | 144 // static |
| 144 void TaskManagerDialog::Show() { | 145 void TaskManagerDialog::Show() { |
| 145 BrowserThread::PostTask( | 146 BrowserThread::PostTask( |
| 146 BrowserThread::UI, FROM_HERE, | 147 BrowserThread::UI, FROM_HERE, |
| 147 base::Bind(&TaskManagerDialogImpl::Show, false)); | 148 base::Bind(&TaskManagerDialogImpl::Show, false)); |
| 148 } | 149 } |
| 149 | 150 |
| 150 // static | 151 // static |
| 151 void TaskManagerDialog::ShowBackgroundPages() { | 152 void TaskManagerDialog::ShowBackgroundPages() { |
| 152 BrowserThread::PostTask( | 153 BrowserThread::PostTask( |
| 153 BrowserThread::UI, FROM_HERE, | 154 BrowserThread::UI, FROM_HERE, |
| 154 base::Bind(&TaskManagerDialogImpl::Show, true)); | 155 base::Bind(&TaskManagerDialogImpl::Show, true)); |
| 155 } | 156 } |
| OLD | NEW |