refactor: use base::fixed_flat_set in NativeWindowViews::SetAlwaysOnTop() (#47201)
refactor: use base::fixed_flat_set in NativeWindowViews::SetAlwaysOnTop()
This commit is contained in:
parent
38e7ff944e
commit
2248de847d
1 changed files with 4 additions and 4 deletions
|
|
@ -20,7 +20,7 @@
|
||||||
#include <utility>
|
#include <utility>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
#include "base/containers/contains.h"
|
#include "base/containers/fixed_flat_set.h"
|
||||||
#include "base/memory/raw_ref.h"
|
#include "base/memory/raw_ref.h"
|
||||||
#include "base/numerics/ranges.h"
|
#include "base/numerics/ranges.h"
|
||||||
#include "base/strings/utf_string_conversions.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) {
|
if (z_order != ui::ZOrderLevel::kNormal) {
|
||||||
// On macOS the window is placed behind the Dock for the following levels.
|
// 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.
|
// Re-use the same names on Windows to make it easier for the user.
|
||||||
static const std::vector<std::string> levels = {
|
static constexpr auto levels = base::MakeFixedFlatSet<std::string_view>(
|
||||||
"floating", "torn-off-menu", "modal-panel", "main-menu", "status"};
|
{"floating", "torn-off-menu", "modal-panel", "main-menu", "status"});
|
||||||
behind_task_bar_ = base::Contains(levels, level);
|
behind_task_bar_ = levels.contains(level);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
MoveBehindTaskBarIfNeeded();
|
MoveBehindTaskBarIfNeeded();
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue