Infobar material design refresh: layout
[chromium-blink-merge.git] / chrome / browser / ui / browser_dialogs.h
bloba0e85be0196eb0e21b3f1b23bf1cf80e05036043
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"
13 class Browser;
14 class GURL;
15 class LoginHandler;
16 class Profile;
17 class SkBitmap;
19 namespace bookmarks {
20 class BookmarkBubbleObserver;
23 namespace content {
24 class BrowserContext;
25 class ColorChooser;
26 struct SSLStatus;
27 class WebContents;
30 namespace extensions {
31 class Extension;
34 namespace gfx {
35 class Point;
38 namespace net {
39 class AuthChallengeInfo;
40 class URLRequest;
43 namespace ui {
44 class WebDialogDelegate;
47 namespace chrome {
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,
64 Browser* browser,
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);
75 #endif
77 // Shows the create chrome app shortcut dialog box.
78 // |close_callback| may be null.
79 void ShowCreateChromeAppShortcutsDialog(
80 gfx::NativeWindow parent_window,
81 Profile* profile,
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,
97 Profile* profile,
98 content::WebContents* web_contents,
99 const GURL& url,
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,
108 Browser* browser,
109 const GURL& url,
110 bool newly_bookmarked);
112 #endif // OS_MACOSX
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,
122 Profile* profile,
123 const BookmarkEditor::EditDetails& details,
124 BookmarkEditor::Configuration configuration);
126 #endif // TOOLKIT_VIEWS
128 } // namespace chrome
130 #endif // CHROME_BROWSER_UI_BROWSER_DIALOGS_H_