Index: chrome/browser/ui/browser.cc |
diff --git a/chrome/browser/ui/browser.cc b/chrome/browser/ui/browser.cc |
index 2de528d9f2231553fb6a9e426bd09c496e2e91c1..547c619d165abdf7fd9c46158752c45d9e26e243 100644 |
--- a/chrome/browser/ui/browser.cc |
+++ b/chrome/browser/ui/browser.cc |
@@ -98,7 +98,6 @@ |
#include "chrome/browser/ui/browser_dialogs.h" |
#include "chrome/browser/ui/browser_finder.h" |
#include "chrome/browser/ui/browser_instant_controller.h" |
-#include "chrome/browser/ui/browser_iterator.h" |
#include "chrome/browser/ui/browser_list.h" |
#include "chrome/browser/ui/browser_live_tab_context.h" |
#include "chrome/browser/ui/browser_navigator.h" |
@@ -799,15 +798,14 @@ Browser::DownloadClosePreventionType Browser::OkToCloseWithInProgressDownloads( |
// profile, that are relevant for the ok-to-close decision. |
int profile_window_count = 0; |
int total_window_count = 0; |
- for (chrome::BrowserIterator it; !it.done(); it.Next()) { |
+ for (auto* browser : *BrowserList::GetInstance()) { |
// Don't count this browser window or any other in the process of closing. |
- Browser* const browser = *it; |
// Window closing may be delayed, and windows that are in the process of |
// closing don't count against our totals. |
if (browser == this || browser->IsAttemptingToCloseBrowser()) |
continue; |
- if (it->profile() == profile()) |
+ if (browser->profile() == profile()) |
profile_window_count++; |
total_window_count++; |
} |