-
Notifications
You must be signed in to change notification settings - Fork 467
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix DCHECK adding menu separator with hidden items (fixes #3577)
- Loading branch information
1 parent
ed4257c
commit ddb0ab8
Showing
2 changed files
with
29 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
diff --git ui/base/models/simple_menu_model.cc ui/base/models/simple_menu_model.cc | ||
index 88e27362452e5..9c18ac5c77544 100644 | ||
--- ui/base/models/simple_menu_model.cc | ||
+++ ui/base/models/simple_menu_model.cc | ||
@@ -10,6 +10,7 @@ | ||
#include "base/functional/bind.h" | ||
#include "base/location.h" | ||
#include "base/task/single_thread_task_runner.h" | ||
+#include "cef/libcef/features/features.h" | ||
#include "ui/base/l10n/l10n_util.h" | ||
#include "ui/base/models/image_model.h" | ||
#include "ui/gfx/image/image.h" | ||
@@ -170,8 +171,10 @@ void SimpleMenuModel::AddSeparator(MenuSeparatorType separator_type) { | ||
} | ||
|
||
if (items_.at(last_visible_item).type == TYPE_SEPARATOR) { | ||
+#if !BUILDFLAG(ENABLE_CEF) | ||
DCHECK_EQ(NORMAL_SEPARATOR, separator_type); | ||
DCHECK_EQ(NORMAL_SEPARATOR, items_.at(last_visible_item).separator_type); | ||
+#endif | ||
// The last item is already a separator. Don't add another. | ||
return; | ||
} |