| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "base/bind.h" | 5 #include "base/bind.h" |
| 6 #include "base/bind_helpers.h" | 6 #include "base/bind_helpers.h" |
| 7 #include "base/file_path.h" | 7 #include "base/file_path.h" |
| 8 #include "base/file_util.h" | 8 #include "base/file_util.h" |
| 9 #include "base/path_service.h" | 9 #include "base/path_service.h" |
| 10 #include "base/scoped_temp_dir.h" | 10 #include "base/scoped_temp_dir.h" |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 89 content::NotificationService::AllSources()); | 89 content::NotificationService::AllSources()); |
| 90 return content::Details<DownloadItem>(observer.details()).ptr()-> | 90 return content::Details<DownloadItem>(observer.details()).ptr()-> |
| 91 GetOriginalUrl(); | 91 GetOriginalUrl(); |
| 92 } | 92 } |
| 93 | 93 |
| 94 #if defined(OS_CHROMEOS) && !defined(USE_AURA) | 94 #if defined(OS_CHROMEOS) && !defined(USE_AURA) |
| 95 const ActiveDownloadsUI::DownloadList& GetDownloads() const { | 95 const ActiveDownloadsUI::DownloadList& GetDownloads() const { |
| 96 Browser* popup = ActiveDownloadsUI::GetPopup(); | 96 Browser* popup = ActiveDownloadsUI::GetPopup(); |
| 97 EXPECT_TRUE(popup); | 97 EXPECT_TRUE(popup); |
| 98 ActiveDownloadsUI* downloads_ui = static_cast<ActiveDownloadsUI*>( | 98 ActiveDownloadsUI* downloads_ui = static_cast<ActiveDownloadsUI*>( |
| 99 popup->GetSelectedTabContents()->web_ui()); | 99 popup->GetSelectedTabContents()->GetWebUI()); |
| 100 EXPECT_TRUE(downloads_ui); | 100 EXPECT_TRUE(downloads_ui); |
| 101 return downloads_ui->GetDownloads(); | 101 return downloads_ui->GetDownloads(); |
| 102 } | 102 } |
| 103 #endif | 103 #endif |
| 104 | 104 |
| 105 void CheckDownloadUI(const FilePath& download_path) const { | 105 void CheckDownloadUI(const FilePath& download_path) const { |
| 106 #if defined(OS_CHROMEOS) && !defined(USE_AURA) | 106 #if defined(OS_CHROMEOS) && !defined(USE_AURA) |
| 107 const ActiveDownloadsUI::DownloadList& downloads = GetDownloads(); | 107 const ActiveDownloadsUI::DownloadList& downloads = GetDownloads(); |
| 108 EXPECT_EQ(downloads.size(), 1U); | 108 EXPECT_EQ(downloads.size(), 1U); |
| 109 | 109 |
| (...skipping 236 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 346 IN_PROC_BROWSER_TEST_F(SavePageBrowserTest, ExplicitCancel) { | 346 IN_PROC_BROWSER_TEST_F(SavePageBrowserTest, ExplicitCancel) { |
| 347 GURL url = NavigateToMockURL("a"); | 347 GURL url = NavigateToMockURL("a"); |
| 348 FilePath full_file_name, dir; | 348 FilePath full_file_name, dir; |
| 349 GetDestinationPaths("a", &full_file_name, &dir); | 349 GetDestinationPaths("a", &full_file_name, &dir); |
| 350 scoped_refptr<SavePackage> save_package(new SavePackage(GetCurrentTab(), | 350 scoped_refptr<SavePackage> save_package(new SavePackage(GetCurrentTab(), |
| 351 SavePackage::SAVE_AS_ONLY_HTML, full_file_name, dir)); | 351 SavePackage::SAVE_AS_ONLY_HTML, full_file_name, dir)); |
| 352 save_package->Cancel(true); | 352 save_package->Cancel(true); |
| 353 } | 353 } |
| 354 | 354 |
| 355 } // namespace | 355 } // namespace |
| OLD | NEW |