| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 #ifndef CHROME_BROWSER_BROWSER_LIST_H__ | 5 #ifndef CHROME_BROWSER_BROWSER_LIST_H__ |
| 6 #define CHROME_BROWSER_BROWSER_LIST_H__ | 6 #define CHROME_BROWSER_BROWSER_LIST_H__ |
| 7 | 7 |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "chrome/browser/browser.h" | 10 #include "chrome/browser/browser.h" |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 51 // WARNING: this is NULL until a browser becomes active. If during startup | 51 // WARNING: this is NULL until a browser becomes active. If during startup |
| 52 // a browser does not become active (perhaps the user launches Chrome, then | 52 // a browser does not become active (perhaps the user launches Chrome, then |
| 53 // clicks on another app before the first browser window appears) then this | 53 // clicks on another app before the first browser window appears) then this |
| 54 // returns NULL. | 54 // returns NULL. |
| 55 static Browser* GetLastActive(); | 55 static Browser* GetLastActive(); |
| 56 | 56 |
| 57 // Identical in behavior to GetLastActive(), except that the most recently | 57 // Identical in behavior to GetLastActive(), except that the most recently |
| 58 // open browser owned by |profile| is returned. If none exist, returns NULL. | 58 // open browser owned by |profile| is returned. If none exist, returns NULL. |
| 59 static Browser* GetLastActiveWithProfile(Profile *profile); | 59 static Browser* GetLastActiveWithProfile(Profile *profile); |
| 60 | 60 |
| 61 // Find an existing browser window with the provided type. If the last active | 61 // Find an existing browser window with the provided type. Searches in the |
| 62 // has the right type, it is returned. Otherwise, the next available browser | 62 // order of last activation. Only browsers that have been active can be |
| 63 // is returned. Returns NULL if no such browser currently exists. | 63 // returned. Returns NULL if no such browser currently exists. |
| 64 static Browser* FindBrowserWithType(Profile* p, Browser::Type t); | 64 static Browser* FindBrowserWithType(Profile* p, Browser::Type t); |
| 65 | 65 |
| 66 // Find an existing browser window with the provided profile. If the last | 66 // Find an existing browser window with the provided profile. Searches in the |
| 67 // active has the right profile, it is returned. Returns NULL if no such | 67 // order of last activation. Only browsers that have been active can be |
| 68 // browser currently exists. | 68 // returned. Returns NULL if no such browser currently exists. |
| 69 static Browser* FindBrowserWithProfile(Profile* p); | 69 static Browser* FindBrowserWithProfile(Profile* p); |
| 70 | 70 |
| 71 // Find an existing browser with the provided ID. Returns NULL if no such | 71 // Find an existing browser with the provided ID. Returns NULL if no such |
| 72 // browser currently exists. | 72 // browser currently exists. |
| 73 static Browser* FindBrowserWithID(SessionID::id_type desired_id); | 73 static Browser* FindBrowserWithID(SessionID::id_type desired_id); |
| 74 | 74 |
| 75 // Closes all browsers. If use_post is true the windows are closed by way of | 75 // Closes all browsers. If use_post is true the windows are closed by way of |
| 76 // posting a WM_CLOSE message, otherwise the windows are closed directly. In | 76 // posting a WM_CLOSE message, otherwise the windows are closed directly. In |
| 77 // almost all cases you'll want to use true, the one exception is ending | 77 // almost all cases you'll want to use true, the one exception is ending |
| 78 // the session. use_post should only be false when invoked from end session. | 78 // the session. use_post should only be false when invoked from end session. |
| (...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 191 // tab index into the current Browser of the current web view | 191 // tab index into the current Browser of the current web view |
| 192 int web_view_index_; | 192 int web_view_index_; |
| 193 | 193 |
| 194 // Current TabContents, or NULL if we're at the end of the list. This can | 194 // Current TabContents, or NULL if we're at the end of the list. This can |
| 195 // be extracted given the browser iterator and index, but it's nice to cache | 195 // be extracted given the browser iterator and index, but it's nice to cache |
| 196 // this since the caller may access the current host many times. | 196 // this since the caller may access the current host many times. |
| 197 TabContents* cur_; | 197 TabContents* cur_; |
| 198 }; | 198 }; |
| 199 | 199 |
| 200 #endif // CHROME_BROWSER_BROWSER_LIST_H__ | 200 #endif // CHROME_BROWSER_BROWSER_LIST_H__ |
| OLD | NEW |