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 | |
| 12 | namespace content { |
| 13 | |
| 14 | void ShellPlatformDelegate::DidCreateOrAttachWebContents( |
| 15 | Shell* shell, |
| 16 | WebContents* web_contents) {} |
| 17 | |
arthursonzogni | 75ede19 | 2021-07-06 14:45:46 | [diff] [blame] | 18 | void ShellPlatformDelegate::DidCloseLastWindow() { |
| 19 | Shell::Shutdown(); |
| 20 | } |
| 21 | |
danakj | 8de3b749 | 2020-07-02 22:41:42 | [diff] [blame] | 22 | std::unique_ptr<JavaScriptDialogManager> |
| 23 | ShellPlatformDelegate::CreateJavaScriptDialogManager(Shell* shell) { |
| 24 | return nullptr; |
| 25 | } |
| 26 | |
Dave Tapuska | b499878 | 2020-10-08 17:22:47 | [diff] [blame] | 27 | bool ShellPlatformDelegate::HandleRequestToLockMouse( |
| 28 | Shell* shell, |
| 29 | WebContents* web_contents, |
| 30 | bool user_gesture, |
| 31 | bool last_unlocked_by_target) { |
| 32 | return false; |
| 33 | } |
| 34 | |
danakj | 8de3b749 | 2020-07-02 22:41:42 | [diff] [blame] | 35 | bool ShellPlatformDelegate::ShouldAllowRunningInsecureContent(Shell* shell) { |
| 36 | return false; |
| 37 | } |
| 38 | |
Julie Jeongeun Kim | 1f306fa4 | 2023-03-30 08:10:17 | [diff] [blame] | 39 | #if !BUILDFLAG(IS_IOS) |
Julie Jeongeun Kim | 88ce9ec | 2023-07-28 02:25:40 | [diff] [blame^] | 40 | std::unique_ptr<ColorChooser> ShellPlatformDelegate::OpenColorChooser( |
| 41 | WebContents* web_contents, |
| 42 | SkColor color, |
| 43 | const std::vector<blink::mojom::ColorSuggestionPtr>& suggestions) { |
| 44 | return nullptr; |
| 45 | } |
| 46 | |
Julie Jeongeun Kim | ec50827 | 2023-03-17 04:17:12 | [diff] [blame] | 47 | void ShellPlatformDelegate::RunFileChooser( |
| 48 | RenderFrameHost* render_frame_host, |
| 49 | scoped_refptr<FileSelectListener> listener, |
| 50 | const blink::mojom::FileChooserParams& params) { |
| 51 | listener->FileSelectionCanceled(); |
| 52 | } |
Julie Jeongeun Kim | 1f306fa4 | 2023-03-30 08:10:17 | [diff] [blame] | 53 | #endif |
Julie Jeongeun Kim | ec50827 | 2023-03-17 04:17:12 | [diff] [blame] | 54 | |
danakj | 8de3b749 | 2020-07-02 22:41:42 | [diff] [blame] | 55 | } // namespace content |