15821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Copyright (c) 2012 The Chromium Authors. All rights reserved.
25821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Use of this source code is governed by a BSD-style license that can be
35821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// found in the LICENSE file.
45821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
55821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#ifndef CHROME_BROWSER_UI_BROWSER_DIALOGS_H_
65821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#define CHROME_BROWSER_UI_BROWSER_DIALOGS_H_
75821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
8868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)#include "base/callback.h"
95821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#include "ipc/ipc_message.h"  // For IPC_MESSAGE_LOG_ENABLED.
1090dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles)#include "third_party/skia/include/core/SkColor.h"
115821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#include "ui/gfx/native_widget_types.h"
125821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
135821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)class Browser;
14868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)class Profile;
155821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)class SkBitmap;
165821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)class TabModalConfirmDialogDelegate;
175821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
185821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)namespace content {
195821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)class BrowserContext;
2090dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles)class ColorChooser;
215821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)class WebContents;
225821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)}
235821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
245821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)namespace extensions {
255821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)class Extension;
265821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)}
275821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
285821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)namespace ui {
29868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)class ProfileSigninConfirmationDelegate;
305821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)class WebDialogDelegate;
315821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)}
325821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
335821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)namespace chrome {
345821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
355821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#if defined(IPC_MESSAGE_LOG_ENABLED)
365821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
375821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// The dialog is a singleton. If the dialog is already opened, it won't do
385821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// anything, so you can just blindly call this function all you want.
395821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// This is called from chrome/browser/browser_about_handler.cc
405821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)void ShowAboutIPCDialog();
415821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
425821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#endif  // IPC_MESSAGE_LOG_ENABLED
435821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
445821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Creates and shows an HTML dialog with the given delegate and context.
455821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// The window is automatically destroyed when it is closed.
465821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Returns the created window.
475821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)//
485821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Make sure to use the returned window only when you know it is safe
495821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// to do so, i.e. before OnDialogClosed() is called on the delegate.
505821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)gfx::NativeWindow ShowWebDialog(gfx::NativeWindow parent,
515821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)                                content::BrowserContext* context,
525821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)                                ui::WebDialogDelegate* delegate);
535821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
545821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Shows the collected cookies dialog box.
555821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)void ShowCollectedCookiesDialog(content::WebContents* web_contents);
565821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
575821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Creates the ExtensionInstalledBubble and schedules it to be shown once
585821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// the extension has loaded. |extension| is the installed extension. |browser|
595821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// is the browser window which will host the bubble. |icon| is the install
605821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// icon of the extension.
615821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)void ShowExtensionInstalledBubble(const extensions::Extension* extension,
625821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)                                  Browser* browser,
635821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)                                  const SkBitmap& icon);
645821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
655821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Shows or hide the hung renderer dialog for the given WebContents.
665821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// We need to pass the WebContents to the dialog, because multiple tabs can hang
675821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// and it needs to keep track of which tabs are currently hung.
685821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)void ShowHungRendererDialog(content::WebContents* contents);
695821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)void HideHungRendererDialog(content::WebContents* contents);
705821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
71eb525c5499e34cc9c4b825d6d9e75bb07cc06aceBen Murdoch// Shows the Task Manager. |browser| can be NULL when called from Ash.
72eb525c5499e34cc9c4b825d6d9e75bb07cc06aceBen Murdochvoid ShowTaskManager(Browser* browser);
732a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)
745821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#if !defined(OS_MACOSX)
755821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Shows the create web app shortcut dialog box.
765821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)void ShowCreateWebAppShortcutsDialog(gfx::NativeWindow parent_window,
772a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)                                     content::WebContents* web_contents);
785821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#endif
795821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
808bcbed890bc3ce4d7a057a8f32cab53fa534672eTorne (Richard Coles)// Shows the create chrome app shortcut dialog box.
818bcbed890bc3ce4d7a057a8f32cab53fa534672eTorne (Richard Coles)// On Mac, this creates a shortcut without prompting.
828bcbed890bc3ce4d7a057a8f32cab53fa534672eTorne (Richard Coles)// |close_callback| may be null.
838bcbed890bc3ce4d7a057a8f32cab53fa534672eTorne (Richard Coles)void ShowCreateChromeAppShortcutsDialog(gfx::NativeWindow parent_window,
848bcbed890bc3ce4d7a057a8f32cab53fa534672eTorne (Richard Coles)                                        Profile* profile,
858bcbed890bc3ce4d7a057a8f32cab53fa534672eTorne (Richard Coles)                                        const extensions::Extension* app,
868bcbed890bc3ce4d7a057a8f32cab53fa534672eTorne (Richard Coles)                                        const base::Closure& close_callback);
878bcbed890bc3ce4d7a057a8f32cab53fa534672eTorne (Richard Coles)
8890dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles)// Shows a color chooser that reports to the given WebContents.
8990dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles)content::ColorChooser* ShowColorChooser(content::WebContents* web_contents,
9090dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles)                                        SkColor initial_color);
9190dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles)
92868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)void ShowProfileSigninConfirmationDialog(
93868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)    Browser* browser,
94868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)    content::WebContents* web_contents,
95868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)    Profile* profile,
96868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)    const std::string& username,
97868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)    ui::ProfileSigninConfirmationDelegate* delegate);
98868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)
990f1bc08d4cfcc34181b0b5cbf065c40f687bf740Torne (Richard Coles)
1000f1bc08d4cfcc34181b0b5cbf065c40f687bf740Torne (Richard Coles)// Shows the Desktop User Manager with the |profile_path_to_focus| user focused.
1010f1bc08d4cfcc34181b0b5cbf065c40f687bf740Torne (Richard Coles)void ShowUserManager(const base::FilePath& profile_path_to_focus);
1020f1bc08d4cfcc34181b0b5cbf065c40f687bf740Torne (Richard Coles)
1030f1bc08d4cfcc34181b0b5cbf065c40f687bf740Torne (Richard Coles)// Hides the User Manager.
1040f1bc08d4cfcc34181b0b5cbf065c40f687bf740Torne (Richard Coles)void HideUserManager();
1050f1bc08d4cfcc34181b0b5cbf065c40f687bf740Torne (Richard Coles)
1065821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)}  // namespace chrome
1075821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
1085821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#endif  // CHROME_BROWSER_UI_BROWSER_DIALOGS_H_
109