From 2248de847d23a99779e73d93f9610c1e4cbe8e8a Mon Sep 17 00:00:00 2001 From: Charles Kerr Date: Thu, 22 May 2025 18:20:39 -0500 Subject: [PATCH] refactor: use `base::fixed_flat_set` in `NativeWindowViews::SetAlwaysOnTop()` (#47201) refactor: use base::fixed_flat_set in NativeWindowViews::SetAlwaysOnTop() --- shell/browser/native_window_views.cc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/shell/browser/native_window_views.cc b/shell/browser/native_window_views.cc index 19fd6c6750b6..51203d20c07b 100644 --- a/shell/browser/native_window_views.cc +++ b/shell/browser/native_window_views.cc @@ -20,7 +20,7 @@ #include #include -#include "base/containers/contains.h" +#include "base/containers/fixed_flat_set.h" #include "base/memory/raw_ref.h" #include "base/numerics/ranges.h" #include "base/strings/utf_string_conversions.h" @@ -1157,9 +1157,9 @@ void NativeWindowViews::SetAlwaysOnTop(ui::ZOrderLevel z_order, if (z_order != ui::ZOrderLevel::kNormal) { // On macOS the window is placed behind the Dock for the following levels. // Re-use the same names on Windows to make it easier for the user. - static const std::vector levels = { - "floating", "torn-off-menu", "modal-panel", "main-menu", "status"}; - behind_task_bar_ = base::Contains(levels, level); + static constexpr auto levels = base::MakeFixedFlatSet( + {"floating", "torn-off-menu", "modal-panel", "main-menu", "status"}); + behind_task_bar_ = levels.contains(level); } #endif MoveBehindTaskBarIfNeeded();