[email protected] | c5e22aee5 | 2012-01-19 16:10:51 | [diff] [blame] | 1 | // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
[email protected] | c96531e8 | 2011-01-26 03:11:14 | [diff] [blame] | 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_BROWSER_DIALOGS_H_ |
| 6 | #define CHROME_BROWSER_UI_BROWSER_DIALOGS_H_ |
[email protected] | c96531e8 | 2011-01-26 03:11:14 | [diff] [blame] | 7 | |
David Benjamin | 78fe596 | 2019-01-29 22:22:38 | [diff] [blame] | 8 | #include <memory> |
djacobo | 21e56e0 | 2016-07-02 01:14:31 | [diff] [blame] | 9 | #include <string> |
| 10 | #include <utility> |
| 11 | #include <vector> |
| 12 | |
[email protected] | 6684dc816 | 2013-06-03 14:05:08 | [diff] [blame] | 13 | #include "base/callback.h" |
constantina | e4c513e7 | 2017-02-07 02:14:10 | [diff] [blame] | 14 | #include "base/optional.h" |
| 15 | #include "base/strings/string16.h" |
avi | 655876a | 2015-12-25 07:18:15 | [diff] [blame] | 16 | #include "build/build_config.h" |
jackhou | b42a1f3d | 2015-08-24 05:53:28 | [diff] [blame] | 17 | #include "chrome/browser/ui/bookmarks/bookmark_editor.h" |
Mark Pilgrim | 7cfcd11 | 2018-05-08 00:07:56 | [diff] [blame] | 18 | #include "content/public/browser/content_browser_client.h" |
Devlin Cronin | 5739bf0 | 2020-05-15 00:38:38 | [diff] [blame^] | 19 | #include "extensions/buildflags/buildflags.h" |
[email protected] | cb80545 | 2013-05-22 15:16:21 | [diff] [blame] | 20 | #include "third_party/skia/include/core/SkColor.h" |
[email protected] | 08397d5 | 2011-02-05 01:53:38 | [diff] [blame] | 21 | #include "ui/gfx/native_widget_types.h" |
[email protected] | c96531e8 | 2011-01-26 03:11:14 | [diff] [blame] | 22 | |
[email protected] | c60e248 | 2011-02-11 23:46:32 | [diff] [blame] | 23 | class Browser; |
Elly Fong-Jones | f260d67 | 2020-03-16 14:09:07 | [diff] [blame] | 24 | class ChooserController; |
tapted | 081286e | 2015-08-10 06:36:30 | [diff] [blame] | 25 | class LoginHandler; |
[email protected] | 6684dc816 | 2013-06-03 14:05:08 | [diff] [blame] | 26 | class Profile; |
tapted | 712c1b8 | 2017-06-08 03:10:05 | [diff] [blame] | 27 | struct WebApplicationInfo; |
[email protected] | eb2d790 | 2011-02-02 18:19:56 | [diff] [blame] | 28 | |
Devlin Cronin | 5739bf0 | 2020-05-15 00:38:38 | [diff] [blame^] | 29 | #if BUILDFLAG(ENABLE_EXTENSIONS) |
| 30 | class SettingsOverriddenDialogController; |
| 31 | #endif |
| 32 | |
Peter Boström | 2a02a69 | 2018-02-22 22:25:46 | [diff] [blame] | 33 | namespace base { |
| 34 | class FilePath; |
| 35 | } |
| 36 | |
[email protected] | 2a6bc3e | 2011-12-28 23:51:33 | [diff] [blame] | 37 | namespace content { |
[email protected] | 6ae4f14 | 2012-06-13 19:48:20 | [diff] [blame] | 38 | class BrowserContext; |
[email protected] | 2a6bc3e | 2011-12-28 23:51:33 | [diff] [blame] | 39 | class WebContents; |
Josh Pratt | f80ffb8 | 2019-01-22 07:13:51 | [diff] [blame] | 40 | } // namespace content |
[email protected] | 2a6bc3e | 2011-12-28 23:51:33 | [diff] [blame] | 41 | |
[email protected] | 1c321ee | 2012-05-21 03:02:34 | [diff] [blame] | 42 | namespace extensions { |
| 43 | class Extension; |
| 44 | } |
| 45 | |
tapted | 081286e | 2015-08-10 06:36:30 | [diff] [blame] | 46 | namespace net { |
| 47 | class AuthChallengeInfo; |
tapted | 081286e | 2015-08-10 06:36:30 | [diff] [blame] | 48 | } |
| 49 | |
Clark DuVall | 732778e | 2020-01-27 18:13:58 | [diff] [blame] | 50 | namespace permissions { |
| 51 | enum class PermissionAction; |
| 52 | } |
| 53 | |
alito | e82b14b | 2017-04-06 23:11:29 | [diff] [blame] | 54 | namespace safe_browsing { |
Ali Tofigh | f5baba98 | 2017-07-21 23:15:23 | [diff] [blame] | 55 | class ChromeCleanerController; |
alito | f8f753f6 | 2017-04-28 23:04:10 | [diff] [blame] | 56 | class ChromeCleanerDialogController; |
Fabio Tirelo | 8825aab4 | 2017-10-19 13:23:31 | [diff] [blame] | 57 | class ChromeCleanerRebootDialogController; |
Ali Tofigh | 525f78bdd | 2017-09-15 15:37:20 | [diff] [blame] | 58 | class SettingsResetPromptController; |
Josh Pratt | f80ffb8 | 2019-01-22 07:13:51 | [diff] [blame] | 59 | } // namespace safe_browsing |
alito | e82b14b | 2017-04-06 23:11:29 | [diff] [blame] | 60 | |
avi | 24d693f | 2016-08-06 18:03:52 | [diff] [blame] | 61 | namespace task_manager { |
nick | bb57d2ca | 2016-07-25 23:08:04 | [diff] [blame] | 62 | class TaskManagerTableModel; |
| 63 | } |
| 64 | |
[email protected] | 20c07f8e | 2012-05-31 08:43:14 | [diff] [blame] | 65 | namespace ui { |
| 66 | class WebDialogDelegate; |
Peter Boström | 2a02a69 | 2018-02-22 22:25:46 | [diff] [blame] | 67 | struct SelectedFileInfo; |
Josh Pratt | f80ffb8 | 2019-01-22 07:13:51 | [diff] [blame] | 68 | } // namespace ui |
[email protected] | 20c07f8e | 2012-05-31 08:43:14 | [diff] [blame] | 69 | |
[email protected] | 87586fb7 | 2012-07-02 13:15:02 | [diff] [blame] | 70 | namespace chrome { |
[email protected] | c96531e8 | 2011-01-26 03:11:14 | [diff] [blame] | 71 | |
tapted | e0eec37 | 2016-01-28 02:45:33 | [diff] [blame] | 72 | // Shows or hides the Task Manager. |browser| can be NULL when called from Ash. |
nick | 399f1066 | 2016-05-06 16:20:26 | [diff] [blame] | 73 | // Returns a pointer to the underlying TableModel, which can be ignored, or used |
| 74 | // for testing. |
avi | 24d693f | 2016-08-06 18:03:52 | [diff] [blame] | 75 | task_manager::TaskManagerTableModel* ShowTaskManager(Browser* browser); |
tapted | e0eec37 | 2016-01-28 02:45:33 | [diff] [blame] | 76 | void HideTaskManager(); |
| 77 | |
[email protected] | d7db4cd | 2012-06-27 04:58:44 | [diff] [blame] | 78 | // Creates and shows an HTML dialog with the given delegate and context. |
| 79 | // The window is automatically destroyed when it is closed. |
[email protected] | eb2d790 | 2011-02-02 18:19:56 | [diff] [blame] | 80 | // Returns the created window. |
| 81 | // |
| 82 | // Make sure to use the returned window only when you know it is safe |
| 83 | // to do so, i.e. before OnDialogClosed() is called on the delegate. |
andresantoso | ba3ef5d7 | 2014-12-15 20:30:08 | [diff] [blame] | 84 | gfx::NativeWindow ShowWebDialog(gfx::NativeView parent, |
[email protected] | 6ae4f14 | 2012-06-13 19:48:20 | [diff] [blame] | 85 | content::BrowserContext* context, |
[email protected] | 20c07f8e | 2012-05-31 08:43:14 | [diff] [blame] | 86 | ui::WebDialogDelegate* delegate); |
[email protected] | eb2d790 | 2011-02-02 18:19:56 | [diff] [blame] | 87 | |
[email protected] | 497783c | 2013-10-17 15:54:57 | [diff] [blame] | 88 | // Shows the create chrome app shortcut dialog box. |
[email protected] | 497783c | 2013-10-17 15:54:57 | [diff] [blame] | 89 | // |close_callback| may be null. |
[email protected] | 1148990bb | 2014-05-02 10:04:02 | [diff] [blame] | 90 | void ShowCreateChromeAppShortcutsDialog( |
| 91 | gfx::NativeWindow parent_window, |
| 92 | Profile* profile, |
| 93 | const extensions::Extension* app, |
| 94 | const base::Callback<void(bool /* created */)>& close_callback); |
[email protected] | 497783c | 2013-10-17 15:54:57 | [diff] [blame] | 95 | |
Daniel Murphy | 8e600e58 | 2020-04-09 21:41:57 | [diff] [blame] | 96 | // Shows the create chrome app shortcut dialog box. Same as above but for a |
| 97 | // WebApp instead of an Extension. |close_callback| may be null. |
| 98 | void ShowCreateChromeAppShortcutsDialog( |
| 99 | gfx::NativeWindow parent_window, |
| 100 | Profile* profile, |
| 101 | const std::string& web_app_id, |
| 102 | const base::Callback<void(bool /* created */)>& close_callback); |
| 103 | |
Michael McGreevy | 556227a5 | 2017-11-16 07:47:24 | [diff] [blame] | 104 | // Callback used to indicate whether a user has accepted the installation of a |
| 105 | // web app. The boolean parameter is true when the user accepts the dialog. The |
| 106 | // WebApplicationInfo parameter contains the information about the app, |
| 107 | // possibly modified by the user. |
| 108 | using AppInstallationAcceptanceCallback = |
Eric Willigers | 61bb4da | 2019-05-10 20:38:45 | [diff] [blame] | 109 | base::OnceCallback<void(bool, std::unique_ptr<WebApplicationInfo>)>; |
tapted | 712c1b8 | 2017-06-08 03:10:05 | [diff] [blame] | 110 | |
phillis | b3f540a5 | 2020-05-14 20:00:50 | [diff] [blame] | 111 | // Shows the Web App install bubble. |
tapted | 712c1b8 | 2017-06-08 03:10:05 | [diff] [blame] | 112 | // |
| 113 | // |web_app_info| is the WebApplicationInfo being converted into an app. |
Eric Willigers | b5235c5 | 2020-03-03 03:09:13 | [diff] [blame] | 114 | // |web_app_info.app_url| should contain a start url from a web app manifest |
| 115 | // (for a Desktop PWA), or the current url (when creating a shortcut app). |
phillis | b3f540a5 | 2020-05-14 20:00:50 | [diff] [blame] | 116 | void ShowWebAppInstallDialog(content::WebContents* web_contents, |
| 117 | std::unique_ptr<WebApplicationInfo> web_app_info, |
| 118 | AppInstallationAcceptanceCallback callback); |
Michael McGreevy | 556227a5 | 2017-11-16 07:47:24 | [diff] [blame] | 119 | |
Eric Willigers | b5235c5 | 2020-03-03 03:09:13 | [diff] [blame] | 120 | // Sets whether |ShowWebAppDialog| should accept immediately without any |
Jeevan Shikaram | d9491e5 | 2019-12-05 04:05:49 | [diff] [blame] | 121 | // user interaction. |auto_open_in_window| sets whether the open in window |
| 122 | // checkbox is checked. |
Eric Willigers | b5235c5 | 2020-03-03 03:09:13 | [diff] [blame] | 123 | void SetAutoAcceptWebAppDialogForTesting(bool auto_accept, |
| 124 | bool auto_open_in_window); |
Alan Cutter | 81ac72668 | 2018-09-25 00:18:36 | [diff] [blame] | 125 | |
Alan Cutter | f0d263f | 2019-04-16 14:46:16 | [diff] [blame] | 126 | // Shows the PWA installation confirmation bubble anchored off the PWA install |
| 127 | // icon in the omnibox. |
| 128 | // |
| 129 | // |web_app_info| is the WebApplicationInfo to be installed. |
| 130 | void ShowPWAInstallBubble(content::WebContents* web_contents, |
Eric Willigers | bf1e5ed | 2019-05-14 04:56:17 | [diff] [blame] | 131 | std::unique_ptr<WebApplicationInfo> web_app_info, |
Alan Cutter | f0d263f | 2019-04-16 14:46:16 | [diff] [blame] | 132 | AppInstallationAcceptanceCallback callback); |
| 133 | |
Alan Cutter | a0ccba08 | 2019-12-20 00:41:34 | [diff] [blame] | 134 | // Sets whether |ShowPWAInstallBubble| should accept immediately without any |
| 135 | // user interaction. |
Alan Cutter | f0d263f | 2019-04-16 14:46:16 | [diff] [blame] | 136 | void SetAutoAcceptPWAInstallConfirmationForTesting(bool auto_accept); |
Alan Cutter | 81ac72668 | 2018-09-25 00:18:36 | [diff] [blame] | 137 | |
Nikita Podguzov | 107cccc1 | 2020-02-04 17:57:05 | [diff] [blame] | 138 | #if defined(OS_CHROMEOS) |
| 139 | |
| 140 | // Shows the print job confirmation dialog bubble anchored to the toolbar icon |
| 141 | // for the extension. |
| 142 | // If there's no toolbar icon, shows a modal dialog using |
| 143 | // CreateBrowserModalDialogViews(). Note that this dialog is shown up even if we |
| 144 | // have no |parent| window. |
| 145 | void ShowPrintJobConfirmationDialog(gfx::NativeWindow parent, |
| 146 | const std::string& extension_id, |
| 147 | const base::string16& extension_name, |
| 148 | const gfx::ImageSkia& extension_icon, |
| 149 | const base::string16& print_job_title, |
| 150 | const base::string16& printer_name, |
| 151 | base::OnceCallback<void(bool)> callback); |
| 152 | |
| 153 | #endif // OS_CHROMEOS |
| 154 | |
tapted | 081286e | 2015-08-10 06:36:30 | [diff] [blame] | 155 | #if defined(OS_MACOSX) |
| 156 | |
spqchan | d33344a | 2016-04-13 02:10:51 | [diff] [blame] | 157 | // Bridging methods that show/hide the toolkit-views based Task Manager on Mac. |
avi | 24d693f | 2016-08-06 18:03:52 | [diff] [blame] | 158 | task_manager::TaskManagerTableModel* ShowTaskManagerViews(Browser* browser); |
spqchan | d33344a | 2016-04-13 02:10:51 | [diff] [blame] | 159 | void HideTaskManagerViews(); |
| 160 | |
tapted | 081286e | 2015-08-10 06:36:30 | [diff] [blame] | 161 | #endif // OS_MACOSX |
| 162 | |
| 163 | #if defined(TOOLKIT_VIEWS) |
| 164 | |
| 165 | // Creates a toolkit-views based LoginHandler (e.g. HTTP-Auth dialog). |
David Benjamin | 78fe596 | 2019-01-29 22:22:38 | [diff] [blame] | 166 | std::unique_ptr<LoginHandler> CreateLoginHandlerViews( |
Emily Stark | f2c9bbd | 2019-04-09 17:08:58 | [diff] [blame] | 167 | const net::AuthChallengeInfo& auth_info, |
David Benjamin | 78fe596 | 2019-01-29 22:22:38 | [diff] [blame] | 168 | content::WebContents* web_contents, |
Mark Pilgrim | 7cfcd11 | 2018-05-08 00:07:56 | [diff] [blame] | 169 | LoginAuthRequiredCallback auth_required_callback); |
tapted | 081286e | 2015-08-10 06:36:30 | [diff] [blame] | 170 | |
tapted | 081286e | 2015-08-10 06:36:30 | [diff] [blame] | 171 | #endif // TOOLKIT_VIEWS |
| 172 | |
pdyson | 7872d6c0 | 2017-04-05 23:12:31 | [diff] [blame] | 173 | // Values used in the Dialog.Creation UMA metric. Each value represents a |
| 174 | // different type of dialog box. |
| 175 | // These values are written to logs. New enum values can be added, but existing |
| 176 | // enums must never be renumbered or deleted and reused. |
pdyson | a8a9ea0 | 2017-04-20 00:00:15 | [diff] [blame] | 177 | enum class DialogIdentifier { |
| 178 | UNKNOWN = 0, |
| 179 | TRANSLATE = 1, |
| 180 | BOOKMARK = 2, |
| 181 | BOOKMARK_EDITOR = 3, |
| 182 | DESKTOP_MEDIA_PICKER = 4, |
| 183 | OUTDATED_UPGRADE = 5, |
| 184 | ONE_CLICK_SIGNIN = 6, |
| 185 | PROFILE_SIGNIN_CONFIRMATION = 7, |
| 186 | HUNG_RENDERER = 8, |
| 187 | SESSION_CRASHED = 9, |
| 188 | CONFIRM_BUBBLE = 10, |
| 189 | UPDATE_RECOMMENDED = 11, |
| 190 | CRYPTO_PASSWORD = 12, |
| 191 | SAFE_BROWSING_DOWNLOAD_FEEDBACK = 13, |
| 192 | FIRST_RUN = 14, |
| 193 | NETWORK_SHARE_PROFILE_WARNING = 15, |
Patrick Monette | 66e935a | 2018-06-12 19:16:10 | [diff] [blame] | 194 | // CONFLICTING_MODULE = 16, Deprecated |
pdyson | a8a9ea0 | 2017-04-20 00:00:15 | [diff] [blame] | 195 | CRITICAL_NOTIFICATION = 17, |
| 196 | IME_WARNING = 18, |
pdyson | 106455b2 | 2017-04-26 01:21:31 | [diff] [blame] | 197 | TOOLBAR_ACTIONS_BAR = 19, |
| 198 | GLOBAL_ERROR = 20, |
| 199 | EXTENSION_INSTALL = 21, |
| 200 | EXTENSION_UNINSTALL = 22, |
| 201 | EXTENSION_INSTALLED = 23, |
| 202 | PAYMENT_REQUEST = 24, |
| 203 | SAVE_CARD = 25, |
| 204 | CARD_UNMASK = 26, |
pdyson | 918928e | 2017-05-04 03:50:12 | [diff] [blame] | 205 | SIGN_IN = 27, |
| 206 | SIGN_IN_SYNC_CONFIRMATION = 28, |
| 207 | SIGN_IN_ERROR = 29, |
| 208 | SIGN_IN_EMAIL_CONFIRMATION = 30, |
| 209 | PROFILE_CHOOSER = 31, |
pdyson | 7fa1d03 | 2017-05-17 23:54:45 | [diff] [blame] | 210 | ACCOUNT_CHOOSER = 32, |
| 211 | ARC_APP = 33, |
| 212 | AUTO_SIGNIN_FIRST_RUN = 34, |
Eric Willigers | 1e612cf | 2020-03-04 21:49:47 | [diff] [blame] | 213 | WEB_APP_CONFIRMATION = 35, |
pdyson | 7fa1d03 | 2017-05-17 23:54:45 | [diff] [blame] | 214 | CHOOSER_UI = 36, |
| 215 | CHOOSER = 37, |
| 216 | COLLECTED_COOKIES = 38, |
| 217 | CONSTRAINED_WEB = 39, |
| 218 | CONTENT_SETTING_CONTENTS = 40, |
| 219 | CREATE_CHROME_APPLICATION_SHORTCUT = 41, |
| 220 | DOWNLOAD_DANGER_PROMPT = 42, |
| 221 | DOWNLOAD_IN_PROGRESS = 43, |
| 222 | ECHO = 44, |
| 223 | ENROLLMENT = 45, |
| 224 | EXTENSION = 46, |
| 225 | EXTENSION_POPUP_AURA = 47, |
| 226 | EXTERNAL_PROTOCOL = 48, |
| 227 | EXTERNAL_PROTOCOL_CHROMEOS = 49, |
| 228 | FIRST_RUN_DIALOG = 50, |
| 229 | HOME_PAGE_UNDO = 51, |
| 230 | IDLE_ACTION_WARNING = 52, |
| 231 | IMPORT_LOCK = 53, |
| 232 | INTENT_PICKER = 54, |
| 233 | INVERT = 55, |
| 234 | JAVA_SCRIPT = 56, |
| 235 | JAVA_SCRIPT_APP_MODAL_X11 = 57, |
| 236 | LOGIN_HANDLER = 58, |
| 237 | MANAGE_PASSWORDS = 59, |
| 238 | MEDIA_GALLERIES = 60, |
| 239 | MULTIPROFILES_INTRO = 61, |
| 240 | MULTIPROFILES_SESSION_ABORTED = 62, |
| 241 | NATIVE_CONTAINER = 63, |
| 242 | NETWORK_CONFIG = 64, |
| 243 | PERMISSIONS = 65, |
| 244 | PLATFORM_KEYS_CERTIFICATE_SELECTOR = 66, |
| 245 | PLATFORM_VERIFICATION = 67, |
| 246 | PROXIMITY_AUTH_ERROR = 68, |
| 247 | REQUEST_PIN = 69, |
| 248 | SSL_CLIENT_CERTIFICATE_SELECTOR = 70, |
| 249 | SIMPLE_MESSAGE_BOX = 71, |
| 250 | TAB_MODAL_CONFIRM = 72, |
| 251 | TASK_MANAGER = 73, |
| 252 | TELEPORT_WARNING = 74, |
| 253 | USER_MANAGER = 75, |
| 254 | USER_MANAGER_PROFILE = 76, |
| 255 | VALIDATION_MESSAGE = 77, |
| 256 | WEB_SHARE_TARGET_PICKER = 78, |
| 257 | ZOOM = 79, |
Toni Barzic | 06919754 | 2017-10-17 22:08:01 | [diff] [blame] | 258 | LOCK_SCREEN_NOTE_APP_TOAST = 80, |
Michael McGreevy | 556227a5 | 2017-11-16 07:47:24 | [diff] [blame] | 259 | PWA_CONFIRMATION = 81, |
Greg Thompson | 875403e0 | 2018-02-27 16:22:52 | [diff] [blame] | 260 | RELAUNCH_RECOMMENDED = 82, |
Timothy Loh | 74cf13c2 | 2018-03-01 06:56:24 | [diff] [blame] | 261 | CROSTINI_INSTALLER = 83, |
Greg Thompson | 27aef5f | 2018-03-05 22:10:37 | [diff] [blame] | 262 | RELAUNCH_REQUIRED = 84, |
Thomas Tangl | 9e916b23 | 2018-04-18 13:07:48 | [diff] [blame] | 263 | UNITY_SYNC_CONSENT_BUMP = 85, |
Nicholas Verne | 26965d8 | 2018-05-01 02:07:03 | [diff] [blame] | 264 | CROSTINI_UNINSTALLER = 86, |
Min Qin | 7b7cbbbf | 2018-06-04 21:49:31 | [diff] [blame] | 265 | DOWNLOAD_OPEN_CONFIRMATION = 87, |
[email protected] | ef49be4 | 2018-07-12 17:54:12 | [diff] [blame] | 266 | ARC_DATA_REMOVAL_CONFIRMATION = 88, |
Nicholas Verne | bc9185c | 2018-09-13 06:16:01 | [diff] [blame] | 267 | CROSTINI_UPGRADE = 89, |
Jeffrey Cohen | 2e9d01a | 2018-10-11 17:30:39 | [diff] [blame] | 268 | HATS_BUBBLE = 90, |
Tim Zheng | c36d6a5 | 2018-10-27 01:05:38 | [diff] [blame] | 269 | CROSTINI_APP_RESTART = 91, |
Ramin Halavati | ef75f6c | 2019-04-02 19:24:51 | [diff] [blame] | 270 | INCOGNITO_WINDOW_COUNT = 92, |
Ian Barkley-Yeung | 42f06e96 | 2018-12-14 03:00:41 | [diff] [blame] | 271 | CROSTINI_APP_UNINSTALLER = 93, |
Josh Pratt | f80ffb8 | 2019-01-22 07:13:51 | [diff] [blame] | 272 | CROSTINI_CONTAINER_UPGRADE = 94, |
Christian Dullweber | 10087e0 | 2019-08-28 12:23:07 | [diff] [blame] | 273 | COOKIE_CONTROLS = 95, |
Christopher Gunadi | 352d90d | 2019-09-13 16:38:28 | [diff] [blame] | 274 | CROSTINI_ANSIBLE_SOFTWARE_CONFIG = 96, |
Travis Skare | ba1cc44 | 2019-10-02 22:28:11 | [diff] [blame] | 275 | INCOGNITO_MENU = 97, |
| 276 | PHONE_CHOOSER = 98, |
| 277 | QR_CODE_GENERATOR = 99, |
Nicholas Hollingum | 266cddd | 2019-10-03 06:12:44 | [diff] [blame] | 278 | CROSTINI_FORCE_CLOSE = 100, |
nancy | d675d04 | 2019-10-21 10:37:21 | [diff] [blame] | 279 | APP_UNINSTALL = 101, |
Nikita Podguzov | 107cccc1 | 2020-02-04 17:57:05 | [diff] [blame] | 280 | PRINT_JOB_CONFIRMATION = 102, |
Nicholas Verne | d8863f1 | 2020-03-04 23:03:31 | [diff] [blame] | 281 | CROSTINI_RECOVERY = 103, |
Danan S | f55c165 | 2020-03-05 03:13:32 | [diff] [blame] | 282 | PARENT_PERMISSION = 104, // ChromeOS only. |
Alex Ilin | 22e8917 | 2020-03-18 15:12:51 | [diff] [blame] | 283 | SIGNIN_REAUTH = 105, |
Josh Pratt | f80ffb8 | 2019-01-22 07:13:51 | [diff] [blame] | 284 | // Add values above this line with a corresponding label in |
| 285 | // tools/metrics/histograms/enums.xml |
pdyson | a8a9ea0 | 2017-04-20 00:00:15 | [diff] [blame] | 286 | MAX_VALUE |
| 287 | }; |
pdyson | 7872d6c0 | 2017-04-05 23:12:31 | [diff] [blame] | 288 | |
| 289 | // Record an UMA metric counting the creation of a dialog box of this type. |
| 290 | void RecordDialogCreation(DialogIdentifier identifier); |
| 291 | |
alito | e82b14b | 2017-04-06 23:11:29 | [diff] [blame] | 292 | #if defined(OS_WIN) |
| 293 | |
Ali Tofigh | 525f78bdd | 2017-09-15 15:37:20 | [diff] [blame] | 294 | // Shows the settings reset prompt dialog asking the user if they want to reset |
| 295 | // some of their settings. |
| 296 | void ShowSettingsResetPrompt( |
| 297 | Browser* browser, |
| 298 | safe_browsing::SettingsResetPromptController* controller); |
| 299 | |
alito | e82b14b | 2017-04-06 23:11:29 | [diff] [blame] | 300 | // Shows the Chrome Cleanup dialog asking the user if they want to clean their |
| 301 | // system from unwanted software. This is called when unwanted software has been |
| 302 | // detected on the system. |
alito | f8f753f6 | 2017-04-28 23:04:10 | [diff] [blame] | 303 | void ShowChromeCleanerPrompt( |
| 304 | Browser* browser, |
Ali Tofigh | f5baba98 | 2017-07-21 23:15:23 | [diff] [blame] | 305 | safe_browsing::ChromeCleanerDialogController* dialog_controller, |
| 306 | safe_browsing::ChromeCleanerController* cleaner_controller); |
alito | e82b14b | 2017-04-06 23:11:29 | [diff] [blame] | 307 | |
Fabio Tirelo | 8825aab4 | 2017-10-19 13:23:31 | [diff] [blame] | 308 | // Shows the Chrome Cleanup reboot dialog asking the user if they want to |
| 309 | // restart their computer once a cleanup has finished. This is called when the |
| 310 | // Chrome Cleanup ends in a reboot required state. |
| 311 | void ShowChromeCleanerRebootPrompt( |
| 312 | Browser* browser, |
| 313 | safe_browsing::ChromeCleanerRebootDialogController* dialog_controller); |
| 314 | |
alito | e82b14b | 2017-04-06 23:11:29 | [diff] [blame] | 315 | #endif // OS_WIN |
| 316 | |
Owen Min | d6b9de0 | 2020-03-14 00:26:54 | [diff] [blame] | 317 | // Displays a dialog to notify the user that the extension installation is |
| 318 | // blocked due to policy. It also show additional information from administrator |
| 319 | // if it exists. |
| 320 | void ShowExtensionInstallBlockedDialog( |
| 321 | const std::string& extension_name, |
| 322 | const base::string16& custom_error_message, |
| 323 | const gfx::ImageSkia& icon, |
| 324 | content::WebContents* web_contents, |
| 325 | base::OnceClosure done_callback); |
| 326 | |
Devlin Cronin | 5739bf0 | 2020-05-15 00:38:38 | [diff] [blame^] | 327 | // TODO(devlin): Put more extension-y bits in this block - currently they're |
| 328 | // unguarded. |
| 329 | #if BUILDFLAG(ENABLE_EXTENSIONS) |
| 330 | // Shows the dialog indicating that an extension has overridden a setting. |
| 331 | void ShowExtensionSettingsOverriddenDialog( |
| 332 | std::unique_ptr<SettingsOverriddenDialogController> controller, |
| 333 | Browser* browser); |
| 334 | #endif |
| 335 | |
Elly Fong-Jones | f260d67 | 2020-03-16 14:09:07 | [diff] [blame] | 336 | // Returns a OnceClosure that client code can call to close the device chooser. |
| 337 | // This OnceClosure references the actual dialog as a WeakPtr, so it's safe to |
| 338 | // call at any point. |
| 339 | base::OnceClosure ShowDeviceChooserDialog( |
| 340 | content::RenderFrameHost* owner, |
| 341 | std::unique_ptr<ChooserController> controller); |
Guido Urdaneta | af871dc | 2020-04-16 06:53:20 | [diff] [blame] | 342 | bool IsDeviceChooserShowingForTesting(Browser* browser); |
Elly Fong-Jones | f260d67 | 2020-03-16 14:09:07 | [diff] [blame] | 343 | |
[email protected] | 87586fb7 | 2012-07-02 13:15:02 | [diff] [blame] | 344 | } // namespace chrome |
[email protected] | c96531e8 | 2011-01-26 03:11:14 | [diff] [blame] | 345 | |
Peter Boström | 2a02a69 | 2018-02-22 22:25:46 | [diff] [blame] | 346 | void ShowFolderUploadConfirmationDialog( |
| 347 | const base::FilePath& path, |
| 348 | base::OnceCallback<void(const std::vector<ui::SelectedFileInfo>&)> callback, |
| 349 | std::vector<ui::SelectedFileInfo> selected_files, |
| 350 | content::WebContents* web_contents); |
| 351 | |
[email protected] | c96531e8 | 2011-01-26 03:11:14 | [diff] [blame] | 352 | #endif // CHROME_BROWSER_UI_BROWSER_DIALOGS_H_ |