[Partitioned Storage Tab] Add PartitionedStorageActionView for container tabs in location bar#33925
[Partitioned Storage Tab] Add PartitionedStorageActionView for container tabs in location bar#33925sangwoo108 wants to merge 1 commit intomasterfrom
Conversation
📋 Code Owners Summary7 file(s) changed, 1 with assigned owners 1 team(s) affected: Owners and Their Files
|
308e9c2 to
dfdb8fd
Compare
| SetVisible(false); | ||
| SetUpForInOutAnimation(); | ||
| SetBackgroundVisibility(BackgroundVisibility::kWithLabel); | ||
| } |
There was a problem hiding this comment.
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); | ||
| } |
There was a problem hiding this comment.
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
bb226c7 to
72ea8bb
Compare
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
72ea8bb to
c82aa42
Compare
|
Warning You have got a presubmit warning. Please address it if possible. |
|
Warning You have got a presubmit warning. Please address it if possible. |
|
Warning You have got a presubmit warning. Please address it if possible. |
|
Warning You have got a presubmit warning. Please address it if possible. |
|
Warning You have got a presubmit warning. Please address it if possible. |
|
Warning You have got a presubmit warning. Please address it if possible. |
|
Warning You have got a presubmit warning. Please address it if possible. |
|
Warning You have got a presubmit warning. Please address it if possible. |
|
Warning You have got a presubmit warning. Please address it if possible. |
1 similar comment
|
Warning You have got a presubmit warning. Please address it if possible. |
|
Warning You have got a presubmit warning. Please address it if possible. |
1 similar comment
|
Warning You have got a presubmit warning. Please address it if possible. |
|
Warning You have got a presubmit warning. Please address it if possible. |
1 similar comment
|
Warning You have got a presubmit warning. Please address it if possible. |
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
kPartitionedStorageActionIconTypeparams.types_enabledonly whenBUILDFLAG(ENABLE_CONTAINERS)andcontainers::features::kContainersare enabledBRAVE_PARTITIONED_STORAGE_ACTION_CASEthat createsPartitionedStorageActionViewonly whenBUILDFLAG(ENABLE_CONTAINERS)is set and thekContainersfeature is enabled; include/view code guarded byBUILDFLAG(ENABLE_CONTAINERS)Add PartitionedStorageActionView (page_action/) as a new PageActionIconView that:
Resolves brave/brave-browser#52828