blob: 1fc1508a7e4bc6a168a1a05c0b0f9b7ac7b5a8f6 [file] [log] [blame]
[email protected]c5e22aee52012-01-19 16:10:511// Copyright (c) 2012 The Chromium Authors. All rights reserved.
[email protected]c96531e82011-01-26 03:11:142// 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]08397d52011-02-05 01:53:3810#include "ui/gfx/native_widget_types.h"
[email protected]c96531e82011-01-26 03:11:1411
[email protected]c60e2482011-02-11 23:46:3212class Browser;
[email protected]eb2d7902011-02-02 18:19:5613class Profile;
[email protected]c60e2482011-02-11 23:46:3214class SkBitmap;
[email protected]c36a9e1d2012-06-05 14:31:0215class TabContents;
[email protected]67baffc82011-12-19 18:03:0716class TabModalConfirmDialogDelegate;
[email protected]02b075972011-10-19 18:39:0017class TemplateURL;
[email protected]eb2d7902011-02-02 18:19:5618
[email protected]2a6bc3e2011-12-28 23:51:3319namespace content {
[email protected]6ae4f142012-06-13 19:48:2020class BrowserContext;
[email protected]2a6bc3e2011-12-28 23:51:3321class WebContents;
22}
23
[email protected]1c321ee2012-05-21 03:02:3424namespace extensions {
25class Extension;
26}
27
[email protected]20c07f8e2012-05-31 08:43:1428namespace ui {
29class WebDialogDelegate;
30}
31
[email protected]c96531e82011-01-26 03:11:1432namespace 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
39void ShowAboutIPCDialog();
40
41#endif // IPC_MESSAGE_LOG_ENABLED
42
[email protected]eb2d7902011-02-02 18:19:5643// Creates and shows an HTML dialog with the given delegate and profile.
[email protected]c5e22aee52012-01-19 16:10:5144// 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]eb2d7902011-02-02 18:19:5647// 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]5835871a2012-04-25 21:56:5551gfx::NativeWindow ShowWebDialog(gfx::NativeWindow parent,
[email protected]6ae4f142012-06-13 19:48:2052 content::BrowserContext* context,
[email protected]20c07f8e2012-05-31 08:43:1453 ui::WebDialogDelegate* delegate);
[email protected]eb2d7902011-02-02 18:19:5654
[email protected]48a5cd62012-02-29 20:24:2055// Shows the collected cookies dialog box.
56void ShowCollectedCookiesDialog(gfx::NativeWindow parent_window,
[email protected]4ebab8ee2012-06-11 22:52:0157 TabContents* tab_contents);
[email protected]48a5cd62012-02-29 20:24:2058
[email protected]c60e2482011-02-11 23:46:3259// 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]1c321ee2012-05-21 03:02:3463void ShowExtensionInstalledBubble(const extensions::Extension* extension,
[email protected]c60e2482011-02-11 23:46:3264 Browser* browser,
[email protected]3562f1b7d2011-03-11 04:37:1465 const SkBitmap& icon,
[email protected]c60e2482011-02-11 23:46:3266 Profile* profile);
67
[email protected]2a6bc3e2011-12-28 23:51:3368// 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]7ec6bef2011-02-26 02:22:2970// and it needs to keep track of which tabs are currently hung.
[email protected]2a6bc3e2011-12-28 23:51:3371void ShowHungRendererDialog(content::WebContents* contents);
72void HideHungRendererDialog(content::WebContents* contents);
[email protected]7ec6bef2011-02-26 02:22:2973
[email protected]67baffc82011-12-19 18:03:0774// Shows a tab-modal dialog box.
75void ShowTabModalConfirmDialog(TabModalConfirmDialogDelegate* delegate,
[email protected]4ebab8ee2012-06-11 22:52:0176 TabContents* tab_contents);
[email protected]67baffc82011-12-19 18:03:0777
[email protected]02b075972011-10-19 18:39:0078} // namespace browser
[email protected]c96531e82011-01-26 03:11:1479
80#endif // CHROME_BROWSER_UI_BROWSER_DIALOGS_H_