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

Issue 12712018: Fixing problem with incomplete browser windows showing up after task manager was used (Closed)

Created:
7 years, 9 months ago by Mr4D (OOO till 08-26)
Modified:
7 years, 9 months ago
Reviewers:
sky
CC:
chromium-reviews, sadrul, ben+watch_chromium.org
Visibility:
Public.

Description

Fixing problem with a tabless browser windows showing up after a task manager was used I traced it down to the creation of the task manager which grabs an existing (or new) browser. It requires the browser only for two things: determining the system it is running in and for giving the created web dialog a context (a window which is used (by Aura only) to position the window within the hierarchy. As I can see it there are no other dependencies to the browser and it can be disposed of after the task manager was created (and there are no tabs in the tabbed browser). BUG=176670 TEST=visual Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=189579

Patch Set 1 #

Patch Set 2 : Refactored the ShowTaskManager function is requested #

Total comments: 11

Patch Set 3 : Addressed and fixed build problems #

Total comments: 3

Patch Set 4 : Removed again. Done. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+51 lines, -73 lines) Patch
M chrome/browser/extensions/api/processes/processes_apitest.cc View 1 2 2 chunks +2 lines, -1 line 0 comments Download
M chrome/browser/prerender/prerender_browsertest.cc View 1 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/task_manager/task_manager_browsertest.cc View 1 2 chunks +2 lines, -1 line 0 comments Download
M chrome/browser/task_manager/task_manager_browsertest_util.h View 1 2 1 chunk +0 lines, -1 line 0 comments Download
M chrome/browser/task_manager/task_manager_browsertest_util.cc View 1 2 2 chunks +1 line, -7 lines 0 comments Download
M chrome/browser/task_manager/task_manager_notification_browsertest.cc View 1 2 2 chunks +2 lines, -1 line 0 comments Download
M chrome/browser/ui/ash/chrome_shell_delegate.cc View 1 3 1 chunk +1 line, -4 lines 0 comments Download
M chrome/browser/ui/browser_commands.cc View 1 2 chunks +2 lines, -4 lines 0 comments Download
M chrome/browser/ui/browser_dialogs.h View 1 1 chunk +4 lines, -0 lines 0 comments Download
M chrome/browser/ui/browser_window.h View 1 1 chunk +0 lines, -6 lines 0 comments Download
M chrome/browser/ui/cocoa/browser_window_cocoa.h View 1 1 chunk +0 lines, -2 lines 0 comments Download
M chrome/browser/ui/cocoa/browser_window_cocoa.mm View 1 1 chunk +0 lines, -8 lines 0 comments Download
M chrome/browser/ui/cocoa/task_manager_mac.mm View 1 1 chunk +10 lines, -0 lines 0 comments Download
M chrome/browser/ui/gtk/browser_window_gtk.h View 1 1 chunk +0 lines, -2 lines 0 comments Download
M chrome/browser/ui/gtk/browser_window_gtk.cc View 1 1 chunk +0 lines, -8 lines 0 comments Download
M chrome/browser/ui/gtk/task_manager_gtk.cc View 1 1 chunk +9 lines, -0 lines 0 comments Download
M chrome/browser/ui/views/browser_dialogs.h View 1 1 chunk +0 lines, -6 lines 0 comments Download
M chrome/browser/ui/views/frame/browser_view.h View 1 1 chunk +0 lines, -2 lines 0 comments Download
M chrome/browser/ui/views/frame/browser_view.cc View 1 1 chunk +0 lines, -8 lines 0 comments Download
M chrome/browser/ui/views/task_manager_view.cc View 1 2 4 chunks +17 lines, -9 lines 0 comments Download
M chrome/test/base/test_browser_window.h View 1 1 chunk +0 lines, -2 lines 0 comments Download

Messages

