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 CONTENT_PUBLIC_BROWSER_JAVASCRIPT_DIALOG_MANAGER_H_ | 5 #ifndef CONTENT_PUBLIC_BROWSER_JAVASCRIPT_DIALOG_MANAGER_H_ |
6 #define CONTENT_PUBLIC_BROWSER_JAVASCRIPT_DIALOG_MANAGER_H_ | 6 #define CONTENT_PUBLIC_BROWSER_JAVASCRIPT_DIALOG_MANAGER_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/callback.h" | 10 #include "base/callback.h" |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
43 const DialogClosedCallback& callback) = 0; | 43 const DialogClosedCallback& callback) = 0; |
44 | 44 |
45 // Accepts or dismisses the active JavaScript dialog, which must be owned | 45 // Accepts or dismisses the active JavaScript dialog, which must be owned |
46 // by the given |web_contents|. If |prompt_override| is not null, the prompt | 46 // by the given |web_contents|. If |prompt_override| is not null, the prompt |
47 // text of the dialog should be set before accepting. Returns true if the | 47 // text of the dialog should be set before accepting. Returns true if the |
48 // dialog was handled. | 48 // dialog was handled. |
49 virtual bool HandleJavaScriptDialog(WebContents* web_contents, | 49 virtual bool HandleJavaScriptDialog(WebContents* web_contents, |
50 bool accept, | 50 bool accept, |
51 const base::string16* prompt_override); | 51 const base::string16* prompt_override); |
52 | 52 |
53 // Cancels all active and pending dialogs for the given WebContents. | 53 // Cancels all active and pending dialogs for the given WebContents. If |
54 virtual void CancelActiveAndPendingDialogs(WebContents* web_contents) = 0; | 54 // |suppress_callbacks| is true, suppresses the calls to callbacks while |
55 | 55 // canceling those dialogs. If |reset_state| is true, resets any saved state |
56 // Reset any saved state tied to the given WebContents. | 56 // tied to |web_contents|. |
57 virtual void ResetDialogState(WebContents* web_contents) = 0; | 57 virtual void CancelDialogs(WebContents* web_contents, |
| 58 bool suppress_callbacks, |
| 59 bool reset_state) = 0; |
58 | 60 |
59 virtual ~JavaScriptDialogManager() {} | 61 virtual ~JavaScriptDialogManager() {} |
60 }; | 62 }; |
61 | 63 |
62 } // namespace content | 64 } // namespace content |
63 | 65 |
64 #endif // CONTENT_PUBLIC_BROWSER_JAVASCRIPT_DIALOG_MANAGER_H_ | 66 #endif // CONTENT_PUBLIC_BROWSER_JAVASCRIPT_DIALOG_MANAGER_H_ |
OLD | NEW |