| OLD | NEW |
| (Empty) | |
| 1 // Copyright (c) 2009 The Chromium Authors. 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. |
| 4 |
| 5 #ifndef CHROME_BROWSER_JSMESSAGE_BOX_CLIENT_H_ |
| 6 #define CHROME_BROWSER_JSMESSAGE_BOX_CLIENT_H_ |
| 7 |
| 8 // JavaScriptMessageBoxClient |
| 9 // |
| 10 // An interface implemented by an object that receives results from JavaScript |
| 11 // message boxes (alert, confirm, and prompt). |
| 12 // |
| 13 |
| 14 #include <string> |
| 15 |
| 16 #include "app/gfx/native_widget_types.h" |
| 17 |
| 18 class GURL; |
| 19 class Profile; |
| 20 class TabContents; |
| 21 namespace IPC { |
| 22 class Message; |
| 23 } |
| 24 |
| 25 class JavaScriptMessageBoxClient { |
| 26 public: |
| 27 virtual ~JavaScriptMessageBoxClient() {} |
| 28 |
| 29 // Returns the title to use for the message box. |
| 30 virtual std::wstring GetMessageBoxTitle(const GURL& frame_url, |
| 31 bool is_alert) = 0; |
| 32 |
| 33 // Returns the root native window with which the message box is associated. |
| 34 virtual gfx::NativeWindow GetMessageBoxRootWindow() = 0; |
| 35 |
| 36 // AppModalDialog calls this when the dialog is closed. |
| 37 virtual void OnMessageBoxClosed(IPC::Message* reply_msg, |
| 38 bool success, |
| 39 const std::wstring& prompt) = 0; |
| 40 |
| 41 // Indicates whether additional message boxes should be suppressed. |
| 42 virtual void SetSuppressMessageBoxes(bool suppress_message_boxes) = 0; |
| 43 |
| 44 // Returns the TabContents associated with this message box -- in practice, |
| 45 // the TabContents implementing this interface -- or NULL if it has no |
| 46 // TabContents (e.g., it's an ExtensionHost). |
| 47 virtual TabContents* AsTabContents() = 0; |
| 48 }; |
| 49 |
| 50 # endif // CHROME_BROWSER_JSMESSAGE_BOX_CLIENT_H_ |
| OLD | NEW |