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_list_impl.h" | 9 #include "chrome/browser/ui/browser_list_impl.h" |
10 #include "chrome/browser/ui/browser_list_observer.h" | 10 #include "chrome/browser/ui/browser_list_observer.h" |
11 | 11 |
12 using content::WebContents; | 12 using content::WebContents; |
13 | 13 |
14 namespace { | 14 namespace { |
15 | 15 |
16 chrome::BrowserListImpl* GetNativeList() { | 16 chrome::BrowserListImpl* GetNativeList() { |
17 return chrome::BrowserListImpl::GetInstance(chrome::HOST_DESKTOP_TYPE_NATIVE); | 17 return chrome::BrowserListImpl::GetInstance(chrome::HOST_DESKTOP_TYPE_NATIVE); |
18 } | 18 } |
19 | 19 |
20 } // namespace | 20 } // namespace |
21 | 21 |
22 // static | 22 // static |
23 void BrowserList::AddBrowser(Browser* browser) { | 23 void BrowserList::AddBrowser(Browser* browser) { |
24 GetNativeList()->AddBrowser(browser); | 24 chrome::BrowserListImpl::GetInstance(browser->host_desktop_type())-> |
| 25 AddBrowser(browser); |
25 } | 26 } |
26 | 27 |
27 // static | 28 // static |
28 void BrowserList::RemoveBrowser(Browser* browser) { | 29 void BrowserList::RemoveBrowser(Browser* browser) { |
29 GetNativeList()->RemoveBrowser(browser); | 30 chrome::BrowserListImpl::GetInstance(browser->host_desktop_type())-> |
| 31 RemoveBrowser(browser); |
30 } | 32 } |
31 | 33 |
32 // static | 34 // static |
33 void BrowserList::AddObserver(chrome::BrowserListObserver* observer) { | 35 void BrowserList::AddObserver(chrome::BrowserListObserver* observer) { |
34 GetNativeList()->AddObserver(observer); | 36 GetNativeList()->AddObserver(observer); |
35 } | 37 } |
36 | 38 |
37 // static | 39 // static |
38 void BrowserList::RemoveObserver(chrome::BrowserListObserver* observer) { | 40 void BrowserList::RemoveObserver(chrome::BrowserListObserver* observer) { |
39 GetNativeList()->RemoveObserver(observer); | 41 GetNativeList()->RemoveObserver(observer); |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
85 | 87 |
86 // static | 88 // static |
87 bool BrowserList::IsOffTheRecordSessionActiveForProfile(Profile* profile) { | 89 bool BrowserList::IsOffTheRecordSessionActiveForProfile(Profile* profile) { |
88 return GetNativeList()->IsIncognitoWindowOpenForProfile(profile); | 90 return GetNativeList()->IsIncognitoWindowOpenForProfile(profile); |
89 } | 91 } |
90 | 92 |
91 // static | 93 // static |
92 Browser* BrowserList::GetLastActive() { | 94 Browser* BrowserList::GetLastActive() { |
93 return GetNativeList()->GetLastActive(); | 95 return GetNativeList()->GetLastActive(); |
94 } | 96 } |
OLD | NEW |