1 // Copyright 2019 Samsung Electronics. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef BROWSER_WRT_JAVASCRIPT_DIALOG_MANAGER_H_
6 #define BROWSER_WRT_JAVASCRIPT_DIALOG_MANAGER_H_
8 #include "electron/shell/browser/electron_javascript_dialog_manager.h"
9 #include "electron/shell/browser/native_window_observer.h"
12 class JavaScriptModalDialog;
17 class WRTJavaScriptDialogManager
18 : public electron::ElectronJavaScriptDialogManager,
19 public electron::NativeWindowObserver {
21 explicit WRTJavaScriptDialogManager();
22 virtual ~WRTJavaScriptDialogManager();
24 WRTJavaScriptDialogManager(const WRTJavaScriptDialogManager&) = delete;
25 WRTJavaScriptDialogManager& operator=(const WRTJavaScriptDialogManager&)
29 void SetPopupSize(int width, int height);
32 // content::JavaScriptDialogManager implementations.
33 void RunJavaScriptDialog(content::WebContents* web_contents,
34 content::RenderFrameHost* render_frame_host,
35 content::JavaScriptDialogType dialog_type,
36 const std::u16string& message_text,
37 const std::u16string& default_prompt_text,
38 DialogClosedCallback callback,
39 bool* did_suppress_message) override;
40 void RunBeforeUnloadDialog(content::WebContents* web_contents,
41 content::RenderFrameHost* render_frame_host,
43 DialogClosedCallback callback) override;
45 // electron::NativeWindowObserver
46 void OnWindowHide() override;
47 void OnWindowShow() override;
49 #if BUILDFLAG(IS_TIZEN_TV)
50 void CancelDialogs(content::WebContents* web_contents,
51 bool reset_state) override;
52 void OnDialogClosed(content::WebContents* web_contents) override;
55 std::unique_ptr<content::JavaScriptModalDialog> dialog_;
60 #endif // BROWSER_WRT_JAVASCRIPT_DIALOG_MANAGER_H_