From f5bf8ccfcaa51e3f8b12e7eaf4bb26fa6bf2d69c Mon Sep 17 00:00:00 2001 From: "xiyuan@chromium.org" Date: Fri, 5 Feb 2010 18:19:25 +0000 Subject: Show the filebrowse ui rather than the download shelf in chromeos. This cl displays the filebrowse ui rather than download shelf for downloads in chrom(e|ium) os. It conditionally replaces (with preprocessor macros) the Browser::OnStartDownload method to do this. The cl adds a static FileBrowseUI::OpenPopup(profile, hashArgument), which opens the file browse ui and passes it the provided hash argument. This is invoked directly from Browser::OnStartDownload. The USBMountObserver code was changed to call this static method, rather than open the popup by hand as it had been doing. I'm not sure about ownership of the Browser* returned by OpenPopup, but based on other code in the tree I assume chrome will deal with freeing it when appropriate. Before this change, USBMountObserver would add the window to registrar_ *before* showing it. Now that FileBrowseUI::OpenPopup returns a which which is already visible, this is no longer the case. I assume this won't be a problem. Commit this for rginda. Original review: http://codereview.chromium.org/555167 BUG=none TEST=none Review URL: http://codereview.chromium.org/564022 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@38222 0039d316-1c4b-4281-b951-d872f2087c98 --- chrome/browser/download/save_page_browsertest.cc | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) (limited to 'chrome/browser/download') diff --git a/chrome/browser/download/save_page_browsertest.cc b/chrome/browser/download/save_page_browsertest.cc index dac35d3..142ed9a 100644 --- a/chrome/browser/download/save_page_browsertest.cc +++ b/chrome/browser/download/save_page_browsertest.cc @@ -88,7 +88,10 @@ IN_PROC_BROWSER_TEST_F(SavePageBrowserTest, SaveHTMLOnly) { SavePageFinishedObserver observer; EXPECT_EQ(url, observer.page_url()); - EXPECT_TRUE(browser()->window()->IsDownloadShelfVisible()); + + if (browser()->SupportsWindowFeature(Browser::FEATURE_DOWNLOADSHELF)) + EXPECT_TRUE(browser()->window()->IsDownloadShelfVisible()); + EXPECT_TRUE(file_util::PathExists(full_file_name)); EXPECT_FALSE(file_util::PathExists(dir)); EXPECT_TRUE(file_util::ContentsEqual( @@ -113,7 +116,10 @@ IN_PROC_BROWSER_TEST_F(SavePageBrowserTest, SaveCompleteHTML) { SavePageFinishedObserver observer; EXPECT_EQ(url, observer.page_url()); - EXPECT_TRUE(browser()->window()->IsDownloadShelfVisible()); + + if (browser()->SupportsWindowFeature(Browser::FEATURE_DOWNLOADSHELF)) + EXPECT_TRUE(browser()->window()->IsDownloadShelfVisible()); + EXPECT_TRUE(file_util::PathExists(full_file_name)); EXPECT_TRUE(file_util::PathExists(dir)); EXPECT_TRUE(file_util::TextContentsEqual( @@ -153,7 +159,10 @@ IN_PROC_BROWSER_TEST_F(SavePageBrowserTest, FileNameFromPageTitle) { SavePageFinishedObserver observer; EXPECT_EQ(url, observer.page_url()); - EXPECT_TRUE(browser()->window()->IsDownloadShelfVisible()); + + if (browser()->SupportsWindowFeature(Browser::FEATURE_DOWNLOADSHELF)) + EXPECT_TRUE(browser()->window()->IsDownloadShelfVisible()); + EXPECT_TRUE(file_util::PathExists(full_file_name)); EXPECT_TRUE(file_util::PathExists(dir)); EXPECT_TRUE(file_util::TextContentsEqual( -- cgit v1.1