Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(59)

Side by Side Diff: chrome/browser/ui/unload_controller.h

Issue 1931793002: Stop using nested message loop for alert() and other JS dialogs (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: updated comments and removed unused declaration Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « chrome/browser/ui/fast_unload_controller.cc ('k') | chrome/browser/ui/unload_controller.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 20 matching lines...) Expand all
31 explicit UnloadController(Browser* browser); 31 explicit UnloadController(Browser* browser);
32 ~UnloadController() override; 32 ~UnloadController() override;
33 33
34 // Returns true if |contents| can be cleanly closed. When |browser_| is being 34 // Returns true if |contents| can be cleanly closed. When |browser_| is being
35 // closed, this function will return false to indicate |contents| should not 35 // closed, this function will return false to indicate |contents| should not
36 // be cleanly closed, since the fast shutdown path will just kill its 36 // be cleanly closed, since the fast shutdown path will just kill its
37 // renderer. 37 // renderer.
38 bool CanCloseContents(content::WebContents* contents); 38 bool CanCloseContents(content::WebContents* contents);
39 39
40 // Returns true if we need to run unload events for the |contents|. 40 // Returns true if we need to run unload events for the |contents|.
41 static bool ShouldRunUnloadEventsHelper(content::WebContents* contents); 41 bool ShouldRunUnloadEventsHelper(content::WebContents* contents);
42 42
43 // Helper function to run beforeunload listeners on a WebContents. 43 // Helper function to run beforeunload listeners on a WebContents.
44 // Returns true if |contents| beforeunload listeners were invoked. 44 // Returns true if |contents| beforeunload listeners were invoked.
45 static bool RunUnloadEventsHelper(content::WebContents* contents); 45 bool RunUnloadEventsHelper(content::WebContents* contents);
46 46
47 // Called when a BeforeUnload handler is fired for |contents|. |proceed| 47 // Called when a BeforeUnload handler is fired for |contents|. |proceed|
48 // indicates the user's response to the Y/N BeforeUnload handler dialog. If 48 // indicates the user's response to the Y/N BeforeUnload handler dialog. If
49 // this parameter is false, any pending attempt to close the whole browser 49 // this parameter is false, any pending attempt to close the whole browser
50 // will be canceled. Returns true if Unload handlers should be fired. When the 50 // will be canceled. Returns true if Unload handlers should be fired. When the
51 // |browser_| is being closed, Unload handlers for any particular WebContents 51 // |browser_| is being closed, Unload handlers for any particular WebContents
52 // will not be run until every WebContents being closed has a chance to run 52 // will not be run until every WebContents being closed has a chance to run
53 // its BeforeUnloadHandler. 53 // its BeforeUnloadHandler.
54 bool BeforeUnloadFired(content::WebContents* contents, bool proceed); 54 bool BeforeUnloadFired(content::WebContents* contents, bool proceed);
55 55
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
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_
OLDNEW
« no previous file with comments | « chrome/browser/ui/fast_unload_controller.cc ('k') | chrome/browser/ui/unload_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698