This directory contains the implementation of the Chromium UI. Code in the root of this directory is toolkit- and platform-independent. There are subdirectories with implementations for specific toolkits and OSes. Code in the root of this directory should not be aware of platform-specific implementation details or reach into the platform implementation subdirectories.
This directory is often referred to in conversation as “cbui”, pronounced “sea bee you eye”.
Important subdirectories:
A common pattern is for code in //chrome/browser/ui to define a platform-independent interface which then has implementations in //chrome/browser/ui/views and //chrome/browser/ui/android. This pattern is often followed even for features that don't exist on Android, in which case the Android implementation is often a stub.
This pattern often looks like this:
//chrome/browser/ui/browser_dialogs.h:
void ShowMyDialog(...);
//chrome/browser/ui/views/my_dialog_views.cc:
void ShowMyDialog(...) { ... }
//chrome/browser/ui/android/my_dialog_android.cc:
void ShowMyDialog(...) { ... }