Chromium Code Reviews| 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 19 matching lines...) Expand all Loading... | |
| 30 class JavaScriptDialogTabHelper | 30 class JavaScriptDialogTabHelper |
| 31 : public content::JavaScriptDialogManager, | 31 : public content::JavaScriptDialogManager, |
| 32 public content::WebContentsObserver, | 32 public content::WebContentsObserver, |
| 33 public chrome::BrowserListObserver, | 33 public chrome::BrowserListObserver, |
| 34 public content::WebContentsUserData<JavaScriptDialogTabHelper> { | 34 public content::WebContentsUserData<JavaScriptDialogTabHelper> { |
| 35 public: | 35 public: |
| 36 explicit JavaScriptDialogTabHelper(content::WebContents* web_contents); | 36 explicit JavaScriptDialogTabHelper(content::WebContents* web_contents); |
| 37 ~JavaScriptDialogTabHelper() override; | 37 ~JavaScriptDialogTabHelper() override; |
| 38 | 38 |
| 39 void SetDialogShownCallbackForTesting(base::Closure callback); | 39 void SetDialogShownCallbackForTesting(base::Closure callback); |
| 40 bool IsShowingDialogForTesting(); | |
|
Devlin
2017/05/01 17:12:22
drive-by nit: bool IsShowingDialogForTesting() con
Avi (use Gerrit)
2017/05/01 18:55:23
Done.
| |
| 40 | 41 |
| 41 // JavaScriptDialogManager: | 42 // JavaScriptDialogManager: |
| 42 void RunJavaScriptDialog(content::WebContents* web_contents, | 43 void RunJavaScriptDialog(content::WebContents* web_contents, |
| 43 const GURL& origin_url, | 44 const GURL& origin_url, |
| 44 content::JavaScriptDialogType dialog_type, | 45 content::JavaScriptDialogType dialog_type, |
| 45 const base::string16& message_text, | 46 const base::string16& message_text, |
| 46 const base::string16& default_prompt_text, | 47 const base::string16& default_prompt_text, |
| 47 const DialogClosedCallback& callback, | 48 const DialogClosedCallback& callback, |
| 48 bool* did_suppress_message) override; | 49 bool* did_suppress_message) override; |
| 49 void RunBeforeUnloadDialog(content::WebContents* web_contents, | 50 void RunBeforeUnloadDialog(content::WebContents* web_contents, |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 95 // itself calls it, but in the cases where the dialog is closed not by the | 96 // itself calls it, but in the cases where the dialog is closed not by the |
| 96 // user's input but by a call to |CloseDialog|, this class will call it. | 97 // user's input but by a call to |CloseDialog|, this class will call it. |
| 97 content::JavaScriptDialogManager::DialogClosedCallback dialog_callback_; | 98 content::JavaScriptDialogManager::DialogClosedCallback dialog_callback_; |
| 98 | 99 |
| 99 base::Closure dialog_shown_; | 100 base::Closure dialog_shown_; |
| 100 | 101 |
| 101 DISALLOW_COPY_AND_ASSIGN(JavaScriptDialogTabHelper); | 102 DISALLOW_COPY_AND_ASSIGN(JavaScriptDialogTabHelper); |
| 102 }; | 103 }; |
| 103 | 104 |
| 104 #endif // CHROME_BROWSER_UI_JAVASCRIPT_DIALOGS_JAVASCRIPT_DIALOG_TAB_HELPER_H_ | 105 #endif // CHROME_BROWSER_UI_JAVASCRIPT_DIALOGS_JAVASCRIPT_DIALOG_TAB_HELPER_H_ |
| OLD | NEW |