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/download/download_status_updater.h" | 5 #include "chrome/browser/download/download_status_updater.h" |
6 | 6 |
7 #include <stdint.h> | 7 #include <stdint.h> |
8 | 8 |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
49 | 49 |
50 const char WasInProgressData::kKey[] = | 50 const char WasInProgressData::kKey[] = |
51 "DownloadItem DownloadStatusUpdater WasInProgressData"; | 51 "DownloadItem DownloadStatusUpdater WasInProgressData"; |
52 | 52 |
53 } // anonymous namespace | 53 } // anonymous namespace |
54 | 54 |
55 DownloadStatusUpdater::DownloadStatusUpdater() { | 55 DownloadStatusUpdater::DownloadStatusUpdater() { |
56 } | 56 } |
57 | 57 |
58 DownloadStatusUpdater::~DownloadStatusUpdater() { | 58 DownloadStatusUpdater::~DownloadStatusUpdater() { |
59 STLDeleteElements(¬ifiers_); | 59 base::STLDeleteElements(¬ifiers_); |
60 } | 60 } |
61 | 61 |
62 bool DownloadStatusUpdater::GetProgress(float* progress, | 62 bool DownloadStatusUpdater::GetProgress(float* progress, |
63 int* download_count) const { | 63 int* download_count) const { |
64 *progress = 0; | 64 *progress = 0; |
65 *download_count = 0; | 65 *download_count = 0; |
66 bool progress_certain = true; | 66 bool progress_certain = true; |
67 int64_t received_bytes = 0; | 67 int64_t received_bytes = 0; |
68 int64_t total_bytes = 0; | 68 int64_t total_bytes = 0; |
69 | 69 |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
146 float progress = 0; | 146 float progress = 0; |
147 int download_count = 0; | 147 int download_count = 0; |
148 GetProgress(&progress, &download_count); | 148 GetProgress(&progress, &download_count); |
149 linux_ui->SetDownloadCount(download_count); | 149 linux_ui->SetDownloadCount(download_count); |
150 linux_ui->SetProgressFraction(progress); | 150 linux_ui->SetProgressFraction(progress); |
151 } | 151 } |
152 #endif | 152 #endif |
153 // TODO(avi): Implement for Android? | 153 // TODO(avi): Implement for Android? |
154 } | 154 } |
155 #endif | 155 #endif |
OLD | NEW |