Skip to content

[Partitioned Storage Tab] Add PartitionedStorageActionView for container tabs in location bar#33925

Draft
sangwoo108 wants to merge 1 commit intomasterfrom
sko/containers-action-view
Draft

[Partitioned Storage Tab] Add PartitionedStorageActionView for container tabs in location bar#33925
sangwoo108 wants to merge 1 commit intomasterfrom
sko/containers-action-view

Conversation

@sangwoo108
Copy link
Collaborator

@sangwoo108 sangwoo108 commented Feb 13, 2026

Introduce a page action icon that appears in the location bar when the current tab is in a Brave container (partitioned storage). The icon shows the container's icon, name, and background color from ContainerModel, giving users a clear indication of which container context the tab is using.

Changes:

  • Register the icon type and creation path

    • brave_page_action_icon_type.h: declare kPartitionedStorageActionIconType
    • brave_page_action_icon_container_view.cc: add the type to params.types_enabled only when BUILDFLAG(ENABLE_CONTAINERS) and containers::features::kContainers are enabled
    • page_action_icon_controller.cc: add BRAVE_PARTITIONED_STORAGE_ACTION_CASE that creates PartitionedStorageActionView only when BUILDFLAG(ENABLE_CONTAINERS) is set and the kContainers feature is enabled; include/view code guarded by BUILDFLAG(ENABLE_CONTAINERS)
  • Add PartitionedStorageActionView (page_action/) as a new PageActionIconView that:

    • Resolves the current tab's container via GetContainerIdForWebContents and ContainerModel from prefs
    • Displays the container icon (scaled via ScaledContainerIconSource), name as a persistent label, and background color
    • Hides when the tab has no container

Resolves brave/brave-browser#52828

image

@sangwoo108 sangwoo108 changed the title Add PartitionedStorageActionView for container tabs in location bar [Partitioned Storage Tab] Add PartitionedStorageActionView for container tabs in location bar Feb 13, 2026
@github-actions
Copy link
Contributor

github-actions bot commented Feb 13, 2026

📋 Code Owners Summary

7 file(s) changed, 1 with assigned owners

1 team(s) affected: @brave/chromium-src-reviewers


Owners and Their Files

@brave/chromium-src-reviewers — 1 file(s)

@sangwoo108 sangwoo108 force-pushed the sko/containers-action-view branch from 308e9c2 to dfdb8fd Compare February 13, 2026 02:43
SetVisible(false);
SetUpForInOutAnimation();
SetBackgroundVisibility(BackgroundVisibility::kWithLabel);
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

reported by reviewdog 🐶
[opengrep] There are several global functions that facilitate dependency inversion. It will not be possible to call them from modularized features (no dependency cycles), and their usage in non-modularized features is considered a red flag

Don't use Browser*. This is functionally a container of hundreds of other pointers. It is impossible to specify dependencies, since Browser* functionally depends on everything. Instead, pass in the relevant pointers, e.g. Profile*, FooFeatureController, etc

References:
- https://chromium.googlesource.com/chromium/src/+/main/docs/chrome_browser_design_principles.md#structure_modularity


Source: https://github.com/brave/security-action/blob/main/assets/opengrep_rules/client/browser-dependency-inversion.yaml


Cc @goodov @cdesouza-chromium @bridiver


label()->SetMaximumWidthSingleLine(120);
label()->SetElideBehavior(gfx::ElideBehavior::ELIDE_TAIL);
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

reported by reviewdog 🐶
[opengrep] There are several global functions that facilitate dependency inversion. It will not be possible to call them from modularized features (no dependency cycles), and their usage in non-modularized features is considered a red flag

Don't use Browser*. This is functionally a container of hundreds of other pointers. It is impossible to specify dependencies, since Browser* functionally depends on everything. Instead, pass in the relevant pointers, e.g. Profile*, FooFeatureController, etc

References:
- https://chromium.googlesource.com/chromium/src/+/main/docs/chrome_browser_design_principles.md#structure_modularity


Source: https://github.com/brave/security-action/blob/main/assets/opengrep_rules/client/browser-dependency-inversion.yaml


Cc @goodov @cdesouza-chromium @bridiver

@sangwoo108 sangwoo108 force-pushed the sko/containers-action-view branch 3 times, most recently from bb226c7 to 72ea8bb Compare February 13, 2026 07:57
Introduce a page action icon that appears in the location bar when the
current tab is in a Brave container (partitioned storage). The icon
shows the container's icon, name, and background color from
ContainerModel, giving users a clear indication of which container
context the tab is using.

Changes:

