| 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 <shobjidl.h> | 7 #include <shobjidl.h> |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| 11 #include "base/win/scoped_comptr.h" | 11 #include "base/win/scoped_comptr.h" |
| 12 #include "base/win/windows_version.h" | 12 #include "base/win/windows_version.h" |
| 13 #include "chrome/browser/ui/browser.h" | 13 #include "chrome/browser/ui/browser.h" |
| 14 #include "chrome/browser/ui/browser_iterator.h" | 14 #include "chrome/browser/ui/browser_iterator.h" |
| 15 #include "chrome/browser/ui/browser_window.h" | 15 #include "chrome/browser/ui/browser_window.h" |
| 16 #include "grit/generated_resources.h" | |
| 17 #include "ui/base/l10n/l10n_util.h" | |
| 18 #include "ui/views/win/hwnd_util.h" | 16 #include "ui/views/win/hwnd_util.h" |
| 19 | 17 |
| 20 namespace { | 18 namespace { |
| 21 | 19 |
| 22 void UpdateTaskbarProgressBar(int download_count, | 20 void UpdateTaskbarProgressBar(int download_count, |
| 23 bool progress_known, | 21 bool progress_known, |
| 24 float progress) { | 22 float progress) { |
| 25 // Taskbar progress bar is only supported on Win7. | 23 // Taskbar progress bar is only supported on Win7. |
| 26 if (base::win::GetVersion() < base::win::VERSION_WIN7) | 24 if (base::win::GetVersion() < base::win::VERSION_WIN7) |
| 27 return; | 25 return; |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 60 | 58 |
| 61 void DownloadStatusUpdater::UpdateAppIconDownloadProgress( | 59 void DownloadStatusUpdater::UpdateAppIconDownloadProgress( |
| 62 content::DownloadItem* download) { | 60 content::DownloadItem* download) { |
| 63 | 61 |
| 64 // Always update overall progress. | 62 // Always update overall progress. |
| 65 float progress = 0; | 63 float progress = 0; |
| 66 int download_count = 0; | 64 int download_count = 0; |
| 67 bool progress_known = GetProgress(&progress, &download_count); | 65 bool progress_known = GetProgress(&progress, &download_count); |
| 68 UpdateTaskbarProgressBar(download_count, progress_known, progress); | 66 UpdateTaskbarProgressBar(download_count, progress_known, progress); |
| 69 } | 67 } |
| OLD | NEW |