Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3283)

Unified Diff: chrome/browser/ui/views/task_manager_view.cc

Issue 12712018: Fixing problem with incomplete browser windows showing up after task manager was used (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Removed again. Done. Created 7 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/ui/views/frame/browser_view.cc ('k') | chrome/test/base/test_browser_window.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
« no previous file with comments | « chrome/browser/ui/views/frame/browser_view.cc ('k') | chrome/test/base/test_browser_window.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698