summaryrefslogtreecommitdiffstats
path: root/chrome/browser/ui/webui/active_downloads_ui.cc
diff options
context:
space:
mode:
authorjianli@chromium.org <jianli@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-05-05 20:35:14 +0000
committerjianli@chromium.org <jianli@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-05-05 20:35:14 +0000
commitb35b26b360b5d84d064d63440590902d4974b59d (patch)
treef0aa8b0b32ca80ad7eb5efc1f78a5dcd45899b13 /chrome/browser/ui/webui/active_downloads_ui.cc
parent4d9160ff743804acf89a5a50a0b43c113aecc1ab (diff)
downloadchromium_src-b35b26b360b5d84d064d63440590902d4974b59d.zip
chromium_src-b35b26b360b5d84d064d63440590902d4974b59d.tar.gz
chromium_src-b35b26b360b5d84d064d63440590902d4974b59d.tar.bz2
Browser::Type cleanup.
BUG=None TEST=Existing tests R=ben@chromium.org,stevenjb@chromium.org,phajdan.jr@chromium.org Review URL: http://codereview.chromium.org/6697032 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@84303 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/ui/webui/active_downloads_ui.cc')
-rw-r--r--chrome/browser/ui/webui/active_downloads_ui.cc9
1 files changed, 6 insertions, 3 deletions
diff --git a/chrome/browser/ui/webui/active_downloads_ui.cc b/chrome/browser/ui/webui/active_downloads_ui.cc
index 35fcf0e..9bd9ddd 100644
--- a/chrome/browser/ui/webui/active_downloads_ui.cc
+++ b/chrome/browser/ui/webui/active_downloads_ui.cc
@@ -61,6 +61,7 @@ static const int kPopupHeight = 36 * 2 + 29;
static const char kPropertyPath[] = "path";
static const char kPropertyTitle[] = "title";
static const char kPropertyDirectory[] = "isDirectory";
+static const char kActiveDownloadAppName[] = "active-downloads";
class ActiveDownloadsUIHTMLSource : public ChromeURLDataManager::DataSource {
public:
@@ -282,7 +283,8 @@ void ActiveDownloadsHandler::OpenNewPopupWindow(const ListValue* args) {
void ActiveDownloadsHandler::OpenNewWindow(const ListValue* args, bool popup) {
std::string url = UTF16ToUTF8(ExtractStringValue(args));
Browser* browser = popup ?
- Browser::CreateForType(Browser::TYPE_APP_PANEL, profile_) :
+ Browser::CreateForApp(Browser::TYPE_PANEL, kActiveDownloadAppName,
+ gfx::Size(), profile_) :
BrowserList::GetLastActive();
browser::NavigateParams params(browser, GURL(url), PageTransition::LINK);
params.disposition = NEW_FOREGROUND_TAB;
@@ -386,7 +388,8 @@ Browser* ActiveDownloadsUI::OpenPopup(Profile* profile) {
// Create new browser if no matching pop up is found.
if (browser == NULL) {
- browser = Browser::CreateForType(Browser::TYPE_APP_PANEL, profile);
+ browser = Browser::CreateForApp(Browser::TYPE_PANEL, kActiveDownloadAppName,
+ gfx::Size(), profile);
browser::NavigateParams params(
browser,
@@ -412,7 +415,7 @@ Browser* ActiveDownloadsUI::GetPopup(Profile* profile) {
for (BrowserList::const_iterator it = BrowserList::begin();
it != BrowserList::end();
++it) {
- if (((*it)->type() == Browser::TYPE_APP_PANEL)) {
+ if ((*it)->is_type_panel() && (*it)->is_app()) {
TabContents* tab_contents = (*it)->GetSelectedTabContents();
DCHECK(tab_contents);
if (!tab_contents)