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/ui/browser_list.h" | 5 #include "chrome/browser/ui/browser_list.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "base/auto_reset.h" | 9 #include "base/auto_reset.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
243 observer.OnBrowserSetLastActive(browser); | 243 observer.OnBrowserSetLastActive(browser); |
244 } | 244 } |
245 | 245 |
246 // static | 246 // static |
247 void BrowserList::NotifyBrowserNoLongerActive(Browser* browser) { | 247 void BrowserList::NotifyBrowserNoLongerActive(Browser* browser) { |
248 for (chrome::BrowserListObserver& observer : observers_.Get()) | 248 for (chrome::BrowserListObserver& observer : observers_.Get()) |
249 observer.OnBrowserNoLongerActive(browser); | 249 observer.OnBrowserNoLongerActive(browser); |
250 } | 250 } |
251 | 251 |
252 // static | 252 // static |
| 253 void BrowserList::NotifyBrowserCloseStarted(Browser* browser) { |
| 254 for (chrome::BrowserListObserver& observer : observers_.Get()) |
| 255 observer.OnBrowserClosing(browser); |
| 256 } |
| 257 |
| 258 // static |
253 bool BrowserList::IsIncognitoSessionActive() { | 259 bool BrowserList::IsIncognitoSessionActive() { |
254 for (auto* browser : *BrowserList::GetInstance()) { | 260 for (auto* browser : *BrowserList::GetInstance()) { |
255 if (browser->profile()->IsOffTheRecord()) | 261 if (browser->profile()->IsOffTheRecord()) |
256 return true; | 262 return true; |
257 } | 263 } |
258 return false; | 264 return false; |
259 } | 265 } |
260 | 266 |
261 // static | 267 // static |
262 bool BrowserList::IsIncognitoSessionActiveForProfile(Profile* profile) { | 268 bool BrowserList::IsIncognitoSessionActiveForProfile(Profile* profile) { |
(...skipping 16 matching lines...) Expand all Loading... |
279 } | 285 } |
280 | 286 |
281 // static | 287 // static |
282 void BrowserList::RemoveBrowserFrom(Browser* browser, | 288 void BrowserList::RemoveBrowserFrom(Browser* browser, |
283 BrowserVector* browser_list) { | 289 BrowserVector* browser_list) { |
284 BrowserVector::iterator remove_browser = | 290 BrowserVector::iterator remove_browser = |
285 std::find(browser_list->begin(), browser_list->end(), browser); | 291 std::find(browser_list->begin(), browser_list->end(), browser); |
286 if (remove_browser != browser_list->end()) | 292 if (remove_browser != browser_list->end()) |
287 browser_list->erase(remove_browser); | 293 browser_list->erase(remove_browser); |
288 } | 294 } |
OLD | NEW |