| 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 "chrome/browser/chromeos/imageburner/burn_manager.h" | 5 #include "chrome/browser/chromeos/imageburner/burn_manager.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.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/string_util.h" | 10 #include "base/string_util.h" |
| (...skipping 405 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 416 WebContents* web_contents, | 416 WebContents* web_contents, |
| 417 net::FileStream* file_stream) { | 417 net::FileStream* file_stream) { |
| 418 if (file_stream) { | 418 if (file_stream) { |
| 419 DownloadManager* download_manager = | 419 DownloadManager* download_manager = |
| 420 web_contents->GetBrowserContext()->GetDownloadManager(); | 420 web_contents->GetBrowserContext()->GetDownloadManager(); |
| 421 DownloadSaveInfo save_info; | 421 DownloadSaveInfo save_info; |
| 422 save_info.file_path = file_path; | 422 save_info.file_path = file_path; |
| 423 save_info.file_stream = linked_ptr<net::FileStream>(file_stream); | 423 save_info.file_stream = linked_ptr<net::FileStream>(file_stream); |
| 424 DownloadStarted(true, url); | 424 DownloadStarted(true, url); |
| 425 | 425 |
| 426 download_util::RecordDownloadCount( | 426 download_util::RecordDownloadSource( |
| 427 download_util::INITIATED_BY_IMAGE_BURNER_COUNT); | 427 download_util::INITIATED_BY_IMAGE_BURNER); |
| 428 download_manager->DownloadUrl( | 428 download_manager->DownloadUrl( |
| 429 url, | 429 url, |
| 430 web_contents->GetURL(), | 430 web_contents->GetURL(), |
| 431 web_contents->GetEncoding(), | 431 web_contents->GetEncoding(), |
| 432 false, | 432 false, |
| 433 save_info, | 433 save_info, |
| 434 web_contents); | 434 web_contents); |
| 435 } else { | 435 } else { |
| 436 DownloadStarted(false, url); | 436 DownloadStarted(false, url); |
| 437 } | 437 } |
| (...skipping 10 matching lines...) Expand all Loading... |
| 448 current_listener != listener_range.second; | 448 current_listener != listener_range.second; |
| 449 ++current_listener) { | 449 ++current_listener) { |
| 450 if (current_listener->second) | 450 if (current_listener->second) |
| 451 current_listener->second->OnBurnDownloadStarted(success); | 451 current_listener->second->OnBurnDownloadStarted(success); |
| 452 } | 452 } |
| 453 listeners_.erase(listener_range.first, listener_range.second); | 453 listeners_.erase(listener_range.first, listener_range.second); |
| 454 } | 454 } |
| 455 | 455 |
| 456 } // namespace imageburner | 456 } // namespace imageburner |
| 457 } // namespace chromeos | 457 } // namespace chromeos |
| OLD | NEW |