- Register the icon type and creation path
  - brave_page_action_icon_type.h: declare
    `kPartitionedStorageActionIconType`
  - brave_page_action_icon_container_view.cc: add the type to
    `params.types_enabled` only when `BUILDFLAG(ENABLE_CONTAINERS)` and
    `containers::features::kContainers` are enabled
  - page_action_icon_controller.cc: add
    `BRAVE_PARTITIONED_STORAGE_ACTION_CASE` that creates
    `PartitionedStorageActionView` only when `BUILDFLAG(ENABLE_CONTAINERS)`
    is set and the `kContainers` feature is enabled; include/view code guarded
    by `BUILDFLAG(ENABLE_CONTAINERS)`

- Add PartitionedStorageActionView (page_action/) as a new
  PageActionIconView that:
  - Resolves the current tab's container via GetContainerIdForWebContents
    and ContainerModel from prefs
  - Displays the container icon (scaled via ScaledContainerIconSource),
    name as a persistent label, and background color
  - Hides when the tab has no container
@sangwoo108 sangwoo108 force-pushed the sko/containers-action-view branch from 72ea8bb to c82aa42 Compare February 13, 2026 08:11
@brave-builds
Copy link
Collaborator

Warning

You have got a presubmit warning. Please address it if possible.

A banned pattern was used.
    browser/ui/views/page_action/partitioned_storage_action_view.cc:53:
      P
      a
      g
      e
      A
      c
      t
      i
      o
      n
      I
      c
      o
      n
      V
      i
      e
      w
       
      w
      i
      l
      l
       
      s
      o
      o
      n
       
      b
      e
       
      r
      e
      m
      o
      v
      e
      d
      .
       
      U
      s
      e
       
      P
      a
      g
      e
      A
      c
      t
      i
      o
      n
      V
      i
      e
      w
       
      i
      n
      s
      t
      e
      a
      d
      .
       
      S
      e
      e
       
      c
      h
      r
      o
      m
      e
      /
      b
      r
      o
      w
      s
      e
      r
      /
      u
      i
      /
      v
      i
      e
      w
      s
      /
      p
      a
      g
      e
      _
      a
      c
      t
      i
      o
      n
      /
      R
      E
      A
      D
      M
      E
      .
      m
      d
       
      f
      o
      r
       
      d
      e
      t
      a
      i
      l
      s
      .

@brave-builds
Copy link
Collaborator

Warning

You have got a presubmit warning. Please address it if possible.

A banned pattern was used.
    browser/ui/views/page_action/partitioned_storage_action_view.cc:55:
      P
      a
      g
      e
      A
      c
      t
      i
      o
      n
      I
      c
      o
      n
      V
      i
      e
      w
       
      w
      i
      l
      l
       
      s
      o
      o
      n
       
      b
      e
       
      r
      e
      m
      o
      v
      e
      d
      .
       
      U
      s
      e
       
      P
      a
      g
      e
      A
      c
      t
      i
      o
      n
      V
      i
      e
      w
       
      i
      n
      s
      t
      e
      a
      d
      .
       
      S
      e
      e
       
      c
      h
      r
      o
      m
      e
      /
      b
      r
      o
      w
      s
      e
      r
      /
      u
      i
      /
      v
      i
      e
      w
      s
      /
      p
      a
      g
      e
      _
      a
      c
      t
      i
      o
      n
      /
      R
      E
      A
      D
      M
      E
      .
      m
      d
       
      f
      o
      r
       
      d
      e
      t
      a
      i
      l
      s
      .

@brave-builds
Copy link
Collaborator

Warning

You have got a presubmit warning. Please address it if possible.

A banned pattern was used.
    browser/ui/views/page_action/partitioned_storage_action_view.cc:151:
      P
      a
      g
      e
      A
      c
      t
      i
      o
      n
      I
      c
      o
      n
      V
      i
      e
      w
       
      w
      i
      l
      l
       
      s
      o
      o
      n
       
      b
      e
       
      r
      e
      m
      o
      v
      e
      d
      .
       
      U
      s
      e
       
      P
      a
      g
      e
      A
      c
      t
      i
      o
      n
      V
      i
      e
      w
       
      i
      n
      s
      t
      e
      a
      d
      .
       
      S
      e
      e
       
      c
      h
      r
      o
      m
      e
      /
      b
      r
      o
      w
      s
      e
      r
      /
      u
      i
      /
      v
      i
      e
      w
      s
      /
      p
      a
      g
      e
      _
      a
      c
      t
      i
      o
      n
      /
      R
      E
      A
      D
      M
      E
      .
      m
      d
       
      f
      o
      r
       
      d
      e
      t
      a
      i
      l
      s
      .

@brave-builds
Copy link
Collaborator

Warning

