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/ssl/security_state_model.h"
10 #include "chrome/browser/ui/bookmarks/bookmark_editor.h"
11 #include "third_party/skia/include/core/SkColor.h"
12 #include "ui/gfx/native_widget_types.h"
21 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(
97 const gfx::Point
& anchor_point
,
99 content::WebContents
* web_contents
,
101 const SecurityStateModel::SecurityInfo
& security_info
);
103 // Show a Views bookmark bubble at the given point. This occurs when the
104 // bookmark star is clicked or "Bookmark This Page..." is selected from a menu
105 // or via a key equivalent.
106 void ShowBookmarkBubbleViewsAtPoint(const gfx::Point
& anchor_point
,
107 gfx::NativeView parent
,
108 bookmarks::BookmarkBubbleObserver
* observer
,
111 bool newly_bookmarked
);
115 #if defined(TOOLKIT_VIEWS)
117 // Creates a toolkit-views based LoginHandler (e.g. HTTP-Auth dialog).
118 LoginHandler
* CreateLoginHandlerViews(net::AuthChallengeInfo
* auth_info
,
119 net::URLRequest
* request
);
121 // Shows the toolkit-views based BookmarkEditor.
122 void ShowBookmarkEditorViews(gfx::NativeWindow parent_window
,
124 const BookmarkEditor::EditDetails
& details
,
125 BookmarkEditor::Configuration configuration
);
127 #endif // TOOLKIT_VIEWS
129 } // namespace chrome
131 #endif // CHROME_BROWSER_UI_BROWSER_DIALOGS_H_