Erik Chen | 598410c | 2024-04-11 21:05:51 | [diff] [blame] | 1 | This directory contains the implementation of the Chromium UI. There are |
| 2 | subdirectories with implementations for specific toolkits and OSes. |
Elly Fong-Jones | 03efb30 | 2020-06-29 21:06:27 | [diff] [blame] | 3 | |
Peter Kasting | 1a32701 | 2020-08-05 14:57:12 | [diff] [blame] | 4 | This directory is often referred to in conversation as "cbui" or "c/b/ui", |
| 5 | pronounced "sea bee you eye". |
Elly Fong-Jones | 03efb30 | 2020-06-29 21:06:27 | [diff] [blame] | 6 | |
| 7 | Important subdirectories: |
Scott Violet | 9a540f3e | 2020-07-13 15:13:45 | [diff] [blame] | 8 | * views - the Views implementation of the UI, used on Windows, Mac, Linux, and |
Di Wu | 2c05708 | 2025-04-07 00:10:24 | [diff] [blame] | 9 | ChromeOS. This includes features like Omnibox, downloads. |
Scott Violet | 9a540f3e | 2020-07-13 15:13:45 | [diff] [blame] | 10 | * cocoa - the remaining Cocoa UI, used only on Mac. This directory used to |
Elly Fong-Jones | 03efb30 | 2020-06-29 21:06:27 | [diff] [blame] | 11 | contain a separate full implementation of the UI, parallel to the |
| 12 | Views implementation. |
Scott Violet | 9a540f3e | 2020-07-13 15:13:45 | [diff] [blame] | 13 | * android - part of the Android implementation of the UI. See also |
Elly Fong-Jones | 03efb30 | 2020-06-29 21:06:27 | [diff] [blame] | 14 | //chrome/browser/android. |
Scott Violet | 9a540f3e | 2020-07-13 15:13:45 | [diff] [blame] | 15 | * webui - the WebUI parts of the browser UI. This includes things like the |
Elly Fong-Jones | 03efb30 | 2020-06-29 21:06:27 | [diff] [blame] | 16 | chrome://settings page and other WebUI pages. |
| 17 | |
Erik Chen | 598410c | 2024-04-11 21:05:51 | [diff] [blame] | 18 | Historically, the goal of this directory was to be platform agnostic, with |
| 19 | platform-specific logic in the above sub-directories. This didn't work and |
| 20 | attempting to maintain this structure was causing more problems than it was |
| 21 | solving, so we've removed this requirement. |
Elly Fong-Jones | 03efb30 | 2020-06-29 21:06:27 | [diff] [blame] | 22 | |
Erik Chen | 598410c | 2024-04-11 21:05:51 | [diff] [blame] | 23 | In the event that a feature does need platform-specific implementations, use the |
| 24 | following structure: |
Elly Fong-Jones | 03efb30 | 2020-06-29 21:06:27 | [diff] [blame] | 25 | |
Erik Chen | 598410c | 2024-04-11 21:05:51 | [diff] [blame] | 26 | [//chrome/browser/ui/browser_dialogs.h](browser_dialogs.h): |
Scott Violet | 9a540f3e | 2020-07-13 15:13:45 | [diff] [blame] | 27 | void ShowMyDialog(...); |
Elly Fong-Jones | 03efb30 | 2020-06-29 21:06:27 | [diff] [blame] | 28 | |
Erik Chen | 598410c | 2024-04-11 21:05:51 | [diff] [blame] | 29 | //chrome/browser/ui/views/my_dialog_views.cc: |
Scott Violet | 9a540f3e | 2020-07-13 15:13:45 | [diff] [blame] | 30 | void ShowMyDialog(...) { ... } |
Elly Fong-Jones | 03efb30 | 2020-06-29 21:06:27 | [diff] [blame] | 31 | |
Erik Chen | 598410c | 2024-04-11 21:05:51 | [diff] [blame] | 32 | //chrome/browser/ui/android/my_dialog_android.cc: |
Scott Violet | 9a540f3e | 2020-07-13 15:13:45 | [diff] [blame] | 33 | void ShowMyDialog(...) { ... } |
Peter Kasting | 1a32701 | 2020-08-05 14:57:12 | [diff] [blame] | 34 | |
| 35 | Because "Chromium UI" is such a large surface area, do not add new files |
| 36 | directly to this directory; instead, add subdirectories with more specific |
| 37 | OWNERS and place new features and files in them. Cleanup of existing scattered |
| 38 | files is also welcome. |