Elly Fong-Jones | 03efb30 | 2020-06-29 21:06:27 | [diff] [blame^] | 1 | This directory contains the implementation of the Chromium UI. Code in the root |
| 2 | of this directory is toolkit- and platform-independent. There are subdirectories |
| 3 | with implementations for specific toolkits and OSes. Code in the root of this |
| 4 | directory should *not* be aware of platform-specific implementation details or |
| 5 | reach into the platform implementation subdirectories. |
| 6 | |
| 7 | This directory is often referred to in conversation as "cbui", pronounced "sea |
| 8 | bee you eye". |
| 9 | |
| 10 | Important subdirectories: |
| 11 | views - the Views implementation of the UI, used on Windows, Mac, Linux, and |
| 12 | ChromeOS. This includes things like the browser window itself, tabs, |
| 13 | dialogs, etc. |
| 14 | cocoa - the remaining Cocoa UI, used only on Mac. This directory used to |
| 15 | contain a separate full implementation of the UI, parallel to the |
| 16 | Views implementation. |
| 17 | android - part of the Android implementation of the UI. See also |
| 18 | //chrome/browser/android. |
| 19 | webui - the WebUI parts of the browser UI. This includes things like the |
| 20 | chrome://settings page and other WebUI pages. |
| 21 | |
| 22 | A common pattern is for code in //chrome/browser/ui to define a |
| 23 | platform-independent interface which then has implementations in |
| 24 | //chrome/browser/ui/views and //chrome/browser/ui/android. This pattern is often |
| 25 | followed even for features that don't exist on Android, in which case the |
| 26 | Android implementation is often a stub. |
| 27 | |
| 28 | This pattern often looks like this: |
| 29 | |
| 30 | //chrome/browser/ui/browser_dialogs.h: |
| 31 | void ShowMyDialog(...); |
| 32 | |
| 33 | //chrome/browser/ui/views/my_dialog_views.cc: |
| 34 | void ShowMyDialog(...) { ... } |
| 35 | |
| 36 | //chrome/browser/ui/android/my_dialog_android.cc: |
| 37 | void ShowMyDialog(...) { ... } |