| 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/memory/ref_counted.h" | 9 #include "base/memory/ref_counted.h" |
| 10 #include "base/path_service.h" | 10 #include "base/path_service.h" |
| (...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 147 }; | 147 }; |
| 148 | 148 |
| 149 class PickSuggestedFileDelegate : public ChromeDownloadManagerDelegate { | 149 class PickSuggestedFileDelegate : public ChromeDownloadManagerDelegate { |
| 150 public: | 150 public: |
| 151 explicit PickSuggestedFileDelegate(Profile* profile) | 151 explicit PickSuggestedFileDelegate(Profile* profile) |
| 152 : ChromeDownloadManagerDelegate(profile) { | 152 : ChromeDownloadManagerDelegate(profile) { |
| 153 SetDownloadManager( | 153 SetDownloadManager( |
| 154 DownloadServiceFactory::GetForProfile(profile)->GetDownloadManager()); | 154 DownloadServiceFactory::GetForProfile(profile)->GetDownloadManager()); |
| 155 } | 155 } |
| 156 | 156 |
| 157 virtual void ChooseDownloadPath(TabContents* tab_contents, | 157 virtual void ChooseDownloadPath(WebContents* web_contents, |
| 158 const FilePath& suggested_path, | 158 const FilePath& suggested_path, |
| 159 void* data) OVERRIDE { | 159 void* data) OVERRIDE { |
| 160 if (download_manager_) | 160 if (download_manager_) |
| 161 download_manager_->FileSelected(suggested_path, data); | 161 download_manager_->FileSelected(suggested_path, data); |
| 162 } | 162 } |
| 163 }; | 163 }; |
| 164 | 164 |
| 165 // Get History Information. | 165 // Get History Information. |
| 166 class DownloadsHistoryDataCollector { | 166 class DownloadsHistoryDataCollector { |
| 167 public: | 167 public: |
| (...skipping 1564 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1732 | 1732 |
| 1733 // Check state. | 1733 // Check state. |
| 1734 EXPECT_EQ(1, browser()->tab_count()); | 1734 EXPECT_EQ(1, browser()->tab_count()); |
| 1735 ASSERT_TRUE(CheckDownloadFullPaths(browser(), | 1735 ASSERT_TRUE(CheckDownloadFullPaths(browser(), |
| 1736 target_file_full_path, | 1736 target_file_full_path, |
| 1737 OriginFile(file))); | 1737 OriginFile(file))); |
| 1738 | 1738 |
| 1739 // Temporary downloads won't be visible. | 1739 // Temporary downloads won't be visible. |
| 1740 CheckDownloadUI(browser(), false, false, file); | 1740 CheckDownloadUI(browser(), false, false, file); |
| 1741 } | 1741 } |
| OLD | NEW |