BookmarkManager: Fix 'new folder text field size changes on clicking it' issue.
[chromium-blink-merge.git] / chrome / browser / ui / browser_dialogs.h
blob8efa5cd5f02db147b572b032146e933a91958db6
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"
14 class Browser;
15 class GURL;
16 class LoginHandler;
17 class Profile;
18 class SkBitmap;
20 namespace bookmarks {
21 class BookmarkBubbleObserver;
24 namespace content {
25 class BrowserContext;
26 class ColorChooser;
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(
97 const gfx::Point& anchor_point,
98 Profile* profile,
99 content::WebContents* web_contents,
100 const GURL& url,
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,
109 Browser* browser,
110 const GURL& url,
111 bool newly_bookmarked);
113 #endif // OS_MACOSX
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,
123 Profile* profile,
124 const BookmarkEditor::EditDetails& details,
125 BookmarkEditor::Configuration configuration);
127 #endif // TOOLKIT_VIEWS
129 } // namespace chrome
131 #endif // CHROME_BROWSER_UI_BROWSER_DIALOGS_H_