Skip to content

Commit

Permalink
Applying new dimensions for Classic Omnibox.
Browse files Browse the repository at this point in the history
  • Loading branch information
win32ss committed Apr 2, 2024
1 parent 6d16c0e commit 05ed019
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
11 changes: 7 additions & 4 deletions chrome/browser/ui/views/location_bar/location_bar_view.cc
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,8 @@ LocationBarView::LocationBarView(Browser* browser,
if (features::IsChromeRefresh2023()) {
views::FocusRing::Get(this)->SetOutsetFocusRingDisabled(true);
}
views::InstallPillHighlightPathGenerator(this);
if (!base::CommandLine::ForCurrentProcess()->HasSwitch("classic-omnibox"))
views::InstallPillHighlightPathGenerator(this);

#if BUILDFLAG(IS_MAC)
geolocation_permission_observation_.Observe(
Expand Down Expand Up @@ -435,6 +436,8 @@ bool LocationBarView::IsInitialized() const {
}

int LocationBarView::GetBorderRadius() const {
if (base::CommandLine::ForCurrentProcess()->HasSwitch("classic-omnibox"))
return 0;
return ChromeLayoutProvider::Get()->GetCornerRadiusMetric(
views::Emphasis::kMaximum, size());
}
Expand Down Expand Up @@ -1155,13 +1158,13 @@ void LocationBarView::RefreshBackground() {
border_color = color_provider->GetColor(kColorLocationBarBorderOnMismatch);
}

if (is_popup_mode_) {
if (is_popup_mode_) {
SetBackground(views::CreateSolidBackground(background_color));
} else {
} else {
SetBackground(CreateRoundRectBackground(
background_color, border_color, /*blend_mode=*/SkBlendMode::kSrcOver,
/*antialias=*/true, /*should_border_scale=*/true));
}
}

// Keep the views::Textfield in sync. It needs an opaque background to
// correctly enable subpixel AA.
Expand Down
3 changes: 3 additions & 0 deletions ui/views/layout/layout_provider.cc
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

#include <algorithm>

#include "base/command_line.h"
#include "base/containers/fixed_flat_map.h"
#include "base/logging.h"
#include "ui/base/ui_base_features.h"
Expand Down Expand Up @@ -205,6 +206,8 @@ ShapeSysTokens GetShapeSysToken(ShapeContextTokens id) {

int LayoutProvider::GetCornerRadiusMetric(ShapeContextTokens id,
const gfx::Size& size) const {
if (!base::CommandLine::ForCurrentProcess()->HasSwitch("classic-omnibox"))
return 0;
if (!features::IsChromeRefresh2023()) {
switch (id) {
case ShapeContextTokens::kBadgeRadius:
Expand Down

0 comments on commit 05ed019

Please sign in to comment.