Avi Drissman | 4e1b7bc3 | 2022-09-15 14:03:50 | [diff] [blame] | 1 | // Copyright 2020 The Chromium Authors |
danakj | 8de3b749 | 2020-07-02 22:41:42 | [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 | #include "content/shell/browser/shell_platform_delegate.h" |
| 6 | |
Julie Jeongeun Kim | ec50827 | 2023-03-17 04:17:12 | [diff] [blame] | 7 | #include "content/public/browser/file_select_listener.h" |
danakj | 8de3b749 | 2020-07-02 22:41:42 | [diff] [blame] | 8 | #include "content/public/browser/javascript_dialog_manager.h" |
Dave Tapuska | b499878 | 2020-10-08 17:22:47 | [diff] [blame] | 9 | #include "content/public/browser/web_contents.h" |
arthursonzogni | 75ede19 | 2021-07-06 14:45:46 | [diff] [blame] | 10 | #include "content/shell/browser/shell.h" |
danakj | 8de3b749 | 2020-07-02 22:41:42 | [diff] [blame] | 11 | |
Jose Dapena Paz | 0702397 | 2023-08-21 18:25:39 | [diff] [blame] | 12 | #if !BUILDFLAG(IS_IOS) |
| 13 | #include "content/public/browser/color_chooser.h" |
| 14 | #endif |
| 15 | |
danakj | 8de3b749 | 2020-07-02 22:41:42 | [diff] [blame] | 16 | namespace content { |
| 17 | |
| 18 | void ShellPlatformDelegate::DidCreateOrAttachWebContents( |
| 19 | Shell* shell, |
| 20 | WebContents* web_contents) {} |
| 21 | |
arthursonzogni | 75ede19 | 2021-07-06 14:45:46 | [diff] [blame] | 22 | void ShellPlatformDelegate::DidCloseLastWindow() { |
| 23 | Shell::Shutdown(); |
| 24 | } |
| 25 | |
danakj | 8de3b749 | 2020-07-02 22:41:42 | [diff] [blame] | 26 | std::unique_ptr<JavaScriptDialogManager> |
| 27 | ShellPlatformDelegate::CreateJavaScriptDialogManager(Shell* shell) { |
| 28 | return nullptr; |
| 29 | } |
| 30 | |
Takumi Fujimoto | 4661871d | 2024-01-25 02:04:18 | [diff] [blame] | 31 | bool ShellPlatformDelegate::HandlePointerLockRequest( |
Dave Tapuska | b499878 | 2020-10-08 17:22:47 | [diff] [blame] | 32 | Shell* shell, |
| 33 | WebContents* web_contents, |
| 34 | bool user_gesture, |
| 35 | bool last_unlocked_by_target) { |
| 36 | return false; |
| 37 | } |
| 38 | |
danakj | 8de3b749 | 2020-07-02 22:41:42 | [diff] [blame] | 39 | bool ShellPlatformDelegate::ShouldAllowRunningInsecureContent(Shell* shell) { |
| 40 | return false; |
| 41 | } |
| 42 | |
Julie Jeongeun Kim | 1f306fa4 | 2023-03-30 08:10:17 | [diff] [blame] | 43 | #if !BUILDFLAG(IS_IOS) |
Julie Jeongeun Kim | 88ce9ec | 2023-07-28 02:25:40 | [diff] [blame] | 44 | std::unique_ptr<ColorChooser> ShellPlatformDelegate::OpenColorChooser( |
| 45 | WebContents* web_contents, |
| 46 | SkColor color, |
| 47 | const std::vector<blink::mojom::ColorSuggestionPtr>& suggestions) { |
| 48 | return nullptr; |
| 49 | } |
| 50 | |
Julie Jeongeun Kim | ec50827 | 2023-03-17 04:17:12 | [diff] [blame] | 51 | void ShellPlatformDelegate::RunFileChooser( |
| 52 | RenderFrameHost* render_frame_host, |
| 53 | scoped_refptr<FileSelectListener> listener, |
| 54 | const blink::mojom::FileChooserParams& params) { |
| 55 | listener->FileSelectionCanceled(); |
| 56 | } |
Julie Jeongeun Kim | 1f306fa4 | 2023-03-30 08:10:17 | [diff] [blame] | 57 | #endif |
Julie Jeongeun Kim | ec50827 | 2023-03-17 04:17:12 | [diff] [blame] | 58 | |
danakj | 8de3b749 | 2020-07-02 22:41:42 | [diff] [blame] | 59 | } // namespace content |