| 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 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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. |
| 79 static void CloseAllBrowsers(bool use_post); | 79 static void CloseAllBrowsers(bool use_post); |
| 80 | 80 |
| 81 // Closes all browsers and exits. This is equivalent to |
| 82 // CloseAllBrowsers(true) on platforms where the application exits when no |
| 83 // more windows are remaining. On other platforms (the Mac), this will |
| 84 // additionally exit the application. |
| 85 static void CloseAllBrowsersAndExit(); |
| 86 |
| 81 // Begins shutdown of the application when the Windows session is ending. | 87 // Begins shutdown of the application when the Windows session is ending. |
| 82 static void WindowsSessionEnding(); | 88 static void WindowsSessionEnding(); |
| 83 | 89 |
| 84 // Returns true if there is at least one Browser with the specified profile. | 90 // Returns true if there is at least one Browser with the specified profile. |
| 85 static bool HasBrowserWithProfile(Profile* profile); | 91 static bool HasBrowserWithProfile(Profile* profile); |
| 86 | 92 |
| 87 static const_iterator begin() { | 93 static const_iterator begin() { |
| 88 return browsers_.begin(); | 94 return browsers_.begin(); |
| 89 } | 95 } |
| 90 | 96 |
| (...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 185 // tab index into the current Browser of the current web view | 191 // tab index into the current Browser of the current web view |
| 186 int web_view_index_; | 192 int web_view_index_; |
| 187 | 193 |
| 188 // 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 |
| 189 // 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 |
| 190 // this since the caller may access the current host many times. | 196 // this since the caller may access the current host many times. |
| 191 TabContents* cur_; | 197 TabContents* cur_; |
| 192 }; | 198 }; |
| 193 | 199 |
| 194 #endif // CHROME_BROWSER_BROWSER_LIST_H__ | 200 #endif // CHROME_BROWSER_BROWSER_LIST_H__ |
| OLD | NEW |