diff options
author | thakis@chromium.org <thakis@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-10-08 19:55:14 +0000 |
---|---|---|
committer | thakis@chromium.org <thakis@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-10-08 19:55:14 +0000 |
commit | 8f0d1a2b4004082e5e46009d4446a59dff805928 (patch) | |
tree | aabb0e55875425a5187eb8e724aa4b4a17ebe6c9 /chrome/browser/task_manager.cc | |
parent | ed764d167c3f9653b9eec17ecc2042ea3c0a6611 (diff) | |
download | chromium_src-8f0d1a2b4004082e5e46009d4446a59dff805928.zip chromium_src-8f0d1a2b4004082e5e46009d4446a59dff805928.tar.gz chromium_src-8f0d1a2b4004082e5e46009d4446a59dff805928.tar.bz2 |
Add about:memory link to task manager.
Since about:memory DCHECK()s atm, the link is not completely hooked up.
In the xib, I've added a square button with height 14 and the new HyperlinkCell, contained in a GTMWidthBasedResizer or how it's called. I made sure the baseline of link on the left and button on the right is at the same height.
BUG=17989,13156
TEST=Open MainMenu.xib, click "Enable" for view->dev->taskman. Build&run chrome. Task manager should contain link.
Review URL: http://codereview.chromium.org/255018
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@28426 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/task_manager.cc')
-rw-r--r-- | chrome/browser/task_manager.cc | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/chrome/browser/task_manager.cc b/chrome/browser/task_manager.cc index 0af61ff..bbc77da 100644 --- a/chrome/browser/task_manager.cc +++ b/chrome/browser/task_manager.cc @@ -14,12 +14,14 @@ #include "base/thread.h" #include "chrome/browser/browser_list.h" #include "chrome/browser/browser_process.h" +#include "chrome/browser/browser_window.h" #include "chrome/browser/net/url_request_tracking.h" #include "chrome/browser/renderer_host/render_process_host.h" #include "chrome/browser/renderer_host/resource_dispatcher_host.h" #include "chrome/browser/task_manager_resource_providers.h" #include "chrome/common/pref_names.h" #include "chrome/common/pref_service.h" +#include "chrome/common/url_constants.h" #include "grit/app_resources.h" #include "grit/chromium_strings.h" #include "grit/generated_resources.h" @@ -820,3 +822,20 @@ void TaskManager::OnWindowClosed() { TaskManager* TaskManager::GetInstance() { return Singleton<TaskManager>::get(); } + +void TaskManager::OpenAboutMemory() { + Browser* browser = BrowserList::GetLastActive(); + DCHECK(browser); + browser->OpenURL(GURL(chrome::kAboutMemoryURL), GURL(), NEW_FOREGROUND_TAB, + PageTransition::LINK); + // 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(); +} |