| Index: chrome/browser/sessions/session_service.cc
|
| diff --git a/chrome/browser/sessions/session_service.cc b/chrome/browser/sessions/session_service.cc
|
| index 6671aeb716de0586fc3b47e4a6db58e589f8cb49..5ed9b0baed59543519763ddde8544399577ed76a 100644
|
| --- a/chrome/browser/sessions/session_service.cc
|
| +++ b/chrome/browser/sessions/session_service.cc
|
| @@ -32,7 +32,6 @@
|
| #include "chrome/browser/sessions/session_restore.h"
|
| #include "chrome/browser/sessions/session_service_utils.h"
|
| #include "chrome/browser/sessions/session_tab_helper.h"
|
| -#include "chrome/browser/ui/browser_iterator.h"
|
| #include "chrome/browser/ui/browser_list.h"
|
| #include "chrome/browser/ui/browser_tabstrip.h"
|
| #include "chrome/browser/ui/browser_window.h"
|
| @@ -839,8 +838,7 @@ void SessionService::BuildCommandsForBrowser(
|
| void SessionService::BuildCommandsFromBrowsers(
|
| IdToRange* tab_to_available_range,
|
| std::set<SessionID::id_type>* windows_to_track) {
|
| - for (chrome::BrowserIterator it; !it.done(); it.Next()) {
|
| - Browser* browser = *it;
|
| + for (auto* browser : *BrowserList::GetInstance()) {
|
| // Make sure the browser has tabs and a window. Browser's destructor
|
| // removes itself from the BrowserList. When a browser is closed the
|
| // destructor is not necessarily run immediately. This means it's possible
|
| @@ -910,8 +908,7 @@ bool SessionService::IsOnlyOneTabLeft() const {
|
| }
|
|
|
| int window_count = 0;
|
| - for (chrome::BrowserIterator it; !it.done(); it.Next()) {
|
| - Browser* browser = *it;
|
| + for (auto* browser : *BrowserList::GetInstance()) {
|
| const SessionID::id_type window_id = browser->session_id().id();
|
| if (ShouldTrackBrowser(browser) &&
|
| window_closing_ids_.find(window_id) == window_closing_ids_.end()) {
|
| @@ -933,8 +930,7 @@ bool SessionService::HasOpenTrackableBrowsers(
|
| return true;
|
| }
|
|
|
| - for (chrome::BrowserIterator it; !it.done(); it.Next()) {
|
| - Browser* browser = *it;
|
| + for (auto* browser : *BrowserList::GetInstance()) {
|
| const SessionID::id_type browser_id = browser->session_id().id();
|
| if (browser_id != window_id.id() &&
|
| window_closing_ids_.find(browser_id) == window_closing_ids_.end() &&
|
| @@ -1110,8 +1106,8 @@ void SessionService::MaybeDeleteSessionOnlyData() {
|
| }
|
|
|
| // Check for any open windows for the current profile that we aren't tracking.
|
| - for (chrome::BrowserIterator it; !it.done(); it.Next()) {
|
| - if ((*it)->profile() == profile())
|
| + for (auto* browser : *BrowserList::GetInstance()) {
|
| + if (browser->profile() == profile())
|
| return;
|
| }
|
| DeleteSessionOnlyData(profile());
|
|
|