Total messages: 12 (0 generated)
Mr4D (OOO till 08-26)
Please have a look!
7 years, 9 months ago (2013-03-19 21:55:41 UTC) #1
sky
I get why you want to do this, but there is no point in creating ...
7 years, 9 months ago (2013-03-19 23:27:26 UTC) #2
Mr4D (OOO till 08-26)
Okay, ripped out the intermediate call chain, made it possible to accept NULL as a ...
7 years, 9 months ago (2013-03-20 22:49:48 UTC) #3
sky
https://codereview.chromium.org/12712018/diff/4001/chrome/browser/task_manager/task_manager_browsertest_util.cc File chrome/browser/task_manager/task_manager_browsertest_util.cc (right): https://codereview.chromium.org/12712018/diff/4001/chrome/browser/task_manager/task_manager_browsertest_util.cc#newcode98 chrome/browser/task_manager/task_manager_browsertest_util.cc:98: void TaskManagerBrowserTestUtil::ShowTaskManagerAndWaitForReady( Nuke this since it's just a call ...
7 years, 9 months ago (2013-03-20 23:52:08 UTC) #4
Mr4D (OOO till 08-26)
Addressed (and fixed build problems). Please have another look! https://codereview.chromium.org/12712018/diff/4001/chrome/browser/task_manager/task_manager_browsertest_util.cc File chrome/browser/task_manager/task_manager_browsertest_util.cc (right): https://codereview.chromium.org/12712018/diff/4001/chrome/browser/task_manager/task_manager_browsertest_util.cc#newcode98 chrome/browser/task_manager/task_manager_browsertest_util.cc:98: ...
7 years, 9 months ago (2013-03-21 00:20:10 UTC) #5
sky
https://codereview.chromium.org/12712018/diff/4001/chrome/browser/ui/ash/chrome_shell_delegate.cc File chrome/browser/ui/ash/chrome_shell_delegate.cc (right): https://codereview.chromium.org/12712018/diff/4001/chrome/browser/ui/ash/chrome_shell_delegate.cc#newcode168 chrome/browser/ui/ash/chrome_shell_delegate.cc:168: chrome::OpenTaskManager(NULL, false); On 2013/03/21 00:20:10, Mr4D wrote: > Well ...
7 years, 9 months ago (2013-03-21 00:25:55 UTC) #6
Mr4D (OOO till 08-26)
Sorry for the misunderstanding. https://codereview.chromium.org/12712018/diff/4001/chrome/browser/ui/views/task_manager_view.cc File chrome/browser/ui/views/task_manager_view.cc (right): https://codereview.chromium.org/12712018/diff/4001/chrome/browser/ui/views/task_manager_view.cc#newcode558 chrome/browser/ui/views/task_manager_view.cc:558: DialogDelegateView::CreateDialogWidget(instance_, window, NULL); You misunderstood ...
7 years, 9 months ago (2013-03-21 00:29:30 UTC) #7
sky
LGTM https://codereview.chromium.org/12712018/diff/11001/chrome/browser/ui/ash/chrome_shell_delegate.cc File chrome/browser/ui/ash/chrome_shell_delegate.cc (right): https://codereview.chromium.org/12712018/diff/11001/chrome/browser/ui/ash/chrome_shell_delegate.cc#newcode171 chrome/browser/ui/ash/chrome_shell_delegate.cc:171: chrome::HOST_DESKTOP_TYPE_ASH); This isn't quite what I think should ...
7 years, 9 months ago (2013-03-21 00:48:07 UTC) #8
Mr4D (OOO till 08-26)
Thanks! https://codereview.chromium.org/12712018/diff/11001/chrome/browser/ui/ash/chrome_shell_delegate.cc File chrome/browser/ui/ash/chrome_shell_delegate.cc (right): https://codereview.chromium.org/12712018/diff/11001/chrome/browser/ui/ash/chrome_shell_delegate.cc#newcode171 chrome/browser/ui/ash/chrome_shell_delegate.cc:171: chrome::HOST_DESKTOP_TYPE_ASH); Okay - in that case I am ...
7 years, 9 months ago (2013-03-21 00:53:36 UTC) #9
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/skuhne@chromium.org/12712018/24001
7 years, 9 months ago (2013-03-21 00:54:21 UTC) #10
commit-bot: I haz the power
Change committed as 189579
7 years, 9 months ago (2013-03-21 12:24:36 UTC) #11
sky
7 years, 9 months ago (2013-03-21 15:53:20 UTC) #12
Message was sent while issue was closed.
https://codereview.chromium.org/12712018/diff/11001/chrome/browser/ui/ash/chr...
File chrome/browser/ui/ash/chrome_shell_delegate.cc (right):

https://codereview.chromium.org/12712018/diff/11001/chrome/browser/ui/ash/chr...
chrome/browser/ui/ash/chrome_shell_delegate.cc:171:
chrome::HOST_DESKTOP_TYPE_ASH);
On 2013/03/21 00:53:36, Mr4D wrote:
> Okay - in that case I am not sure what you wanted. But Okay - passing NULL
> again. Done!

Here is what I meant:

aura::Window* active = ash::wm::GetActiveWindow();
Browser* active_browser = NULL;
while (active && !active_browser) {
  active_browser = GetBrowserViewForNativeWindow(active);
  active = active->parent();
}
chrome::OpenTaskManager(browser, false);

But TaskManagerView::Show doesn't really need a browser, it needs a context for
where to create the window and the host desktop type. So, providing a views
specific variant that takes this would be better.
ChromeShellDelegate::ShowTaskManager would become:

OpenViewsTaskManager(ash::Shell::GetActiveRootWindow(), HOST_DESKTOP_TYPE_ASH,
false);

And view's implementation of OpenTaskManager would call through to
OpenViewsTaskManager:

OpenViewsTaskManager(browser->window()->GetNativeWindow(),
browser->host_desktop_type(), show_background);

This is better in that it means it's clear the TaskManager code only needs a
gfx::NativeWindow and HostDesktopType, not a Browser which could have other
random dependencies.

But anyway, passing in NULL is fine here too.

Powered by Google App Engine
This is Rietveld 408576698