| 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_UNLOAD_CONTROLLER_H_ | 5 #ifndef CHROME_BROWSER_UI_UNLOAD_CONTROLLER_H_ |
| 6 #define CHROME_BROWSER_UI_UNLOAD_CONTROLLER_H_ | 6 #define CHROME_BROWSER_UI_UNLOAD_CONTROLLER_H_ |
| 7 | 7 |
| 8 #include <set> | 8 #include <set> |
| 9 | 9 |
| 10 #include "base/callback.h" | 10 #include "base/callback.h" |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 81 // Clears all the state associated with processing tabs' beforeunload/unload | 81 // Clears all the state associated with processing tabs' beforeunload/unload |
| 82 // events since the user cancelled closing the window. | 82 // events since the user cancelled closing the window. |
| 83 void CancelWindowClose(); | 83 void CancelWindowClose(); |
| 84 | 84 |
| 85 private: | 85 private: |
| 86 typedef std::set<content::WebContents*> UnloadListenerSet; | 86 typedef std::set<content::WebContents*> UnloadListenerSet; |
| 87 | 87 |
| 88 // Overridden from content::NotificationObserver: | 88 // Overridden from content::NotificationObserver: |
| 89 virtual void Observe(int type, | 89 virtual void Observe(int type, |
| 90 const content::NotificationSource& source, | 90 const content::NotificationSource& source, |
| 91 const content::NotificationDetails& details) OVERRIDE; | 91 const content::NotificationDetails& details) override; |
| 92 | 92 |
| 93 // Overridden from TabStripModelObserver: | 93 // Overridden from TabStripModelObserver: |
| 94 virtual void TabInsertedAt(content::WebContents* contents, | 94 virtual void TabInsertedAt(content::WebContents* contents, |
| 95 int index, | 95 int index, |
| 96 bool foreground) OVERRIDE; | 96 bool foreground) override; |
| 97 virtual void TabDetachedAt(content::WebContents* contents, | 97 virtual void TabDetachedAt(content::WebContents* contents, |
| 98 int index) OVERRIDE; | 98 int index) override; |
| 99 virtual void TabReplacedAt(TabStripModel* tab_strip_model, | 99 virtual void TabReplacedAt(TabStripModel* tab_strip_model, |
| 100 content::WebContents* old_contents, | 100 content::WebContents* old_contents, |
| 101 content::WebContents* new_contents, | 101 content::WebContents* new_contents, |
| 102 int index) OVERRIDE; | 102 int index) override; |
| 103 virtual void TabStripEmpty() OVERRIDE; | 103 virtual void TabStripEmpty() override; |
| 104 | 104 |
| 105 void TabAttachedImpl(content::WebContents* contents); | 105 void TabAttachedImpl(content::WebContents* contents); |
| 106 void TabDetachedImpl(content::WebContents* contents); | 106 void TabDetachedImpl(content::WebContents* contents); |
| 107 | 107 |
| 108 // Processes the next tab that needs it's beforeunload/unload event fired. | 108 // Processes the next tab that needs it's beforeunload/unload event fired. |
| 109 void ProcessPendingTabs(); | 109 void ProcessPendingTabs(); |
| 110 | 110 |
| 111 // Whether we've completed firing all the tabs' beforeunload/unload events. | 111 // Whether we've completed firing all the tabs' beforeunload/unload events. |
| 112 bool HasCompletedUnloadProcessing() const; | 112 bool HasCompletedUnloadProcessing() const; |
| 113 | 113 |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 155 base::Callback<void(bool)> on_close_confirmed_; | 155 base::Callback<void(bool)> on_close_confirmed_; |
| 156 | 156 |
| 157 base::WeakPtrFactory<UnloadController> weak_factory_; | 157 base::WeakPtrFactory<UnloadController> weak_factory_; |
| 158 | 158 |
| 159 DISALLOW_COPY_AND_ASSIGN(UnloadController); | 159 DISALLOW_COPY_AND_ASSIGN(UnloadController); |
| 160 }; | 160 }; |
| 161 | 161 |
| 162 } // namespace chrome | 162 } // namespace chrome |
| 163 | 163 |
| 164 #endif // CHROME_BROWSER_UI_UNLOAD_CONTROLLER_H_ | 164 #endif // CHROME_BROWSER_UI_UNLOAD_CONTROLLER_H_ |
| OLD | NEW |