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 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
82 | 82 |
83 GURL WaitForSavePackageToFinish() const { | 83 GURL WaitForSavePackageToFinish() const { |
84 ui_test_utils::TestNotificationObserver observer; | 84 ui_test_utils::TestNotificationObserver observer; |
85 ui_test_utils::RegisterAndWait(&observer, | 85 ui_test_utils::RegisterAndWait(&observer, |
86 content::NOTIFICATION_SAVE_PACKAGE_SUCCESSFULLY_FINISHED, | 86 content::NOTIFICATION_SAVE_PACKAGE_SUCCESSFULLY_FINISHED, |
87 content::NotificationService::AllSources()); | 87 content::NotificationService::AllSources()); |
88 return content::Details<DownloadItem>(observer.details()).ptr()-> | 88 return content::Details<DownloadItem>(observer.details()).ptr()-> |
89 GetOriginalUrl(); | 89 GetOriginalUrl(); |
90 } | 90 } |
91 | 91 |
92 #if defined(OS_CHROMEOS) && defined(TOUCH_UI) | 92 #if defined(OS_CHROMEOS) && !defined(USE_AURA) |
93 const ActiveDownloadsUI::DownloadList& GetDownloads() const { | |
94 TabContents* download_contents = ActiveDownloadsUI::GetPopup(NULL); | |
95 ActiveDownloadsUI* downloads_ui = static_cast<ActiveDownloadsUI*>( | |
96 download_contents->web_ui()); | |
97 EXPECT_TRUE(downloads_ui); | |
98 return downloads_ui->GetDownloads(); | |
99 } | |
100 #elif defined(OS_CHROMEOS) && !defined(USE_AURA) | |
101 const ActiveDownloadsUI::DownloadList& GetDownloads() const { | 93 const ActiveDownloadsUI::DownloadList& GetDownloads() const { |
102 Browser* popup = ActiveDownloadsUI::GetPopup(); | 94 Browser* popup = ActiveDownloadsUI::GetPopup(); |
103 EXPECT_TRUE(popup); | 95 EXPECT_TRUE(popup); |
104 ActiveDownloadsUI* downloads_ui = static_cast<ActiveDownloadsUI*>( | 96 ActiveDownloadsUI* downloads_ui = static_cast<ActiveDownloadsUI*>( |
105 popup->GetSelectedTabContents()->web_ui()); | 97 popup->GetSelectedTabContents()->web_ui()); |
106 EXPECT_TRUE(downloads_ui); | 98 EXPECT_TRUE(downloads_ui); |
107 return downloads_ui->GetDownloads(); | 99 return downloads_ui->GetDownloads(); |
108 } | 100 } |
109 #endif | 101 #endif |
110 | 102 |
(...skipping 241 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
352 IN_PROC_BROWSER_TEST_F(SavePageBrowserTest, ExplicitCancel) { | 344 IN_PROC_BROWSER_TEST_F(SavePageBrowserTest, ExplicitCancel) { |
353 GURL url = NavigateToMockURL("a"); | 345 GURL url = NavigateToMockURL("a"); |
354 FilePath full_file_name, dir; | 346 FilePath full_file_name, dir; |
355 GetDestinationPaths("a", &full_file_name, &dir); | 347 GetDestinationPaths("a", &full_file_name, &dir); |
356 scoped_refptr<SavePackage> save_package(new SavePackage(GetCurrentTab(), | 348 scoped_refptr<SavePackage> save_package(new SavePackage(GetCurrentTab(), |
357 SavePackage::SAVE_AS_ONLY_HTML, full_file_name, dir)); | 349 SavePackage::SAVE_AS_ONLY_HTML, full_file_name, dir)); |
358 save_package->Cancel(true); | 350 save_package->Cancel(true); |
359 } | 351 } |
360 | 352 |
361 } // namespace | 353 } // namespace |
OLD | NEW |