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 "ipc/ipc_message.h" // For IPC_MESSAGE_LOG_ENABLED.
10 #include "third_party/skia/include/core/SkColor.h"
11 #include "ui/gfx/native_widget_types.h"
16 class TabModalConfirmDialogDelegate
;
24 namespace extensions
{
29 class ProfileSigninConfirmationDelegate
;
30 class WebDialogDelegate
;
35 #if defined(IPC_MESSAGE_LOG_ENABLED)
37 // The dialog is a singleton. If the dialog is already opened, it won't do
38 // anything, so you can just blindly call this function all you want.
39 // This is called from chrome/browser/browser_about_handler.cc
40 void ShowAboutIPCDialog();
42 #endif // IPC_MESSAGE_LOG_ENABLED
44 // Creates and shows an HTML dialog with the given delegate and context.
45 // The window is automatically destroyed when it is closed.
46 // Returns the created window.
48 // Make sure to use the returned window only when you know it is safe
49 // to do so, i.e. before OnDialogClosed() is called on the delegate.
50 gfx::NativeWindow
ShowWebDialog(gfx::NativeWindow parent
,
51 content::BrowserContext
* context
,
52 ui::WebDialogDelegate
* delegate
);
54 // Shows the collected cookies dialog box.
55 void ShowCollectedCookiesDialog(content::WebContents
* web_contents
);
57 // Creates the ExtensionInstalledBubble and schedules it to be shown once
58 // the extension has loaded. |extension| is the installed extension. |browser|
59 // is the browser window which will host the bubble. |icon| is the install
60 // icon of the extension.
61 void ShowExtensionInstalledBubble(const extensions::Extension
* extension
,
63 const SkBitmap
& icon
);
65 // Shows or hide the hung renderer dialog for the given WebContents.
66 // We need to pass the WebContents to the dialog, because multiple tabs can hang
67 // and it needs to keep track of which tabs are currently hung.
68 void ShowHungRendererDialog(content::WebContents
* contents
);
69 void HideHungRendererDialog(content::WebContents
* contents
);
71 // Shows the Task Manager. |browser| can be NULL when called from Ash.
72 void ShowTaskManager(Browser
* browser
);
74 #if !defined(OS_MACOSX)
75 // Shows the create web app shortcut dialog box.
76 void ShowCreateWebAppShortcutsDialog(gfx::NativeWindow parent_window
,
77 content::WebContents
* web_contents
);
80 // Shows the create chrome app shortcut dialog box.
81 // On Mac, this creates a shortcut without prompting.
82 // |close_callback| may be null.
83 void ShowCreateChromeAppShortcutsDialog(gfx::NativeWindow parent_window
,
85 const extensions::Extension
* app
,
86 const base::Closure
& close_callback
);
88 // Shows a color chooser that reports to the given WebContents.
89 content::ColorChooser
* ShowColorChooser(content::WebContents
* web_contents
,
90 SkColor initial_color
);
92 void ShowProfileSigninConfirmationDialog(
94 content::WebContents
* web_contents
,
96 const std::string
& username
,
97 ui::ProfileSigninConfirmationDelegate
* delegate
);
100 // Shows the Desktop User Manager with the |profile_path_to_focus| user focused.
101 void ShowUserManager(const base::FilePath
& profile_path_to_focus
);
103 // Hides the User Manager.
104 void HideUserManager();
106 } // namespace chrome
108 #endif // CHROME_BROWSER_UI_BROWSER_DIALOGS_H_