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"
20 class BookmarkBubbleObserver
;
30 namespace extensions
{
39 class AuthChallengeInfo
;
44 class WebDialogDelegate
;
49 // Creates and shows an HTML dialog with the given delegate and context.
50 // The window is automatically destroyed when it is closed.
51 // Returns the created window.
53 // Make sure to use the returned window only when you know it is safe
54 // to do so, i.e. before OnDialogClosed() is called on the delegate.
55 gfx::NativeWindow
ShowWebDialog(gfx::NativeView parent
,
56 content::BrowserContext
* context
,
57 ui::WebDialogDelegate
* delegate
);
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 hides the Task Manager. |browser| can be NULL when called from Ash.
68 void ShowTaskManager(Browser
* browser
);
69 void HideTaskManager();
71 #if !defined(OS_MACOSX)
72 // Shows the create web app shortcut dialog box.
73 void ShowCreateWebAppShortcutsDialog(gfx::NativeWindow parent_window
,
74 content::WebContents
* web_contents
);
77 // Shows the create chrome app shortcut dialog box.
78 // |close_callback| may be null.
79 void ShowCreateChromeAppShortcutsDialog(
80 gfx::NativeWindow parent_window
,
82 const extensions::Extension
* app
,
83 const base::Callback
<void(bool /* created */)>& close_callback
);
85 // Shows a color chooser that reports to the given WebContents.
86 content::ColorChooser
* ShowColorChooser(content::WebContents
* web_contents
,
87 SkColor initial_color
);
89 #if defined(OS_MACOSX)
91 // For Mac, returns true if Chrome should show an equivalent toolkit-views based
92 // dialog using one of the functions below, rather than showing a Cocoa dialog.
93 bool ToolkitViewsDialogsEnabled();
95 // Shows a Views website settings bubble at the given anchor point.
96 void ShowWebsiteSettingsBubbleViewsAtPoint(const gfx::Point
& anchor_point
,
98 content::WebContents
* web_contents
,
100 const content::SSLStatus
& ssl
);
102 // Show a Views bookmark bubble at the given point. This occurs when the
103 // bookmark star is clicked or "Bookmark This Page..." is selected from a menu
104 // or via a key equivalent.
105 void ShowBookmarkBubbleViewsAtPoint(const gfx::Point
& anchor_point
,
106 gfx::NativeView parent
,
107 bookmarks::BookmarkBubbleObserver
* observer
,
110 bool newly_bookmarked
);
114 #if defined(TOOLKIT_VIEWS)
116 // Creates a toolkit-views based LoginHandler (e.g. HTTP-Auth dialog).
117 LoginHandler
* CreateLoginHandlerViews(net::AuthChallengeInfo
* auth_info
,
118 net::URLRequest
* request
);
120 // Shows the toolkit-views based BookmarkEditor.
121 void ShowBookmarkEditorViews(gfx::NativeWindow parent_window
,
123 const BookmarkEditor::EditDetails
& details
,
124 BookmarkEditor::Configuration configuration
);
126 #endif // TOOLKIT_VIEWS
128 } // namespace chrome
130 #endif // CHROME_BROWSER_UI_BROWSER_DIALOGS_H_