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/file_path.h" | 10 #include "base/file_path.h" |
11 #include "base/logging.h" | 11 #include "base/logging.h" |
12 #include "base/stl_util.h" | 12 #include "base/stl_util.h" |
13 #include "base/strings/string_number_conversions.h" | 13 #include "base/strings/string_number_conversions.h" |
14 #include "base/win/metro.h" | 14 #include "base/win/metro.h" |
15 #include "base/win/scoped_comptr.h" | 15 #include "base/win/scoped_comptr.h" |
16 #include "base/win/windows_version.h" | 16 #include "base/win/windows_version.h" |
17 #include "chrome/browser/platform_util.h" | 17 #include "chrome/browser/platform_util.h" |
18 #include "chrome/browser/ui/browser.h" | 18 #include "chrome/browser/ui/browser.h" |
19 #include "chrome/browser/ui/browser_list.h" | 19 #include "chrome/browser/ui/browser_iterator.h" |
20 #include "chrome/browser/ui/browser_window.h" | 20 #include "chrome/browser/ui/browser_window.h" |
21 #include "content/public/browser/browser_context.h" | 21 #include "content/public/browser/browser_context.h" |
22 #include "content/public/browser/browser_thread.h" | 22 #include "content/public/browser/browser_thread.h" |
23 #include "googleurl/src/gurl.h" | 23 #include "googleurl/src/gurl.h" |
24 #include "grit/generated_resources.h" | 24 #include "grit/generated_resources.h" |
25 #include "ui/base/l10n/l10n_util.h" | 25 #include "ui/base/l10n/l10n_util.h" |
26 #include "win8/util/win8_util.h" | 26 #include "win8/util/win8_util.h" |
27 | 27 |
28 // This code doesn't compile with Aura on. TODO(avi): hook it up so that | 28 // This code doesn't compile with Aura on. TODO(avi): hook it up so that |
29 // win_aura can do platform integration. | 29 // win_aura can do platform integration. |
(...skipping 19 matching lines...) Expand all Loading... |
49 return; | 49 return; |
50 } | 50 } |
51 | 51 |
52 result = taskbar->HrInit(); | 52 result = taskbar->HrInit(); |
53 if (FAILED(result)) { | 53 if (FAILED(result)) { |
54 LOG(ERROR) << "Failed initializing an ITaskbarList3 interface."; | 54 LOG(ERROR) << "Failed initializing an ITaskbarList3 interface."; |
55 return; | 55 return; |
56 } | 56 } |
57 | 57 |
58 // Iterate through all the browser windows, and draw the progress bar. | 58 // Iterate through all the browser windows, and draw the progress bar. |
59 for (BrowserList::const_iterator browser_iterator = BrowserList::begin(); | 59 for (chrome::BrowserIterator it; !it.done(); it.Next()) { |
60 browser_iterator != BrowserList::end(); browser_iterator++) { | 60 Browser* browser = *it; |
61 Browser* browser = *browser_iterator; | |
62 BrowserWindow* window = browser->window(); | 61 BrowserWindow* window = browser->window(); |
63 if (!window) | 62 if (!window) |
64 continue; | 63 continue; |
65 HWND frame = window->GetNativeWindow(); | 64 HWND frame = window->GetNativeWindow(); |
66 if (download_count == 0 || progress == 1.0f) | 65 if (download_count == 0 || progress == 1.0f) |
67 taskbar->SetProgressState(frame, TBPF_NOPROGRESS); | 66 taskbar->SetProgressState(frame, TBPF_NOPROGRESS); |
68 else if (!progress_known) | 67 else if (!progress_known) |
69 taskbar->SetProgressState(frame, TBPF_INDETERMINATE); | 68 taskbar->SetProgressState(frame, TBPF_INDETERMINATE); |
70 else | 69 else |
71 taskbar->SetProgressValue(frame, static_cast<int>(progress * 100), 100); | 70 taskbar->SetProgressValue(frame, static_cast<int>(progress * 100), 100); |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
145 title.c_str(), | 144 title.c_str(), |
146 body.c_str(), | 145 body.c_str(), |
147 L"", | 146 L"", |
148 notification_id.c_str(), | 147 notification_id.c_str(), |
149 MetroDownloadNotificationClickedHandler, | 148 MetroDownloadNotificationClickedHandler, |
150 download->GetTargetFilePath().value().c_str()); | 149 download->GetTargetFilePath().value().c_str()); |
151 } | 150 } |
152 } | 151 } |
153 | 152 |
154 #endif // !USE_AURA | 153 #endif // !USE_AURA |
OLD | NEW |