| James Cook | c8e0acd | 2025-10-27 20:08:54 | [diff] [blame] | 1 | // Copyright 2025 The Chromium Authors |
| 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 "chrome/browser/platform_util_internal.h" |
| 6 | |
| 7 | #include "build/build_config.h" |
| 8 | #include "build/buildflag.h" |
| 9 | |
| 10 | #if BUILDFLAG(IS_CHROMEOS) |
| 11 | #include "chrome/browser/ash/file_manager/open_util.h" |
| 12 | #endif |
| 13 | |
| 14 | namespace platform_util::internal { |
| 15 | namespace { |
| 16 | |
| 17 | bool g_shell_operations_allowed = true; |
| 18 | |
| 19 | } // namespace |
| 20 | |
| 21 | void DisableShellOperationsForTesting() { |
| 22 | g_shell_operations_allowed = false; |
| 23 | |
| 24 | #if BUILDFLAG(IS_CHROMEOS) |
| 25 | // Chrome OS also needs to customize file manager behavior. |
| 26 | file_manager::util::DisableShellOperationsForTesting(); |
| 27 | #endif |
| 28 | } |
| 29 | |
| 30 | bool AreShellOperationsAllowed() { |
| 31 | return g_shell_operations_allowed; |
| 32 | } |
| 33 | |
| 34 | } // namespace platform_util::internal |