1 // Copyright (c) 2011 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. 4 5 #ifndef CHROME_BROWSER_UI_VIEWS_BROWSER_DIALOGS_H_ 6 #define CHROME_BROWSER_UI_VIEWS_BROWSER_DIALOGS_H_ 7 #pragma once 8 9 #include <string> 10 11 #include "ui/gfx/native_widget_types.h" 12 13 // This file contains functions for running a variety of browser dialogs and 14 // popups. The dialogs here are the ones that the caller does not need to 15 // access the class of the popup. It allows us to break dependencies by 16 // allowing the callers to not depend on the classes implementing the dialogs. 17 // TODO: Make as many of these methods as possible cross platform, and move them 18 // into chrome/browser/ui/browser_dialogs.h. 19 20 class BrowserView; 21 class EditSearchEngineControllerDelegate; 22 class Extension; 23 class FindBar; 24 class GURL; 25 class BubbleDelegate; 26 class Profile; 27 class TabContents; 28 class TabContentsWrapper; 29 class TemplateURL; 30 31 namespace gfx { 32 class Rect; 33 class Size; 34 } 35 36 namespace views { 37 class Window; 38 } 39 40 namespace browser { 41 42 // Shows or hides the global bookmark bubble for the star button. 43 void ShowBookmarkBubbleView(views::Window* parent, 44 const gfx::Rect& bounds, 45 BubbleDelegate* delegate, 46 Profile* profile, 47 const GURL& url, 48 bool newly_bookmarked); 49 void HideBookmarkBubbleView(); 50 bool IsBookmarkBubbleViewShowing(); 51 52 // Shows the about dialog. See AboutChromeView. 53 views::Window* ShowAboutChromeView(gfx::NativeWindow parent, 54 Profile* profile); 55 56 // Creates and returns a find bar for the given browser window. See FindBarWin. 57 FindBar* CreateFindBar(BrowserView* browser_view); 58 59 // Shows the Task Manager. 60 void ShowTaskManager(); 61 62 // Shows the Task Manager, highlighting the background pages. 63 void ShowBackgroundPages(); 64 65 #if defined(OS_CHROMEOS) 66 // Shows the Login Wizard. 67 void ShowLoginWizard(const std::string& start_screen, const gfx::Size& size); 68 #endif 69 70 // Shows a dialog box that allows a search engine to be edited. |template_url| 71 // is the search engine being edited. If it is NULL, then the dialog will add a 72 // new search engine with the data the user supplies. |delegate| is an object 73 // to be notified when the user is done editing, or NULL. If NULL, the dialog 74 // will update the model with the user's edits directly. 75 void EditSearchEngine(gfx::NativeWindow parent, 76 const TemplateURL* template_url, 77 EditSearchEngineControllerDelegate* delegate, 78 Profile* profile); 79 80 // Shows the repost form confirmation dialog box. 81 void ShowRepostFormWarningDialog(gfx::NativeWindow parent_window, 82 TabContents* tab_contents); 83 84 // Shows the collected cookies dialog box. 85 void ShowCollectedCookiesDialog(gfx::NativeWindow parent_window, 86 TabContents* tab_contents); 87 88 89 // Shows the create web app shortcut dialog box. 90 void ShowCreateWebAppShortcutsDialog(gfx::NativeWindow parent_window, 91 TabContentsWrapper* tab_contents); 92 93 // Shows the create chrome app shortcut dialog box. 94 void ShowCreateChromeAppShortcutsDialog(gfx::NativeWindow parent_window, 95 Profile* profile, 96 const Extension* app); 97 98 } // namespace browser 99 100 #endif // CHROME_BROWSER_UI_VIEWS_BROWSER_DIALOGS_H_ 101