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 #ifndef CHROME_BROWSER_UI_BROWSER_LIST_H_ | 5 #ifndef CHROME_BROWSER_UI_BROWSER_LIST_H_ |
6 #define CHROME_BROWSER_UI_BROWSER_LIST_H_ | 6 #define CHROME_BROWSER_UI_BROWSER_LIST_H_ |
7 | 7 |
8 #include <stddef.h> | 8 #include <stddef.h> |
9 | 9 |
10 #include <vector> | 10 #include <vector> |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
85 // Notifies the observers when browser close was started. This may be called | 85 // Notifies the observers when browser close was started. This may be called |
86 // more than once for a particular browser. | 86 // more than once for a particular browser. |
87 static void NotifyBrowserCloseStarted(Browser* browser); | 87 static void NotifyBrowserCloseStarted(Browser* browser); |
88 | 88 |
89 // Closes all browsers for |profile| across all desktops. | 89 // Closes all browsers for |profile| across all desktops. |
90 // TODO(mlerman): Move the Profile Deletion flow to use the overloaded | 90 // TODO(mlerman): Move the Profile Deletion flow to use the overloaded |
91 // version of this method with a callback, then remove this method. | 91 // version of this method with a callback, then remove this method. |
92 static void CloseAllBrowsersWithProfile(Profile* profile); | 92 static void CloseAllBrowsersWithProfile(Profile* profile); |
93 | 93 |
94 // Closes all browsers for |profile| across all desktops. Uses | 94 // Closes all browsers for |profile| across all desktops. Uses |
95 // TryToCloseBrowserList() to do the actual closing. Trigger any | 95 // TryToCloseBrowserList() to do the actual closing. Triggers any |
96 // OnBeforeUnload events if |if_force| is false. If all OnBeforeUnload events | 96 // OnBeforeUnload events unless |skip_beforeunload| is true. If all |
97 // are confirmed or |skip_beforeunload| is true, |on_close_success| is called, | 97 // OnBeforeUnload events are confirmed or |skip_beforeunload| is true, |
98 // otherwise |on_close_aborted| is called. | 98 // |on_close_success| is called, otherwise |on_close_aborted| is called. Both |
99 // Note that if there is any browser window has been used before, user | 99 // callbacks may be null. |
100 // should always has a chance to save his or her work before closing windows | 100 // Note that if there is any browser window that has been used before, the |
101 // without trigger beforeunload event. | 101 // user should always have a chance to save their work before closing windows |
| 102 // without triggering beforeunload events. |
102 static void CloseAllBrowsersWithProfile(Profile* profile, | 103 static void CloseAllBrowsersWithProfile(Profile* profile, |
103 const CloseCallback& on_close_success, | 104 const CloseCallback& on_close_success, |
104 const CloseCallback& on_close_aborted, | 105 const CloseCallback& on_close_aborted, |
105 bool skip_beforeunload); | 106 bool skip_beforeunload); |
106 | 107 |
107 // Returns true if at least one incognito session is active across all | 108 // Returns true if at least one incognito session is active across all |
108 // desktops. | 109 // desktops. |
109 static bool IsIncognitoSessionActive(); | 110 static bool IsIncognitoSessionActive(); |
110 | 111 |
111 // Returns true if at least one incognito session is active for |profile| | 112 // Returns true if at least one incognito session is active for |profile| |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
157 // removal across all BrowserLists. | 158 // removal across all BrowserLists. |
158 static base::LazyInstance< | 159 static base::LazyInstance< |
159 base::ObserverList<chrome::BrowserListObserver>>::Leaky observers_; | 160 base::ObserverList<chrome::BrowserListObserver>>::Leaky observers_; |
160 | 161 |
161 static BrowserList* instance_; | 162 static BrowserList* instance_; |
162 | 163 |
163 DISALLOW_COPY_AND_ASSIGN(BrowserList); | 164 DISALLOW_COPY_AND_ASSIGN(BrowserList); |
164 }; | 165 }; |
165 | 166 |
166 #endif // CHROME_BROWSER_UI_BROWSER_LIST_H_ | 167 #endif // CHROME_BROWSER_UI_BROWSER_LIST_H_ |
OLD | NEW |