| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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_JAVASCRIPT_DIALOGS_JAVASCRIPT_DIALOG_TAB_HELPER_H_ | 5 #ifndef CHROME_BROWSER_UI_JAVASCRIPT_DIALOGS_JAVASCRIPT_DIALOG_TAB_HELPER_H_ |
| 6 #define CHROME_BROWSER_UI_JAVASCRIPT_DIALOGS_JAVASCRIPT_DIALOG_TAB_HELPER_H_ | 6 #define CHROME_BROWSER_UI_JAVASCRIPT_DIALOGS_JAVASCRIPT_DIALOG_TAB_HELPER_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 | 9 |
| 10 #include "base/callback_forward.h" | 10 #include "base/callback_forward.h" |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 60 | 60 |
| 61 // WebContentsObserver: | 61 // WebContentsObserver: |
| 62 void WasHidden() override; | 62 void WasHidden() override; |
| 63 | 63 |
| 64 // BrowserListObserver: | 64 // BrowserListObserver: |
| 65 void OnBrowserSetLastActive(Browser* browser) override; | 65 void OnBrowserSetLastActive(Browser* browser) override; |
| 66 | 66 |
| 67 private: | 67 private: |
| 68 friend class content::WebContentsUserData<JavaScriptDialogTabHelper>; | 68 friend class content::WebContentsUserData<JavaScriptDialogTabHelper>; |
| 69 | 69 |
| 70 // Wrapper around a DialogClosedCallback so that we can intercept it before |
| 71 // passing it onto the original callback. |
| 72 void OnDialogClosed(DialogClosedCallback callback, |
| 73 bool success, |
| 74 const base::string16& user_input); |
| 75 |
| 70 void CloseDialog(bool suppress_callback, | 76 void CloseDialog(bool suppress_callback, |
| 71 bool success, | 77 bool success, |
| 72 const base::string16& user_input); | 78 const base::string16& user_input); |
| 73 | 79 |
| 80 void ClearDialogInfo(); |
| 81 |
| 74 // The dialog being displayed on the observed WebContents. | 82 // The dialog being displayed on the observed WebContents. |
| 75 base::WeakPtr<JavaScriptDialog> dialog_; | 83 base::WeakPtr<JavaScriptDialog> dialog_; |
| 76 | 84 |
| 77 // The callback provided for when the dialog is closed. Usually the dialog | 85 // The callback provided for when the dialog is closed. Usually the dialog |
| 78 // itself calls it, but in the cases where the dialog is closed not by the | 86 // itself calls it, but in the cases where the dialog is closed not by the |
| 79 // user's input but by a call to |CloseDialog|, this class will call it. | 87 // user's input but by a call to |CloseDialog|, this class will call it. |
| 80 content::JavaScriptDialogManager::DialogClosedCallback dialog_callback_; | 88 content::JavaScriptDialogManager::DialogClosedCallback dialog_callback_; |
| 81 | 89 |
| 82 base::Closure dialog_shown_; | 90 base::Closure dialog_shown_; |
| 83 | 91 |
| 84 DISALLOW_COPY_AND_ASSIGN(JavaScriptDialogTabHelper); | 92 DISALLOW_COPY_AND_ASSIGN(JavaScriptDialogTabHelper); |
| 85 }; | 93 }; |
| 86 | 94 |
| 87 #endif // CHROME_BROWSER_UI_JAVASCRIPT_DIALOGS_JAVASCRIPT_DIALOG_TAB_HELPER_H_ | 95 #endif // CHROME_BROWSER_UI_JAVASCRIPT_DIALOGS_JAVASCRIPT_DIALOG_TAB_HELPER_H_ |
| OLD | NEW |