| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "base/message_loop.h" | 8 #include "base/message_loop.h" |
| 9 #include "base/metrics/histogram.h" | 9 #include "base/metrics/histogram.h" |
| 10 #include "build/build_config.h" | 10 #include "build/build_config.h" |
| (...skipping 682 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 693 | 693 |
| 694 // static | 694 // static |
| 695 bool BrowserList::IsOffTheRecordSessionActive() { | 695 bool BrowserList::IsOffTheRecordSessionActive() { |
| 696 for (BrowserList::const_iterator i = BrowserList::begin(); | 696 for (BrowserList::const_iterator i = BrowserList::begin(); |
| 697 i != BrowserList::end(); ++i) { | 697 i != BrowserList::end(); ++i) { |
| 698 if ((*i)->profile()->IsOffTheRecord()) | 698 if ((*i)->profile()->IsOffTheRecord()) |
| 699 return true; | 699 return true; |
| 700 } | 700 } |
| 701 return false; | 701 return false; |
| 702 } | 702 } |
| 703 // static |
| 704 bool BrowserList::IsOffTheRecordSessionActiveForProfile(Profile* profile) { |
| 705 for (BrowserList::const_iterator i = BrowserList::begin(); |
| 706 i != BrowserList::end(); ++i) { |
| 707 if ((*i)->profile()->IsSameProfile(profile) && |
| 708 (*i)->profile()->IsOffTheRecord()) { |
| 709 return true; |
| 710 } |
| 711 } |
| 712 return false; |
| 713 } |
| 703 | 714 |
| 704 // static | 715 // static |
| 705 void BrowserList::RemoveBrowserFrom(Browser* browser, | 716 void BrowserList::RemoveBrowserFrom(Browser* browser, |
| 706 BrowserVector* browser_list) { | 717 BrowserVector* browser_list) { |
| 707 const iterator remove_browser = | 718 const iterator remove_browser = |
| 708 std::find(browser_list->begin(), browser_list->end(), browser); | 719 std::find(browser_list->begin(), browser_list->end(), browser); |
| 709 if (remove_browser != browser_list->end()) | 720 if (remove_browser != browser_list->end()) |
| 710 browser_list->erase(remove_browser); | 721 browser_list->erase(remove_browser); |
| 711 } | 722 } |
| 712 | 723 |
| (...skipping 30 matching lines...) Expand all Loading... |
| 743 // If no more TabContents from Browsers, check the BackgroundPrintingManager. | 754 // If no more TabContents from Browsers, check the BackgroundPrintingManager. |
| 744 while (bg_printing_iterator_ != GetBackgroundPrintingManager()->end()) { | 755 while (bg_printing_iterator_ != GetBackgroundPrintingManager()->end()) { |
| 745 cur_ = *bg_printing_iterator_; | 756 cur_ = *bg_printing_iterator_; |
| 746 CHECK(cur_); | 757 CHECK(cur_); |
| 747 ++bg_printing_iterator_; | 758 ++bg_printing_iterator_; |
| 748 return; | 759 return; |
| 749 } | 760 } |
| 750 // Reached the end - no more TabContents. | 761 // Reached the end - no more TabContents. |
| 751 cur_ = NULL; | 762 cur_ = NULL; |
| 752 } | 763 } |
| OLD | NEW |