You have got a presubmit warning. Please address it if possible.

A banned pattern was used.
    browser/ui/views/page_action/partitioned_storage_action_view.cc:165:
      P
      a
      g
      e
      A
      c
      t
      i
      o
      n
      I
      c
      o
      n
      V
      i
      e
      w
       
      w
      i
      l
      l
       
      s
      o
      o
      n
       
      b
      e
       
      r
      e
      m
      o
      v
      e
      d
      .
       
      U
      s
      e
       
      P
      a
      g
      e
      A
      c
      t
      i
      o
      n
      V
      i
      e
      w
       
      i
      n
      s
      t
      e
      a
      d
      .
       
      S
      e
      e
       
      c
      h
      r
      o
      m
      e
      /
      b
      r
      o
      w
      s
      e
      r
      /
      u
      i
      /
      v
      i
      e
      w
      s
      /
      p
      a
      g
      e
      _
      a
      c
      t
      i
      o
      n
      /
      R
      E
      A
      D
      M
      E
      .
      m
      d
       
      f
      o
      r
       
      d
      e
      t
      a
      i
      l
      s
      .

@brave-builds
Copy link
Collaborator

Warning

You have got a presubmit warning. Please address it if possible.

A banned pattern was used.
    browser/ui/views/page_action/partitioned_storage_action_view.h:20:
      P
      a
      g
      e
      A
      c
      t
      i
      o
      n
      I
      c
      o
      n
      V
      i
      e
      w
       
      w
      i
      l
      l
       
      s
      o
      o
      n
       
      b
      e
       
      r
      e
      m
      o
      v
      e
      d
      .
       
      U
      s
      e
       
      P
      a
      g
      e
      A
      c
      t
      i
      o
      n
      V
      i
      e
      w
       
      i
      n
      s
      t
      e
      a
      d
      .
       
      S
      e
      e
       
      c
      h
      r
      o
      m
      e
      /
      b
      r
      o
      w
      s
      e
      r
      /
      u
      i
      /
      v
      i
      e
      w
      s
      /
      p
      a
      g
      e
      _
      a
      c
      t
      i
      o
      n
      /
      R
      E
      A
      D
      M
      E
      .
      m
      d
       
      f
      o
      r
       
      d
      e
      t
      a
      i
      l
      s
      .

@brave-builds
Copy link
Collaborator

Warning

You have got a presubmit warning. Please address it if possible.

A banned pattern was used.
    browser/ui/views/page_action/partitioned_storage_action_view.h:21:
      P
      a
      g
      e
      A
      c
      t
      i
      o
      n
      I
      c
      o
      n
      V
      i
      e
      w
       
      w
      i
      l
      l
       
      s
      o
      o
      n
       
      b
      e
       
      r
      e
      m
      o
      v
      e
      d
      .
       
      U
      s
      e
       
      P
      a
      g
      e
      A
      c
      t
      i
      o
      n
      V
      i
      e
      w
       
      i
      n
      s
      t
      e
      a
      d
      .
       
      S
      e
      e
       
      c
      h
      r
      o
      m
      e
      /
      b
      r
      o
      w
      s
      e
      r
      /
      u
      i
      /
      v
      i
      e
      w
      s
      /
      p
      a
      g
      e
      _
      a
      c
      t
      i
      o
      n
      /
      R
      E
      A
      D
      M
      E
      .
      m
      d
       
      f
      o
      r
       
      d
      e
      t
      a
      i
      l
      s
      .

@brave-builds
Copy link
Collaborator

Warning

You have got a presubmit warning. Please address it if possible.

A banned pattern was used.
    browser/ui/views/page_action/partitioned_storage_action_view.h:26:
      P
      a
      g
      e
      A
      c
      t
      i
      o
      n
      I
      c
      o
      n
      V
      i
      e
      w
       
      w
      i
      l
      l
       
      s
      o
      o
      n
       
      b
      e
       
      r
      e
      m
      o
      v
      e
      d
      .
       
      U
      s
      e
       
      P
      a
      g
      e
      A
      c
      t
      i
      o
      n
      V
      i
      e
      w
       
      i
      n
      s
      t
      e
      a
      d
      .
       
      S
      e
      e
       
      c
      h
      r
      o
      m
      e
      /
      b
      r
      o
      w
      s
      e
      r
      /
      u
      i
      /
      v
      i
      e
      w
      s
      /
      p
      a
      g
      e
      _
      a
      c
      t
      i
      o
      n
      /
      R
      E
      A
      D
      M
      E
      .
      m
      d
       
      f
      o
      r
       
      d
      e
      t
      a
      i
      l
      s
      .

@brave-builds
Copy link
Collaborator

Warning

