Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(6490)

Unified Diff: chrome/browser/ui/toolbar/toolbar_model_impl.cc

Issue 266263002: [OriginChip] Add an option to display only on search result pages. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Respond to comments Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/ui/omnibox/omnibox_view.cc ('k') | chrome/common/chrome_switches.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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(
« no previous file with comments | « chrome/browser/ui/omnibox/omnibox_view.cc ('k') | chrome/common/chrome_switches.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698