1 // Copyright (c) 2012 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.
5 #ifndef CHROME_BROWSER_UI_BROWSER_DIALOGS_H_
6 #define CHROME_BROWSER_UI_BROWSER_DIALOGS_H_
8 #include "base/callback.h"
9 #include "chrome/browser/profiles/profile_window.h"
10 #include "content/public/common/signed_certificate_timestamp_id_and_status.h"
11 #include "ipc/ipc_message.h" // For IPC_MESSAGE_LOG_ENABLED.
12 #include "third_party/skia/include/core/SkColor.h"
13 #include "ui/gfx/native_widget_types.h"
18 class TabModalConfirmDialogDelegate
;
26 namespace extensions
{
31 class ProfileSigninConfirmationDelegate
;
32 class WebDialogDelegate
;
37 #if defined(IPC_MESSAGE_LOG_ENABLED)
39 // The dialog is a singleton. If the dialog is already opened, it won't do
40 // anything, so you can just blindly call this function all you want.
41 // This is called from chrome/browser/browser_about_handler.cc
42 void ShowAboutIPCDialog();
44 #endif // IPC_MESSAGE_LOG_ENABLED
46 // Creates and shows an HTML dialog with the given delegate and context.
47 // The window is automatically destroyed when it is closed.
48 // Returns the created window.
50 // Make sure to use the returned window only when you know it is safe
51 // to do so, i.e. before OnDialogClosed() is called on the delegate.
52 gfx::NativeWindow
ShowWebDialog(gfx::NativeWindow parent
,
53 content::BrowserContext
* context
,
54 ui::WebDialogDelegate
* delegate
);
56 // Shows the collected cookies dialog box.
57 void ShowCollectedCookiesDialog(content::WebContents
* web_contents
);
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.
63 void ShowExtensionInstalledBubble(const extensions::Extension
* extension
,
65 const SkBitmap
& icon
);
67 // Shows or hide the hung renderer dialog for the given WebContents.
68 // We need to pass the WebContents to the dialog, because multiple tabs can hang
69 // and it needs to keep track of which tabs are currently hung.
70 void ShowHungRendererDialog(content::WebContents
* contents
);
71 void HideHungRendererDialog(content::WebContents
* contents
);
73 // Shows or hides the Task Manager. |browser| can be NULL when called from Ash.
74 void ShowTaskManager(Browser
* browser
);
75 void HideTaskManager();
77 #if !defined(OS_MACOSX)
78 // Shows the create web app shortcut dialog box.
79 void ShowCreateWebAppShortcutsDialog(gfx::NativeWindow parent_window
,
80 content::WebContents
* web_contents
);
83 // Shows the create chrome app shortcut dialog box.
84 // |close_callback| may be null.
85 void ShowCreateChromeAppShortcutsDialog(
86 gfx::NativeWindow parent_window
,
88 const extensions::Extension
* app
,
89 const base::Callback
<void(bool /* created */)>& close_callback
);
91 // Shows a color chooser that reports to the given WebContents.
92 content::ColorChooser
* ShowColorChooser(content::WebContents
* web_contents
,
93 SkColor initial_color
);
95 void ShowProfileSigninConfirmationDialog(
97 content::WebContents
* web_contents
,
99 const std::string
& username
,
100 ui::ProfileSigninConfirmationDelegate
* delegate
);
102 // Shows the Signed Certificate Timestamps viewer, to view the signed
103 // certificate timestamps in |sct_ids_list|
104 void ShowSignedCertificateTimestampsViewer(
105 content::WebContents
* web_contents
,
106 const content::SignedCertificateTimestampIDStatusList
& sct_ids_list
);
108 // Shows the ManagePasswords bubble for a particular |web_contents|.
109 void ShowManagePasswordsBubble(content::WebContents
* web_contents
);
111 // Closes the bubble if it's shown for |web_contents|.
112 void CloseManagePasswordsBubble(content::WebContents
* web_contents
);
114 } // namespace chrome
116 #endif // CHROME_BROWSER_UI_BROWSER_DIALOGS_H_