| Index: chrome/browser/ui/views/task_manager_view.cc
|
| diff --git a/chrome/browser/ui/views/task_manager_view.cc b/chrome/browser/ui/views/task_manager_view.cc
|
| index f49a4a2069e18dc2fdf8b35c920cb69bd9b2357f..cbf941cde1ce55c429dd957bfd6d7fd51e5439e7 100644
|
| --- a/chrome/browser/ui/views/task_manager_view.cc
|
| +++ b/chrome/browser/ui/views/task_manager_view.cc
|
| @@ -44,6 +44,10 @@
|
| #include "ui/views/widget/widget.h"
|
| #include "ui/views/window/dialog_delegate.h"
|
|
|
| +#if defined(USE_ASH)
|
| +#include "ash/wm/window_util.h"
|
| +#endif
|
| +
|
| #if defined(OS_WIN)
|
| #include "win8/util/win8_util.h"
|
| #endif
|
| @@ -531,7 +535,10 @@ void TaskManagerView::Show(bool highlight_background_resources,
|
| // In Windows Metro it's not good to open this native window.
|
| DCHECK(!win8::IsSingleWindowMetroMode());
|
| #endif
|
| - const chrome::HostDesktopType desktop_type = browser->host_desktop_type();
|
| + // In ash we can come here through the ChromeShellDelegate. If there is no
|
| + // browser window at that time of the call, browser could be passed as NULL.
|
| + const chrome::HostDesktopType desktop_type =
|
| + browser ? browser->host_desktop_type() : chrome::HOST_DESKTOP_TYPE_ASH;
|
|
|
| if (instance_) {
|
| if (instance_->highlight_background_resources_ !=
|
| @@ -545,8 +552,13 @@ void TaskManagerView::Show(bool highlight_background_resources,
|
| }
|
| }
|
| instance_ = new TaskManagerView(highlight_background_resources, desktop_type);
|
| - DialogDelegateView::CreateDialogWidget(instance_,
|
| - browser->window()->GetNativeWindow(), NULL);
|
| + gfx::NativeWindow window =
|
| + browser ? browser->window()->GetNativeWindow() : NULL;
|
| +#if defined(USE_ASH)
|
| + if (!window)
|
| + window = ash::wm::GetActiveWindow();
|
| +#endif
|
| + DialogDelegateView::CreateDialogWidget(instance_, window, NULL);
|
| instance_->InitAlwaysOnTopState();
|
| instance_->model_->StartUpdating();
|
| instance_->GetWidget()->Show();
|
| @@ -763,12 +775,8 @@ bool TaskManagerView::GetSavedAlwaysOnTopState(bool* always_on_top) const {
|
| namespace chrome {
|
|
|
| // Declared in browser_dialogs.h so others don't need to depend on our header.
|
| -void ShowTaskManager(Browser* browser) {
|
| - TaskManagerView::Show(false, browser);
|
| -}
|
| -
|
| -void ShowBackgroundPages(Browser* browser) {
|
| - TaskManagerView::Show(true, browser);
|
| +void ShowTaskManager(Browser* browser, bool highlight_background_resources) {
|
| + TaskManagerView::Show(highlight_background_resources, browser);
|
| }
|
|
|
| } // namespace chrome
|
|
|