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/ui/bookmarks/bookmark_editor.h"
10 #include "third_party/skia/include/core/SkColor.h"
11 #include "ui/gfx/native_widget_types.h"
26 namespace extensions
{
35 class AuthChallengeInfo
;
40 class WebDialogDelegate
;
45 // Creates and shows an HTML dialog with the given delegate and context.
46 // The window is automatically destroyed when it is closed.
47 // Returns the created window.
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.
51 gfx::NativeWindow
ShowWebDialog(gfx::NativeView parent
,
52 content::BrowserContext
* context
,
53 ui::WebDialogDelegate
* delegate
);
55 // Creates the ExtensionInstalledBubble and schedules it to be shown once
56 // the extension has loaded. |extension| is the installed extension. |browser|
57 // is the browser window which will host the bubble. |icon| is the install
58 // icon of the extension.
59 void ShowExtensionInstalledBubble(const extensions::Extension
* extension
,
61 const SkBitmap
& icon
);
63 // Shows or hides the Task Manager. |browser| can be NULL when called from Ash.
64 void ShowTaskManager(Browser
* browser
);
65 void HideTaskManager();
67 #if !defined(OS_MACOSX)
68 // Shows the create web app shortcut dialog box.
69 void ShowCreateWebAppShortcutsDialog(gfx::NativeWindow parent_window
,
70 content::WebContents
* web_contents
);
73 // Shows the create chrome app shortcut dialog box.
74 // |close_callback| may be null.
75 void ShowCreateChromeAppShortcutsDialog(
76 gfx::NativeWindow parent_window
,
78 const extensions::Extension
* app
,
79 const base::Callback
<void(bool /* created */)>& close_callback
);
81 // Shows a color chooser that reports to the given WebContents.
82 content::ColorChooser
* ShowColorChooser(content::WebContents
* web_contents
,
83 SkColor initial_color
);
85 #if defined(OS_MACOSX)
87 // For Mac, returns true if Chrome should show an equivalent toolkit-views based
88 // dialog using one of the functions below, rather than showing a Cocoa dialog.
89 bool ToolkitViewsDialogsEnabled();
91 // Shows a Views website settings bubble at the given anchor point.
92 void ShowWebsiteSettingsBubbleViewsAtPoint(const gfx::Point
& anchor_point
,
94 content::WebContents
* web_contents
,
96 const content::SSLStatus
& ssl
);
100 #if defined(TOOLKIT_VIEWS)
102 // Creates a toolkit-views based LoginHandler (e.g. HTTP-Auth dialog).
103 LoginHandler
* CreateLoginHandlerViews(net::AuthChallengeInfo
* auth_info
,
104 net::URLRequest
* request
);
106 // Shows the toolkit-views based BookmarkEditor.
107 void ShowBookmarkEditorViews(gfx::NativeWindow parent_window
,
109 const BookmarkEditor::EditDetails
& details
,
110 BookmarkEditor::Configuration configuration
);
112 #endif // TOOLKIT_VIEWS
114 } // namespace chrome
116 #endif // CHROME_BROWSER_UI_BROWSER_DIALOGS_H_