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 "chrome/browser/profiles/profile.h" | 7 #include "chrome/browser/profiles/profile.h" |
8 #include "chrome/browser/ui/browser.h" | 8 #include "chrome/browser/ui/browser.h" |
9 #include "chrome/browser/ui/browser_iterator.h" | 9 #include "chrome/browser/ui/browser_iterator.h" |
10 #include "chrome/browser/ui/browser_list_impl.h" | 10 #include "chrome/browser/ui/browser_list_impl.h" |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
50 browsers_to_close.push_back(*it); | 50 browsers_to_close.push_back(*it); |
51 } | 51 } |
52 | 52 |
53 for (BrowserVector::const_iterator it = browsers_to_close.begin(); | 53 for (BrowserVector::const_iterator it = browsers_to_close.begin(); |
54 it != browsers_to_close.end(); ++it) { | 54 it != browsers_to_close.end(); ++it) { |
55 (*it)->window()->Close(); | 55 (*it)->window()->Close(); |
56 } | 56 } |
57 } | 57 } |
58 | 58 |
59 // static | 59 // static |
60 bool BrowserList::empty() { | |
61 return GetNativeList()->empty(); | |
62 } | |
63 | |
64 // static | |
65 size_t BrowserList::size() { | |
66 return GetNativeList()->size(); | |
67 } | |
68 | |
69 // static | |
70 void BrowserList::SetLastActive(Browser* browser) { | 60 void BrowserList::SetLastActive(Browser* browser) { |
71 chrome::BrowserListImpl::GetInstance(browser->host_desktop_type())-> | 61 chrome::BrowserListImpl::GetInstance(browser->host_desktop_type())-> |
72 SetLastActive(browser); | 62 SetLastActive(browser); |
73 } | 63 } |
74 | 64 |
75 // static | 65 // static |
76 BrowserList::const_reverse_iterator BrowserList::begin_last_active() { | 66 BrowserList::const_reverse_iterator BrowserList::begin_last_active() { |
77 return GetNativeList()->begin_last_active(); | 67 return GetNativeList()->begin_last_active(); |
78 } | 68 } |
79 | 69 |
80 // static | 70 // static |
81 BrowserList::const_reverse_iterator BrowserList::end_last_active() { | 71 BrowserList::const_reverse_iterator BrowserList::end_last_active() { |
82 return GetNativeList()->end_last_active(); | 72 return GetNativeList()->end_last_active(); |
83 } | 73 } |
84 | 74 |
85 // static | 75 // static |
86 bool BrowserList::IsOffTheRecordSessionActive() { | 76 bool BrowserList::IsOffTheRecordSessionActive() { |
87 return GetNativeList()->IsIncognitoWindowOpen(); | 77 return GetNativeList()->IsIncognitoWindowOpen(); |
88 } | 78 } |
89 | 79 |
90 // static | 80 // static |
91 bool BrowserList::IsOffTheRecordSessionActiveForProfile(Profile* profile) { | 81 bool BrowserList::IsOffTheRecordSessionActiveForProfile(Profile* profile) { |
92 return GetNativeList()->IsIncognitoWindowOpenForProfile(profile); | 82 return GetNativeList()->IsIncognitoWindowOpenForProfile(profile); |
93 } | 83 } |
OLD | NEW |