Index: chrome/browser/search/search.cc |
diff --git a/chrome/browser/search/search.cc b/chrome/browser/search/search.cc |
index 409d14b4d863e5bd67b941dfe1fba5da5d3db6ba..6ff1a97b99323245e5d8f3e9b91fe267fb178376 100644 |
--- a/chrome/browser/search/search.cc |
+++ b/chrome/browser/search/search.cc |
@@ -72,8 +72,7 @@ const char kPrefetchSearchResultsOnSRP[] = "prefetch_results_srp"; |
const char kReuseInstantSearchBasePage[] = "reuse_instant_search_base_page"; |
const char kDisplaySearchButtonFlagName[] = "display_search_button"; |
-const char kOriginChipFlagName[] = "origin_chip"; |
-const char kOriginChipV2FlagName[] = "origin_chip_v2"; |
+const char kOriginChipFlagName[] = "origin_chip_v2"; |
#if !defined(OS_IOS) && !defined(OS_ANDROID) |
const char kEnableQueryExtractionFlagName[] = "query_extraction"; |
#endif |
@@ -623,57 +622,26 @@ DisplaySearchButtonConditions GetDisplaySearchButtonConditions() { |
} |
bool ShouldDisplayOriginChip() { |
- return GetOriginChipPosition() != ORIGIN_CHIP_DISABLED; |
+ return GetOriginChipCondition() != ORIGIN_CHIP_DISABLED; |
} |
-OriginChipPosition GetOriginChipPosition() { |
- if (ShouldDisplayOriginChipV2()) |
- return ORIGIN_CHIP_DISABLED; |
- |
+OriginChipCondition GetOriginChipCondition() { |
const CommandLine* cl = CommandLine::ForCurrentProcess(); |
if (cl->HasSwitch(switches::kDisableOriginChip)) |
return ORIGIN_CHIP_DISABLED; |
- if (cl->HasSwitch(switches::kEnableOriginChipLeadingLocationBar)) |
- return ORIGIN_CHIP_LEADING_LOCATION_BAR; |
- if (cl->HasSwitch(switches::kEnableOriginChip) || |
- cl->HasSwitch(switches::kEnableOriginChipTrailingLocationBar)) |
- return ORIGIN_CHIP_TRAILING_LOCATION_BAR; |
- if (cl->HasSwitch(switches::kEnableOriginChipLeadingMenuButton)) |
- return ORIGIN_CHIP_LEADING_MENU_BUTTON; |
+ if (cl->HasSwitch(switches::kEnableOriginChip)) |
+ return ORIGIN_CHIP_ENABLED; |
+ if (cl->HasSwitch(switches::kEnableOriginChipOnSrp)) |
+ return ORIGIN_CHIP_ON_SRP; |
FieldTrialFlags flags; |
if (!GetFieldTrialInfo(&flags)) |
return ORIGIN_CHIP_DISABLED; |
uint64 value = |
GetUInt64ValueForFlagWithDefault(kOriginChipFlagName, 0, flags); |
- return (value < ORIGIN_CHIP_NUM_VALUES) ? |
- static_cast<OriginChipPosition>(value) : |
- ORIGIN_CHIP_DISABLED; |
-} |
- |
-bool ShouldDisplayOriginChipV2() { |
- return GetOriginChipV2Condition() != ORIGIN_CHIP_V2_DISABLED; |
-} |
- |
-OriginChipV2Condition GetOriginChipV2Condition() { |
- const CommandLine* cl = CommandLine::ForCurrentProcess(); |
- if (cl->HasSwitch(switches::kDisableOriginChipV2)) |
- return ORIGIN_CHIP_V2_DISABLED; |
- if (cl->HasSwitch(switches::kEnableOriginChipV2HideOnMouseRelease)) |
- return ORIGIN_CHIP_V2_HIDE_ON_MOUSE_RELEASE; |
- if (cl->HasSwitch(switches::kEnableOriginChipV2HideOnUserInput)) |
- return ORIGIN_CHIP_V2_HIDE_ON_USER_INPUT; |
- if (cl->HasSwitch(switches::kEnableOriginChipV2OnSrp)) |
- return ORIGIN_CHIP_V2_ON_SRP; |
- |
- FieldTrialFlags flags; |
- if (!GetFieldTrialInfo(&flags)) |
- return ORIGIN_CHIP_V2_DISABLED; |
- uint64 value = |
- GetUInt64ValueForFlagWithDefault(kOriginChipV2FlagName, 0, flags); |
- return (value < ORIGIN_CHIP_V2_NUM_VALUES) ? |
- static_cast<OriginChipV2Condition>(value) : |
- ORIGIN_CHIP_V2_DISABLED; |
+ return ((value < ORIGIN_CHIP_NUM_VALUES) && |
+ (value != ORIGIN_CHIP_UNUSED_PLACEHOLDER)) ? |
+ static_cast<OriginChipCondition>(value) : ORIGIN_CHIP_DISABLED; |
} |
bool ShouldShowGoogleLocalNTP() { |