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