[email protected] | c5e22aee5 | 2012-01-19 16:10:51 | [diff] [blame] | 1 | // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
[email protected] | c96531e8 | 2011-01-26 03:11:14 | [diff] [blame] | 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_UI_BROWSER_DIALOGS_H_ |
| 6 | #define CHROME_BROWSER_UI_BROWSER_DIALOGS_H_ |
| 7 | #pragma once |
| 8 | |
| 9 | #include "ipc/ipc_message.h" |
[email protected] | 08397d5 | 2011-02-05 01:53:38 | [diff] [blame] | 10 | #include "ui/gfx/native_widget_types.h" |
[email protected] | c96531e8 | 2011-01-26 03:11:14 | [diff] [blame] | 11 | |
[email protected] | c60e248 | 2011-02-11 23:46:32 | [diff] [blame] | 12 | class Browser; |
[email protected] | eb2d790 | 2011-02-02 18:19:56 | [diff] [blame] | 13 | class Profile; |
[email protected] | c60e248 | 2011-02-11 23:46:32 | [diff] [blame] | 14 | class SkBitmap; |
[email protected] | c36a9e1d | 2012-06-05 14:31:02 | [diff] [blame] | 15 | class TabContents; |
[email protected] | 67baffc8 | 2011-12-19 18:03:07 | [diff] [blame] | 16 | class TabModalConfirmDialogDelegate; |
[email protected] | 02b07597 | 2011-10-19 18:39:00 | [diff] [blame] | 17 | class TemplateURL; |
[email protected] | eb2d790 | 2011-02-02 18:19:56 | [diff] [blame] | 18 | |
[email protected] | 2a6bc3e | 2011-12-28 23:51:33 | [diff] [blame] | 19 | namespace content { |
[email protected] | 6ae4f14 | 2012-06-13 19:48:20 | [diff] [blame^] | 20 | class BrowserContext; |
[email protected] | 2a6bc3e | 2011-12-28 23:51:33 | [diff] [blame] | 21 | class WebContents; |
| 22 | } |
| 23 | |
[email protected] | 1c321ee | 2012-05-21 03:02:34 | [diff] [blame] | 24 | namespace extensions { |
| 25 | class Extension; |
| 26 | } |
| 27 | |
[email protected] | 20c07f8e | 2012-05-31 08:43:14 | [diff] [blame] | 28 | namespace ui { |
| 29 | class WebDialogDelegate; |
| 30 | } |
| 31 | |
[email protected] | c96531e8 | 2011-01-26 03:11:14 | [diff] [blame] | 32 | namespace browser { |
| 33 | |
| 34 | #if defined(IPC_MESSAGE_LOG_ENABLED) |
| 35 | |
| 36 | // The dialog is a singleton. If the dialog is already opened, it won't do |
| 37 | // anything, so you can just blindly call this function all you want. |
| 38 | // This is Called from chrome/browser/browser_about_handler.cc |
| 39 | void ShowAboutIPCDialog(); |
| 40 | |
| 41 | #endif // IPC_MESSAGE_LOG_ENABLED |
| 42 | |
[email protected] | eb2d790 | 2011-02-02 18:19:56 | [diff] [blame] | 43 | // Creates and shows an HTML dialog with the given delegate and profile. |
[email protected] | c5e22aee5 | 2012-01-19 16:10:51 | [diff] [blame] | 44 | // The window is automatically destroyed when it is closed. |browser| can be |
| 45 | // NULL if the profile used is not incognito, otherwise the window will be |
| 46 | // closed if the browser is closed. |
[email protected] | eb2d790 | 2011-02-02 18:19:56 | [diff] [blame] | 47 | // Returns the created window. |
| 48 | // |
| 49 | // Make sure to use the returned window only when you know it is safe |
| 50 | // to do so, i.e. before OnDialogClosed() is called on the delegate. |
[email protected] | 5835871a | 2012-04-25 21:56:55 | [diff] [blame] | 51 | gfx::NativeWindow ShowWebDialog(gfx::NativeWindow parent, |
[email protected] | 6ae4f14 | 2012-06-13 19:48:20 | [diff] [blame^] | 52 | content::BrowserContext* context, |
[email protected] | 20c07f8e | 2012-05-31 08:43:14 | [diff] [blame] | 53 | ui::WebDialogDelegate* delegate); |
[email protected] | eb2d790 | 2011-02-02 18:19:56 | [diff] [blame] | 54 | |
[email protected] | 48a5cd6 | 2012-02-29 20:24:20 | [diff] [blame] | 55 | // Shows the collected cookies dialog box. |
| 56 | void ShowCollectedCookiesDialog(gfx::NativeWindow parent_window, |
[email protected] | 4ebab8ee | 2012-06-11 22:52:01 | [diff] [blame] | 57 | TabContents* tab_contents); |
[email protected] | 48a5cd6 | 2012-02-29 20:24:20 | [diff] [blame] | 58 | |
[email protected] | c60e248 | 2011-02-11 23:46:32 | [diff] [blame] | 59 | // Creates the ExtensionInstalledBubble and schedules it to be shown once |
| 60 | // the extension has loaded. |extension| is the installed extension. |browser| |
| 61 | // is the browser window which will host the bubble. |icon| is the install |
| 62 | // icon of the extension. |
[email protected] | 1c321ee | 2012-05-21 03:02:34 | [diff] [blame] | 63 | void ShowExtensionInstalledBubble(const extensions::Extension* extension, |
[email protected] | c60e248 | 2011-02-11 23:46:32 | [diff] [blame] | 64 | Browser* browser, |
[email protected] | 3562f1b7d | 2011-03-11 04:37:14 | [diff] [blame] | 65 | const SkBitmap& icon, |
[email protected] | c60e248 | 2011-02-11 23:46:32 | [diff] [blame] | 66 | Profile* profile); |
| 67 | |
[email protected] | 2a6bc3e | 2011-12-28 23:51:33 | [diff] [blame] | 68 | // Shows or hide the hung renderer dialog for the given WebContents. |
| 69 | // We need to pass the WebContents to the dialog, because multiple tabs can hang |
[email protected] | 7ec6bef | 2011-02-26 02:22:29 | [diff] [blame] | 70 | // and it needs to keep track of which tabs are currently hung. |
[email protected] | 2a6bc3e | 2011-12-28 23:51:33 | [diff] [blame] | 71 | void ShowHungRendererDialog(content::WebContents* contents); |
| 72 | void HideHungRendererDialog(content::WebContents* contents); |
[email protected] | 7ec6bef | 2011-02-26 02:22:29 | [diff] [blame] | 73 | |
[email protected] | 67baffc8 | 2011-12-19 18:03:07 | [diff] [blame] | 74 | // Shows a tab-modal dialog box. |
| 75 | void ShowTabModalConfirmDialog(TabModalConfirmDialogDelegate* delegate, |
[email protected] | 4ebab8ee | 2012-06-11 22:52:01 | [diff] [blame] | 76 | TabContents* tab_contents); |
[email protected] | 67baffc8 | 2011-12-19 18:03:07 | [diff] [blame] | 77 | |
[email protected] | 02b07597 | 2011-10-19 18:39:00 | [diff] [blame] | 78 | } // namespace browser |
[email protected] | c96531e8 | 2011-01-26 03:11:14 | [diff] [blame] | 79 | |
| 80 | #endif // CHROME_BROWSER_UI_BROWSER_DIALOGS_H_ |