OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "content/public/test/download_test_observer.h" | 5 #include "content/public/test/download_test_observer.h" |
6 | 6 |
7 #include <vector> | 7 #include <vector> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
165 download->GetId())); | 165 download->GetId())); |
166 break; | 166 break; |
167 | 167 |
168 case ON_DANGEROUS_DOWNLOAD_FAIL: | 168 case ON_DANGEROUS_DOWNLOAD_FAIL: |
169 ADD_FAILURE() << "Unexpected dangerous download item."; | 169 ADD_FAILURE() << "Unexpected dangerous download item."; |
170 break; | 170 break; |
171 | 171 |
172 case ON_DANGEROUS_DOWNLOAD_IGNORE: | 172 case ON_DANGEROUS_DOWNLOAD_IGNORE: |
173 break; | 173 break; |
174 | 174 |
| 175 case ON_DANGEROUS_DOWNLOAD_QUIT: |
| 176 DownloadInFinalState(download); |
| 177 break; |
| 178 |
175 default: | 179 default: |
176 NOTREACHED(); | 180 NOTREACHED(); |
177 } | 181 } |
178 } | 182 } |
179 | 183 |
180 if (IsDownloadInFinalState(download)) | 184 if (IsDownloadInFinalState(download)) |
181 DownloadInFinalState(download); | 185 DownloadInFinalState(download); |
182 } | 186 } |
183 | 187 |
184 size_t DownloadTestObserver::NumDangerousDownloadsSeen() const { | 188 size_t DownloadTestObserver::NumDangerousDownloadsSeen() const { |
(...skipping 257 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
442 base::MessageLoopForUI::current()->Quit(); | 446 base::MessageLoopForUI::current()->Quit(); |
443 } | 447 } |
444 | 448 |
445 const DownloadUrlParameters::OnStartedCallback | 449 const DownloadUrlParameters::OnStartedCallback |
446 DownloadTestItemCreationObserver::callback() { | 450 DownloadTestItemCreationObserver::callback() { |
447 return base::Bind( | 451 return base::Bind( |
448 &DownloadTestItemCreationObserver::DownloadItemCreationCallback, this); | 452 &DownloadTestItemCreationObserver::DownloadItemCreationCallback, this); |
449 } | 453 } |
450 | 454 |
451 } // namespace content | 455 } // namespace content |
OLD | NEW |