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