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

Side by Side Diff: content/shell/browser/shell_javascript_dialog_manager.h

Issue 1825523002: Do not reset navigation state when BeforeUnload is cancelled by a commit (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 9 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
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 CONTENT_SHELL_BROWSER_SHELL_JAVASCRIPT_DIALOG_MANAGER_H_ 5 #ifndef CONTENT_SHELL_BROWSER_SHELL_JAVASCRIPT_DIALOG_MANAGER_H_
6 #define CONTENT_SHELL_BROWSER_SHELL_JAVASCRIPT_DIALOG_MANAGER_H_ 6 #define CONTENT_SHELL_BROWSER_SHELL_JAVASCRIPT_DIALOG_MANAGER_H_
7 7
8 #include "base/callback_forward.h" 8 #include "base/callback_forward.h"
9 #include "base/compiler_specific.h" 9 #include "base/compiler_specific.h"
10 #include "base/macros.h" 10 #include "base/macros.h"
(...skipping 28 matching lines...) Expand all
39 39
40 void ResetDialogState(WebContents* web_contents) override; 40 void ResetDialogState(WebContents* web_contents) override;
41 41
42 // Called by the ShellJavaScriptDialog when it closes. 42 // Called by the ShellJavaScriptDialog when it closes.
43 void DialogClosed(ShellJavaScriptDialog* dialog); 43 void DialogClosed(ShellJavaScriptDialog* dialog);
44 44
45 // Used for content_browsertests. 45 // Used for content_browsertests.
46 void set_dialog_request_callback(const base::Closure& callback) { 46 void set_dialog_request_callback(const base::Closure& callback) {
47 dialog_request_callback_ = callback; 47 dialog_request_callback_ = callback;
48 } 48 }
49 void set_proceed_beforeunload_default(bool proceed) {
50 proceed_beforeunload_default_ = proceed;
51 }
49 52
50 private: 53 private:
51 #if defined(OS_MACOSX) || defined(OS_WIN) 54 #if defined(OS_MACOSX) || defined(OS_WIN)
52 // The dialog being shown. No queueing. 55 // The dialog being shown. No queueing.
53 scoped_ptr<ShellJavaScriptDialog> dialog_; 56 scoped_ptr<ShellJavaScriptDialog> dialog_;
54 #else 57 #else
55 // TODO: implement ShellJavaScriptDialog for other platforms, drop this #if 58 // TODO: implement ShellJavaScriptDialog for other platforms, drop this #if
56 #endif 59 #endif
57 60
58 base::Closure dialog_request_callback_; 61 base::Closure dialog_request_callback_;
62 bool proceed_beforeunload_default_;
63 DialogClosedCallback before_unload_callback_;
59 64
60 DISALLOW_COPY_AND_ASSIGN(ShellJavaScriptDialogManager); 65 DISALLOW_COPY_AND_ASSIGN(ShellJavaScriptDialogManager);
61 }; 66 };
62 67
63 } // namespace content 68 } // namespace content
64 69
65 #endif // CONTENT_SHELL_BROWSER_SHELL_JAVASCRIPT_DIALOG_MANAGER_H_ 70 #endif // CONTENT_SHELL_BROWSER_SHELL_JAVASCRIPT_DIALOG_MANAGER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698