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 <vector> | 7 #include <vector> |
8 | 8 |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "base/stl_util.h" | 10 #include "base/stl_util.h" |
11 | 11 |
12 #if defined(OS_LINUX) && !defined(OS_CHROMEOS) | 12 #if defined(OS_LINUX) && !defined(OS_CHROMEOS) |
13 #include "ui/linux_ui/linux_ui.h" | 13 #include "ui/views/linux_ui/linux_ui.h" |
14 #endif | 14 #endif |
15 | 15 |
16 namespace { | 16 namespace { |
17 | 17 |
18 // DownloadStatusUpdater::UpdateAppIconDownloadProgress() expects to only be | 18 // DownloadStatusUpdater::UpdateAppIconDownloadProgress() expects to only be |
19 // called once when a DownloadItem completes, then not again (except perhaps | 19 // called once when a DownloadItem completes, then not again (except perhaps |
20 // until it is resumed). The existence of WasInProgressData is effectively a | 20 // until it is resumed). The existence of WasInProgressData is effectively a |
21 // boolean that indicates whether that final UpdateAppIconDownloadProgress() | 21 // boolean that indicates whether that final UpdateAppIconDownloadProgress() |
22 // call has been made for a given DownloadItem. It is expected that there will | 22 // call has been made for a given DownloadItem. It is expected that there will |
23 // be many more non-in-progress downloads than in-progress downloads, so | 23 // be many more non-in-progress downloads than in-progress downloads, so |
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
130 return; | 130 return; |
131 WasInProgressData::Clear(item); | 131 WasInProgressData::Clear(item); |
132 } | 132 } |
133 UpdateAppIconDownloadProgress(item); | 133 UpdateAppIconDownloadProgress(item); |
134 } | 134 } |
135 | 135 |
136 #if defined(USE_AURA) || defined(OS_ANDROID) | 136 #if defined(USE_AURA) || defined(OS_ANDROID) |
137 void DownloadStatusUpdater::UpdateAppIconDownloadProgress( | 137 void DownloadStatusUpdater::UpdateAppIconDownloadProgress( |
138 content::DownloadItem* download) { | 138 content::DownloadItem* download) { |
139 #if defined(OS_LINUX) && !defined(OS_CHROMEOS) | 139 #if defined(OS_LINUX) && !defined(OS_CHROMEOS) |
140 const ui::LinuxUI* linux_ui = ui::LinuxUI::instance(); | 140 const views::LinuxUI* linux_ui = views::LinuxUI::instance(); |
141 if (linux_ui) { | 141 if (linux_ui) { |
142 float progress = 0; | 142 float progress = 0; |
143 int download_count = 0; | 143 int download_count = 0; |
144 GetProgress(&progress, &download_count); | 144 GetProgress(&progress, &download_count); |
145 linux_ui->SetDownloadCount(download_count); | 145 linux_ui->SetDownloadCount(download_count); |
146 linux_ui->SetProgressFraction(progress); | 146 linux_ui->SetProgressFraction(progress); |
147 } | 147 } |
148 #endif | 148 #endif |
149 // TODO(avi): Implement for Android? | 149 // TODO(avi): Implement for Android? |
150 } | 150 } |
151 #endif | 151 #endif |
OLD | NEW |