# Various Bubble Views
Bubble view is one of the view in Chromium.
Today, let's check the list of bubble view.
## What is Bubble View?
Bubble view is one of the [views::Widget](https://source.chromium.org/chromium/chromium/src/+/main:ui/views/widget/widget.h;l=107;drc=98a01e556dc3c775db2a129120504518b3e9b7e0) constructed with [InitParams::TYPE_BUBBLE](https://source.chromium.org/chromium/chromium/src/+/main:ui/views/widget/widget.h;l=186;drc=667c9184e61b12967e964275d177670de847e9e0).
[Bubble](https://chromium.googlesource.com/chromium/src/+/HEAD/docs/ui/views/overview.md#bubbles) is a commone type of dialog which is anchored to a parent view and moves as the parent view moves.
## BubbleDialogDelegateView
[BubbleDialogDelegateView](https://source.chromium.org/chromium/chromium/src/+/main:ui/views/bubble/bubble_dialog_delegate_view.h;l=528;drc=f0b789e57981ab279d092fefb2857f80af9f4f02) is a view representing most of the bubble view and the specific bubble view can be created by subclassing this via [CreateBubble](https://source.chromium.org/chromium/chromium/src/+/main:ui/views/bubble/bubble_dialog_delegate_view.h;l=540;drc=f0b789e57981ab279d092fefb2857f80af9f4f02).
For example, [EmojiUI](https://source.chromium.org/chromium/chromium/src/+/main:chrome/browser/ui/webui/ash/emoji/emoji_ui.h;l=40;drc=80995e9585aa13ab4fb6293a6f9d946a26e81c01) is a bubble view which shows up when ChromeOS users try to input emoji by selecting from the Emoji list. This is a bubble view.
As we can see, it's created via [BubbleDialogDelegateView::CreateBubble](https://source.chromium.org/chromium/chromium/src/+/main:chrome/browser/ui/webui/ash/emoji/emoji_ui.cc;l=148;drc=98a01e556dc3c775db2a129120504518b3e9b7e0)
Let's see some examples:
### ProfilePicker
Profile picker is a bubble view you can see when you click on the profile icon at the top right of Chrome window.
[ProfileMenuCoordinater](https://source.chromium.org/chromium/chromium/src/+/main:chrome/browser/ui/views/profiles/profile_menu_coordinator.cc;l=78;drc=98a01e556dc3c775db2a129120504518b3e9b7e0) coordinates the menu items inside the profile picker view such as "Sycn is on".
ProfileMenuCoordinator::Show creates a bubble view for showing a menu inside the picker.
## PickerView
[PickerView](https://source.chromium.org/chromium/chromium/src/+/main:ash/picker/views/picker_view.h;l=38;drc=814668ba62394e610f6a59e3c15f03f518d0b2df) is one of the few example where it does not use BubbleDialogDelegateView API.
It creates InitParams with setting [TYPE_BUBBLE](https://source.chromium.org/chromium/chromium/src/+/main:ash/picker/views/picker_view.cc;l=102;drc=98a01e556dc3c775db2a129120504518b3e9b7e0) specifically inside [CreateWidget](https://source.chromium.org/chromium/chromium/src/+/main:ash/picker/views/picker_view.cc;l=94;drc=98a01e556dc3c775db2a129120504518b3e9b7e0). This view is introduced on 2023, so it's not a historical reason that it's not using the delegate, but not sure why it's not using it by through the code.
TODO(elkurin): why?
## MojoBubbleWebUIController
[MojoBubbleWebUIController](https://source.chromium.org/chromium/chromium/src/+/main:ui/webui/mojo_bubble_web_ui_controller.h;l=23;drc=3e1a26c44c024d97dc9a4c09bbc6a2365398ca2c) is an API to creates bubble view for web ui.
For example, tab search bubble view is shown using this API through [TabSearchBubbleHost::ShowTabSearchBubble](https://source.chromium.org/chromium/chromium/src/+/main:chrome/browser/ui/views/tab_search_bubble_host.cc;l=149;drc=60a77feece4d7af84fcbdd929827a45b75852b04). The API is owned by this host as [`webui_bubble_manager_`](https://source.chromium.org/chromium/chromium/src/+/main:chrome/browser/ui/views/tab_search_bubble_host.h;l=75;drc=98a01e556dc3c775db2a129120504518b3e9b7e0).