// Copyright 2020 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef WEBLAYER_BROWSER_JAVASCRIPT_TAB_MODAL_DIALOG_MANAGER_DELEGATE_ANDROID_H_ #define WEBLAYER_BROWSER_JAVASCRIPT_TAB_MODAL_DIALOG_MANAGER_DELEGATE_ANDROID_H_ #include "base/memory/raw_ptr.h" #include "components/javascript_dialogs/tab_modal_dialog_manager_delegate.h" namespace content { class WebContents; } namespace weblayer { class JavaScriptTabModalDialogManagerDelegateAndroid : public javascript_dialogs::TabModalDialogManagerDelegate { public: explicit JavaScriptTabModalDialogManagerDelegateAndroid( content::WebContents* web_contents); JavaScriptTabModalDialogManagerDelegateAndroid( const JavaScriptTabModalDialogManagerDelegateAndroid& other) = delete; JavaScriptTabModalDialogManagerDelegateAndroid& operator=( const JavaScriptTabModalDialogManagerDelegateAndroid& other) = delete; ~JavaScriptTabModalDialogManagerDelegateAndroid() override; // javascript_dialogs::TabModalDialogManagerDelegate base::WeakPtr CreateNewDialog( content::WebContents* alerting_web_contents, const std::u16string& title, content::JavaScriptDialogType dialog_type, const std::u16string& message_text, const std::u16string& default_prompt_text, content::JavaScriptDialogManager::DialogClosedCallback dialog_callback, base::OnceClosure dialog_closed_callback) override; void WillRunDialog() override; void DidCloseDialog() override; void SetTabNeedsAttention(bool attention) override; bool IsWebContentsForemost() override; bool IsApp() override; private: raw_ptr web_contents_; }; } // namespace weblayer #endif // WEBLAYER_BROWSER_JAVASCRIPT_TAB_MODAL_DIALOG_MANAGER_DELEGATE_ANDROID_H_