Skip to content

Commit

Permalink
Revert "[Extensions] Add ChromeRefresh values directly in extensions …
Browse files Browse the repository at this point in the history
…toolbar"

This reverts commit 6237957.
  • Loading branch information
win32ss committed Sep 10, 2024
1 parent 297df0b commit e63e849
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 4 deletions.
13 changes: 11 additions & 2 deletions chrome/browser/ui/views/extensions/extensions_toolbar_button.cc
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
#include "ui/base/l10n/l10n_util.h"
#include "ui/base/metadata/metadata_impl_macros.h"
#include "ui/base/pointer/touch_ui_controller.h"
#include "ui/base/ui_base_features.h"
#include "ui/gfx/vector_icon_types.h"
#include "ui/views/accessibility/view_accessibility.h"
#include "ui/views/controls/button/button_controller.h"
Expand All @@ -29,7 +30,11 @@ namespace {
const gfx::VectorIcon& GetIcon(ExtensionsToolbarButton::State state) {
switch (state) {
case ExtensionsToolbarButton::State::kDefault:
return vector_icons::kExtensionChromeRefreshIcon;
return (features::IsChromeRefresh2023() ||
base::FeatureList::IsEnabled(
extensions_features::kExtensionsMenuAccessControl))
? vector_icons::kExtensionChromeRefreshIcon
: vector_icons::kExtensionIcon;
case ExtensionsToolbarButton::State::kAllExtensionsBlocked:
return vector_icons::kExtensionOffIcon;
case ExtensionsToolbarButton::State::kAnyExtensionHasAccess:
Expand Down Expand Up @@ -206,7 +211,11 @@ int ExtensionsToolbarButton::GetIconSize() const {
return kDefaultTouchableIconSize;
}

return kDefaultIconSizeChromeRefresh;
return features::IsChromeRefresh2023() ||
base::FeatureList::IsEnabled(
extensions_features::kExtensionsMenuAccessControl)
? kDefaultIconSizeChromeRefresh
: kDefaultIconSize;
}

std::u16string ExtensionsToolbarButton::GetTooltipText(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
#include "ui/base/l10n/l10n_util.h"
#include "ui/base/metadata/metadata_impl_macros.h"
#include "ui/base/models/image_model.h"
#include "ui/base/ui_base_features.h"
#include "ui/views/interaction/element_tracker_views.h"
#include "ui/views/layout/animating_layout_manager.h"
#include "ui/views/layout/flex_layout.h"
Expand Down Expand Up @@ -188,8 +189,12 @@ ExtensionsToolbarContainer::ExtensionsToolbarContainer(Browser* browser,
break;
}

GetTargetLayoutManager()->SetDefault(views::kMarginsKey,
gfx::Insets::VH(0, 2));
if (features::IsChromeRefresh2023() ||
base::FeatureList::IsEnabled(
extensions_features::kExtensionsMenuAccessControl)) {
GetTargetLayoutManager()->SetDefault(views::kMarginsKey,
gfx::Insets::VH(0, 2));
}

UpdateControlsVisibility();

Expand Down

0 comments on commit e63e849

Please sign in to comment.