| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 89 // Find an existing browser with the provided ID. Returns NULL if no such | 89 // Find an existing browser with the provided ID. Returns NULL if no such |
| 90 // browser currently exists. | 90 // browser currently exists. |
| 91 static Browser* FindBrowserWithID(SessionID::id_type desired_id); | 91 static Browser* FindBrowserWithID(SessionID::id_type desired_id); |
| 92 | 92 |
| 93 // Checks if the browser can be automatically restarted to install upgrades | 93 // Checks if the browser can be automatically restarted to install upgrades |
| 94 // The browser can be automatically restarted when: | 94 // The browser can be automatically restarted when: |
| 95 // 1. It's in the background mode (no visible windows). | 95 // 1. It's in the background mode (no visible windows). |
| 96 // 2. An update exe is present in the install folder. | 96 // 2. An update exe is present in the install folder. |
| 97 static bool CanRestartForUpdate(); | 97 static bool CanRestartForUpdate(); |
| 98 | 98 |
| 99 // Closes all browsers. If use_post is true the windows are closed by way of | |
| 100 // posting a WM_CLOSE message, otherwise the windows are closed directly. In | |
| 101 // almost all cases you'll want to use true, the one exception is ending | |
| 102 // the session. use_post should only be false when invoked from end session. | |
| 103 static void CloseAllBrowsers(bool use_post); | |
| 104 | |
| 105 // Closes all browsers and exits. This is equivalent to | 99 // Closes all browsers and exits. This is equivalent to |
| 106 // CloseAllBrowsers(true) on platforms where the application exits when no | 100 // CloseAllBrowsers(true) on platforms where the application exits when no |
| 107 // more windows are remaining. On other platforms (the Mac), this will | 101 // more windows are remaining. On other platforms (the Mac), this will |
| 108 // additionally exit the application. | 102 // additionally exit the application. |
| 109 static void CloseAllBrowsersAndExit(); | 103 static void CloseAllBrowsersAndExit(); |
| 110 | 104 |
| 105 // Closes all browsers. If the session is ending the windows are closed |
| 106 // directly. Otherwise the windows are closed by way of posting a WM_CLOSE |
| 107 // message. |
| 108 static void CloseAllBrowsers(); |
| 109 |
| 111 // Begins shutdown of the application when the Windows session is ending. | 110 // Begins shutdown of the application when the Windows session is ending. |
| 112 static void WindowsSessionEnding(); | 111 static void WindowsSessionEnding(); |
| 113 | 112 |
| 114 // Returns true if there is at least one Browser with the specified profile. | 113 // Returns true if there is at least one Browser with the specified profile. |
| 115 static bool HasBrowserWithProfile(Profile* profile); | 114 static bool HasBrowserWithProfile(Profile* profile); |
| 116 | 115 |
| 117 // Tells the BrowserList to keep the application alive after the last Browser | 116 // Tells the BrowserList to keep the application alive after the last Browser |
| 118 // closes. This is implemented as a count, so callers should pair their calls | 117 // closes. This is implemented as a count, so callers should pair their calls |
| 119 // to StartKeepAlive() with matching calls to EndKeepAlive() when they no | 118 // to StartKeepAlive() with matching calls to EndKeepAlive() when they no |
| 120 // longer need to keep the application running. | 119 // longer need to keep the application running. |
| (...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 226 // tab index into the current Browser of the current web view | 225 // tab index into the current Browser of the current web view |
| 227 int web_view_index_; | 226 int web_view_index_; |
| 228 | 227 |
| 229 // Current TabContents, or NULL if we're at the end of the list. This can | 228 // Current TabContents, or NULL if we're at the end of the list. This can |
| 230 // be extracted given the browser iterator and index, but it's nice to cache | 229 // be extracted given the browser iterator and index, but it's nice to cache |
| 231 // this since the caller may access the current host many times. | 230 // this since the caller may access the current host many times. |
| 232 TabContents* cur_; | 231 TabContents* cur_; |
| 233 }; | 232 }; |
| 234 | 233 |
| 235 #endif // CHROME_BROWSER_BROWSER_LIST_H_ | 234 #endif // CHROME_BROWSER_BROWSER_LIST_H_ |
| OLD | NEW |