Avi Drissman | 3e1a26c | 2022-09-15 20:26:03 | [diff] [blame] | 1 | // Copyright 2022 The Chromium Authors |
Tom Anderson | 80d3ad4 | 2022-05-03 12:09:27 | [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 | |
Tom Anderson | 4ee8374 | 2022-07-14 20:58:41 | [diff] [blame] | 5 | #ifndef UI_LINUX_LINUX_UI_FACTORY_H_ |
| 6 | #define UI_LINUX_LINUX_UI_FACTORY_H_ |
Tom Anderson | 80d3ad4 | 2022-05-03 12:09:27 | [diff] [blame] | 7 | |
Tom Anderson | 074a5d41 | 2022-08-30 18:54:53 | [diff] [blame] | 8 | #include "base/component_export.h" |
Tom Anderson | d6ecb87 | 2022-09-02 19:13:03 | [diff] [blame] | 9 | #include "base/features.h" |
Tom Anderson | 80d3ad4 | 2022-05-03 12:09:27 | [diff] [blame] | 10 | |
Tom Anderson | 992d987 | 2022-07-14 21:24:50 | [diff] [blame] | 11 | namespace ui { |
| 12 | |
| 13 | class LinuxUi; |
Tom Anderson | cd61f3b2 | 2022-09-14 16:27:49 | [diff] [blame] | 14 | class LinuxUiTheme; |
Tom Anderson | 074a5d41 | 2022-08-30 18:54:53 | [diff] [blame] | 15 | enum class SystemTheme : int; |
Tom Anderson | 80d3ad4 | 2022-05-03 12:09:27 | [diff] [blame] | 16 | |
Tom Anderson | 10fc024 | 2023-05-19 23:10:16 | [diff] [blame] | 17 | // TODO(https://crbug.com/1317782): Remove in M110. |
| 18 | COMPONENT_EXPORT(LINUX_UI_FACTORY) BASE_DECLARE_FEATURE(kAllowQt); |
| 19 | |
Tom Anderson | 074a5d41 | 2022-08-30 18:54:53 | [diff] [blame] | 20 | // Returns a LinuxUi for the default toolkit. May create a LinuxUi instance if |
| 21 | // one does not exist. May return nullptr if no toolkits are available. |
| 22 | COMPONENT_EXPORT(LINUX_UI_FACTORY) |
| 23 | LinuxUi* GetDefaultLinuxUi(); |
| 24 | |
Tom Anderson | 975c84e1 | 2022-09-14 22:17:58 | [diff] [blame] | 25 | // Returns a LinuxUiTheme for the default toolkit. May create a LinuxUiTheme |
| 26 | // instance if one does not exist. May return nullptr if no toolkits are |
| 27 | // available. Should only be used by tests or LinuxUi internals. Otherwise, use |
| 28 | // the accessors in LinuxUiTheme instead. |
| 29 | COMPONENT_EXPORT(LINUX_UI_FACTORY) |
| 30 | LinuxUiTheme* GetDefaultLinuxUiTheme(); |
| 31 | |
Tom Anderson | 074a5d41 | 2022-08-30 18:54:53 | [diff] [blame] | 32 | COMPONENT_EXPORT(LINUX_UI_FACTORY) |
Tom Anderson | cd61f3b2 | 2022-09-14 16:27:49 | [diff] [blame] | 33 | LinuxUiTheme* GetLinuxUiTheme(SystemTheme system_theme); |
Tom Anderson | 074a5d41 | 2022-08-30 18:54:53 | [diff] [blame] | 34 | |
Tom Anderson | 4943182 | 2023-07-21 22:35:40 | [diff] [blame^] | 35 | // Returns all `LinuxUiTheme`s that have been created. |
| 36 | COMPONENT_EXPORT(LINUX_UI_FACTORY) |
| 37 | const std::vector<LinuxUiTheme*>& GetLinuxUiThemes(); |
| 38 | |
Tom Anderson | 074a5d41 | 2022-08-30 18:54:53 | [diff] [blame] | 39 | COMPONENT_EXPORT(LINUX_UI_FACTORY) |
| 40 | SystemTheme GetDefaultSystemTheme(); |
Tom Anderson | 992d987 | 2022-07-14 21:24:50 | [diff] [blame] | 41 | |
| 42 | } // namespace ui |
Tom Anderson | 80d3ad4 | 2022-05-03 12:09:27 | [diff] [blame] | 43 | |
Tom Anderson | 4ee8374 | 2022-07-14 20:58:41 | [diff] [blame] | 44 | #endif // UI_LINUX_LINUX_UI_FACTORY_H_ |