browser_dialogs.h revision 72a454cd3513ac24fbdd0e0cb9ad70b86a99b801
1// Copyright (c) 2010 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 "chrome/common/content_settings_types.h" 12#include "ui/gfx/native_widget_types.h" 13 14// This file contains functions for running a variety of browser dialogs and 15// popups. The dialogs here are the ones that the caller does not need to 16// access the class of the popup. It allows us to break dependencies by 17// allowing the callers to not depend on the classes implementing the dialogs. 18// TODO: Make as many of these methods as possible cross platform, and move them 19// into chrome/browser/ui/browser_dialogs.h. 20 21class Browser; 22class BrowserView; 23class EditSearchEngineControllerDelegate; 24class Extension; 25class FilePath; 26class FindBar; 27class GURL; 28class InfoBubbleDelegate; 29class Profile; 30class TabContents; 31class TemplateURL; 32 33namespace gfx { 34class Rect; 35class Size; 36} // namespace gfx 37 38namespace views { 39class Widget; 40class Window; 41} // namespace views 42 43namespace browser { 44 45// Shows the "Report a problem with this page" dialog box. See BugReportView. 46void ShowBugReportView(views::Window* parent, 47 Profile* profile, 48 TabContents* tab); 49 50// Shows the "Clear browsing data" dialog box. See ClearBrowsingDataView. 51void ShowClearBrowsingDataView(gfx::NativeWindow parent, 52 Profile* profile); 53 54// Shows the "Importer" dialog. See ImporterView. 55void ShowImporterView(views::Widget* parent, 56 Profile* profile); 57 58// Shows or hides the global bookmark bubble for the star button. 59void ShowBookmarkBubbleView(views::Window* parent, 60 const gfx::Rect& bounds, 61 InfoBubbleDelegate* delegate, 62 Profile* profile, 63 const GURL& url, 64 bool newly_bookmarked); 65void HideBookmarkBubbleView(); 66bool IsBookmarkBubbleViewShowing(); 67 68// Shows the bookmark manager. 69void ShowBookmarkManagerView(Profile* profile); 70 71// Shows the about dialog. See AboutChromeView. 72views::Window* ShowAboutChromeView(gfx::NativeWindow parent, 73 Profile* profile); 74 75// Creates and returns a find bar for the given browser window. See FindBarWin. 76FindBar* CreateFindBar(BrowserView* browser_view); 77 78// Shows the "Save passwords and exceptions" dialog. 79// See PasswordsExceptionsWindowView. 80void ShowPasswordsExceptionsWindowView(Profile* profile); 81 82// Shows the keyword editor. See KeywordEditorView. 83void ShowKeywordEditorView(Profile* profile); 84 85// Shows the Task Manager. 86void ShowTaskManager(); 87 88// Shows the Task Manager, highlighting the background pages. 89void ShowBackgroundPages(); 90 91#if defined(OS_CHROMEOS) 92// Shows the Login Wizard. 93void ShowLoginWizard(const std::string& start_screen, const gfx::Size& size); 94#endif 95 96// Shows a dialog box that allows a search engine to be edited. |template_url| 97// is the search engine being edited. If it is NULL, then the dialog will add a 98// new search engine with the data the user supplies. |delegate| is an object 99// to be notified when the user is done editing, or NULL. If NULL, the dialog 100// will update the model with the user's edits directly. 101void EditSearchEngine(gfx::NativeWindow parent, 102 const TemplateURL* template_url, 103 EditSearchEngineControllerDelegate* delegate, 104 Profile* profile); 105 106// Shows the repost form confirmation dialog box. 107void ShowRepostFormWarningDialog(gfx::NativeWindow parent_window, 108 TabContents* tab_contents); 109 110// Shows the content settings dialog box. 111void ShowContentSettingsWindow(gfx::NativeWindow parent_window, 112 ContentSettingsType content_type, 113 Profile* profile); 114 115// Shows the collected cookies dialog box. 116void ShowCollectedCookiesDialog(gfx::NativeWindow parent_window, 117 TabContents* tab_contents); 118 119 120// Shows the create web app shortcut dialog box. 121void ShowCreateWebAppShortcutsDialog(gfx::NativeWindow parent_window, 122 TabContents* tab_contents); 123 124// Shows the create chrome app shortcut dialog box. 125void ShowCreateChromeAppShortcutsDialog(gfx::NativeWindow parent_window, 126 Profile* profile, 127 const Extension* app); 128 129} // namespace browser 130 131#endif // CHROME_BROWSER_UI_VIEWS_BROWSER_DIALOGS_H_ 132