| 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 13 matching lines...) Expand all Loading... |
| 24 public: | 24 public: |
| 25 typedef base::Callback<void(bool /* success */, | 25 typedef base::Callback<void(bool /* success */, |
| 26 const base::string16& /* user_input */)> | 26 const base::string16& /* user_input */)> |
| 27 DialogClosedCallback; | 27 DialogClosedCallback; |
| 28 | 28 |
| 29 // Displays a JavaScript dialog. |did_suppress_message| will not be nil; if | 29 // Displays a JavaScript dialog. |did_suppress_message| will not be nil; if |
| 30 // |true| is returned in it, the caller will handle faking the reply. | 30 // |true| is returned in it, the caller will handle faking the reply. |
| 31 virtual void RunJavaScriptDialog( | 31 virtual void RunJavaScriptDialog( |
| 32 WebContents* web_contents, | 32 WebContents* web_contents, |
| 33 const GURL& origin_url, | 33 const GURL& origin_url, |
| 34 const std::string& accept_lang, | |
| 35 JavaScriptMessageType javascript_message_type, | 34 JavaScriptMessageType javascript_message_type, |
| 36 const base::string16& message_text, | 35 const base::string16& message_text, |
| 37 const base::string16& default_prompt_text, | 36 const base::string16& default_prompt_text, |
| 38 const DialogClosedCallback& callback, | 37 const DialogClosedCallback& callback, |
| 39 bool* did_suppress_message) = 0; | 38 bool* did_suppress_message) = 0; |
| 40 | 39 |
| 41 // Displays a dialog asking the user if they want to leave a page. | 40 // Displays a dialog asking the user if they want to leave a page. |
| 42 virtual void RunBeforeUnloadDialog(WebContents* web_contents, | 41 virtual void RunBeforeUnloadDialog(WebContents* web_contents, |
| 43 bool is_reload, | 42 bool is_reload, |
| 44 const DialogClosedCallback& callback) = 0; | 43 const DialogClosedCallback& callback) = 0; |
| (...skipping 11 matching lines...) Expand all Loading... |
| 56 | 55 |
| 57 // Reset any saved state tied to the given WebContents. | 56 // Reset any saved state tied to the given WebContents. |
| 58 virtual void ResetDialogState(WebContents* web_contents) = 0; | 57 virtual void ResetDialogState(WebContents* web_contents) = 0; |
| 59 | 58 |
| 60 virtual ~JavaScriptDialogManager() {} | 59 virtual ~JavaScriptDialogManager() {} |
| 61 }; | 60 }; |
| 62 | 61 |
| 63 } // namespace content | 62 } // namespace content |
| 64 | 63 |
| 65 #endif // CONTENT_PUBLIC_BROWSER_JAVASCRIPT_DIALOG_MANAGER_H_ | 64 #endif // CONTENT_PUBLIC_BROWSER_JAVASCRIPT_DIALOG_MANAGER_H_ |
| OLD | NEW |