Index: chrome/browser/ui/toolbar/toolbar_model_impl.cc |
diff --git a/chrome/browser/ui/toolbar/toolbar_model_impl.cc b/chrome/browser/ui/toolbar/toolbar_model_impl.cc |
index 50df4f2e268ce70cf1ae3ba36a9ec5fd7632466f..92e9707296b15ce334e1f82360cc0302bd29ba97 100644 |
--- a/chrome/browser/ui/toolbar/toolbar_model_impl.cc |
+++ b/chrome/browser/ui/toolbar/toolbar_model_impl.cc |
@@ -182,10 +182,18 @@ bool ToolbarModelImpl::WouldOmitURLDueToOriginChip() const { |
} |
} |
- bool should_display_origin_chip = |
- chrome::ShouldDisplayOriginChip() || chrome::ShouldDisplayOriginChipV2(); |
- return should_display_origin_chip && delegate_->InTabbedBrowser() && |
- ShouldDisplayURL() && url_replacement_enabled(); |
+ if (!delegate_->InTabbedBrowser() || !ShouldDisplayURL() || |
+ !url_replacement_enabled()) |
+ return false; |
+ |
+ if (chrome::ShouldDisplayOriginChip()) |
+ return true; |
+ |
+ const chrome::OriginChipV2Condition chip_condition = |
+ chrome::GetOriginChipV2Condition(); |
+ return (chip_condition != chrome::ORIGIN_CHIP_V2_DISABLED) && |
+ ((chip_condition != chrome::ORIGIN_CHIP_V2_ON_SRP) || |
+ WouldPerformSearchTermReplacement(false)); |
} |
bool ToolbarModelImpl::WouldPerformSearchTermReplacement( |