blob: b473680657cd11bc107dd0a5be49a5619d39c7e4 [file] [log] [blame]
Elly Fong-Jones03efb302020-06-29 21:06:271This directory contains the implementation of the Chromium UI. Code in the root
2of this directory is toolkit- and platform-independent. There are subdirectories
3with implementations for specific toolkits and OSes. Code in the root of this
4directory should *not* be aware of platform-specific implementation details or
5reach into the platform implementation subdirectories.
6
7This directory is often referred to in conversation as "cbui", pronounced "sea
8bee you eye".
9
10Important 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
22A common pattern is for code in //chrome/browser/ui to define a
23platform-independent interface which then has implementations in
24//chrome/browser/ui/views and //chrome/browser/ui/android. This pattern is often
25followed even for features that don't exist on Android, in which case the
26Android implementation is often a stub.
27
28This 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(...) { ... }