You have got a presubmit warning. Please address it if possible.

A banned pattern was used.
    browser/ui/views/page_action/partitioned_storage_action_view.h:36:
      P
      a
      g
      e
      A
      c
      t
      i
      o
      n
      I
      c
      o
      n
      V
      i
      e
      w
       
      w
      i
      l
      l
       
      s
      o
      o
      n
       
      b
      e
       
      r
      e
      m
      o
      v
      e
      d
      .
       
      U
      s
      e
       
      P
      a
      g
      e
      A
      c
      t
      i
      o
      n
      V
      i
      e
      w
       
      i
      n
      s
      t
      e
      a
      d
      .
       
      S
      e
      e
       
      c
      h
      r
      o
      m
      e
      /
      b
      r
      o
      w
      s
      e
      r
      /
      u
      i
      /
      v
      i
      e
      w
      s
      /
      p
      a
      g
      e
      _
      a
      c
      t
      i
      o
      n
      /
      R
      E
      A
      D
      M
      E
      .
      m
      d
       
      f
      o
      r
       
      d
      e
      t
      a
      i
      l
      s
      .

@brave-builds
Copy link
Collaborator

Warning

You have got a presubmit warning. Please address it if possible.

-------------------------
[Warning] chromium_src:
  Ignoring symbol BRAVE_PAGE_ACTION_ICON_CONTROLLER_SPEEDREADER_CASE:
  Symbol is used internally in chromium_src/chrome/browser/ui/views/page_action/page_action_icon_controller.cc
  Symbol is NOT found in /home/ubuntu/workspace/ore-build-pr-noplatform_PR-33925/src/chrome/browser/ui/views/page_action/page_action_icon_controller.cc.

1 similar comment
@brave-builds
Copy link
Collaborator

Warning

You have got a presubmit warning. Please address it if possible.

-------------------------
[Warning] chromium_src:
  Ignoring symbol BRAVE_PAGE_ACTION_ICON_CONTROLLER_SPEEDREADER_CASE:
  Symbol is used internally in chromium_src/chrome/browser/ui/views/page_action/page_action_icon_controller.cc
  Symbol is NOT found in /home/ubuntu/workspace/ore-build-pr-noplatform_PR-33925/src/chrome/browser/ui/views/page_action/page_action_icon_controller.cc.

@brave-builds
Copy link
Collaborator

Warning

You have got a presubmit warning. Please address it if possible.

-------------------------
[Warning] chromium_src:
  Ignoring symbol BRAVE_WAYBACK_MACHINE_PAGE_ACTION_CASE:
  Symbol is used internally in chromium_src/chrome/browser/ui/views/page_action/page_action_icon_controller.cc
  Symbol is NOT found in /home/ubuntu/workspace/ore-build-pr-noplatform_PR-33925/src/chrome/browser/ui/views/page_action/page_action_icon_controller.cc.

1 similar comment
@brave-builds
Copy link
Collaborator

Warning

You have got a presubmit warning. Please address it if possible.

-------------------------
[Warning] chromium_src:
  Ignoring symbol BRAVE_WAYBACK_MACHINE_PAGE_ACTION_CASE:
  Symbol is used internally in chromium_src/chrome/browser/ui/views/page_action/page_action_icon_controller.cc
  Symbol is NOT found in /home/ubuntu/workspace/ore-build-pr-noplatform_PR-33925/src/chrome/browser/ui/views/page_action/page_action_icon_controller.cc.

@brave-builds
Copy link
Collaborator

Warning

You have got a presubmit warning. Please address it if possible.

-------------------------
[Warning] chromium_src:
  Ignoring symbol BRAVE_PARTITIONED_STORAGE_ACTION_CASE:
  Symbol is used internally in chromium_src/chrome/browser/ui/views/page_action/page_action_icon_controller.cc
  Symbol is NOT found in /home/ubuntu/workspace/ore-build-pr-noplatform_PR-33925/src/chrome/browser/ui/views/page_action/page_action_icon_controller.cc.

1 similar comment
@brave-builds
Copy link
Collaborator

Warning

You have got a presubmit warning. Please address it if possible.

-------------------------
[Warning] chromium_src:
  Ignoring symbol BRAVE_PARTITIONED_STORAGE_ACTION_CASE:
  Symbol is used internally in chromium_src/chrome/browser/ui/views/page_action/page_action_icon_controller.cc
  Symbol is NOT found in /home/ubuntu/workspace/ore-build-pr-noplatform_PR-33925/src/chrome/browser/ui/views/page_action/page_action_icon_controller.cc.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Partitioned Storage Tab] When the active tab is in a Container, location bar should show an icon for it.

5 participants