diff options
author | mhm@chromium.org <mhm@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-06-09 02:50:38 +0000 |
---|---|---|
committer | mhm@chromium.org <mhm@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-06-09 02:50:38 +0000 |
commit | c8a6b8e4385e5bb44bf07d17e9c6072d0393b5d9 (patch) | |
tree | 6fb68e1384baf4c69ebc95228a568d573b20ca8b /chrome | |
parent | 5147c47289ff5694f7bad0ef2dda3cedc524e635 (diff) | |
download | chromium_src-c8a6b8e4385e5bb44bf07d17e9c6072d0393b5d9.zip chromium_src-c8a6b8e4385e5bb44bf07d17e9c6072d0393b5d9.tar.gz chromium_src-c8a6b8e4385e5bb44bf07d17e9c6072d0393b5d9.tar.bz2 |
Stats for nerds should bring up applicaiton browser window to foreground
The reason why it didn't bring up the stats in foreground is because it is an application window. Application (same goes for popup) windows cannot have tabs, it is just a single page. When the link is clicked, we need to get the last active browser so we could open that about:memory page. When you open a page in an application window, it will create a new window or find a window (normal) that is present, then open the url in that tab. So now we don't have the browser pointed to that tab, its still pointed to the application window.
By finding the last active tab again, we can ensure we have the correct tab.
BUG=11822 (http://crbug.com/11822)
TEST=tested if the stats appeared in foreground and it did.
Review URL: http://codereview.chromium.org/119293
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@17925 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r-- | chrome/browser/task_manager_win.cc | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/chrome/browser/task_manager_win.cc b/chrome/browser/task_manager_win.cc index 48b6777..988d4dd 100644 --- a/chrome/browser/task_manager_win.cc +++ b/chrome/browser/task_manager_win.cc @@ -546,7 +546,15 @@ void TaskManagerViewImpl::LinkActivated(views::Link* source, DCHECK(browser); browser->OpenURL(GURL("about:memory"), GURL(), NEW_FOREGROUND_TAB, PageTransition::LINK); - // In case the browser window is minimzed, show it. + // In case the browser window is minimzed, show it. If this is an application + // or popup, we can only have one tab, hence we need to process this in a + // tabbed browser window. Currently, |browser| is pointing to the application, + // popup window. Therefore, we have to retrieve the last active tab again, + // since a new window has been used. + if (browser->type() & Browser::TYPE_APP_POPUP) { + browser = BrowserList::GetLastActive(); + DCHECK(browser); + } browser->window()->Show(); } |