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