Chromium Code Reviews| 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 8f2edcd0c7b07c1d13c637eff1042f1a1c57b671..681e57adbd77a1e8004a2f6a325d234bb78e5475 100644 |
| --- a/chrome/browser/ui/toolbar/toolbar_model_impl.cc |
| +++ b/chrome/browser/ui/toolbar/toolbar_model_impl.cc |
| @@ -165,9 +165,6 @@ base::string16 ToolbarModelImpl::GetText() const { |
| if (!search_terms.empty()) |
| return search_terms; |
| - if (WouldOmitURLDueToOriginChip()) |
| - return base::string16(); |
| - |
| return GetFormattedURL(NULL); |
| } |
| @@ -234,11 +231,10 @@ ToolbarModel::SecurityLevel ToolbarModelImpl::GetSecurityLevel( |
| int ToolbarModelImpl::GetIcon() const { |
| if (WouldPerformSearchTermReplacement(false)) { |
| - // The secured version of the search icon is necessary if neither the search |
| - // button nor origin chip are present to indicate the security state. |
| + // The secured version of the search icon is necessary if the search button |
| + // is not present to indicate the security state. |
| return (chrome::GetDisplaySearchButtonConditions() == |
| - chrome::DISPLAY_SEARCH_BUTTON_NEVER) && |
| - !chrome::ShouldDisplayOriginChip() ? |
| + chrome::DISPLAY_SEARCH_BUTTON_NEVER) ? |
| IDR_OMNIBOX_SEARCH_SECURED : IDR_OMNIBOX_SEARCH; |
| } |
| @@ -306,48 +302,6 @@ bool ToolbarModelImpl::ShouldDisplayURL() const { |
| return !chrome::IsInstantNTP(delegate_->GetActiveWebContents()); |
| } |
| -bool ToolbarModelImpl::WouldOmitURLDueToOriginChip() const { |
| - const char kInterstitialShownKey[] = "interstitial_shown"; |
| - |
| - // When users type URLs and hit enter, continue to show those URLs until |
| - // the navigation commits or an interstitial is shown, because having the |
| - // omnibox clear immediately feels like the input was ignored. |
| - NavigationController* navigation_controller = GetNavigationController(); |
| - if (navigation_controller) { |
| - NavigationEntry* pending_entry = navigation_controller->GetPendingEntry(); |
| - if (pending_entry) { |
| - const NavigationEntry* visible_entry = |
| - navigation_controller->GetVisibleEntry(); |
| - base::string16 unused; |
| - // Keep track that we've shown the origin chip on an interstitial so it |
| - // can be shown even after the interstitial was dismissed, to avoid |
| - // showing the chip, removing it and then showing it again. |
| - if (visible_entry && |
| - visible_entry->GetPageType() == content::PAGE_TYPE_INTERSTITIAL && |
| - !pending_entry->GetExtraData(kInterstitialShownKey, &unused)) |
| - pending_entry->SetExtraData(kInterstitialShownKey, base::string16()); |
| - const ui::PageTransition transition_type = |
| - pending_entry->GetTransitionType(); |
| - if ((transition_type & ui::PAGE_TRANSITION_TYPED) != 0 && |
| - !pending_entry->GetExtraData(kInterstitialShownKey, &unused)) |
| - return false; |
| - } |
| - } |
| - |
| - if (!delegate_->InTabbedBrowser() || !ShouldDisplayURL() || |
|
Justin Donnelly
2014/11/21 19:15:24
This is the only place InTabbedBrowser is called.
|
| - !url_replacement_enabled()) |
| - return false; |
| - |
| - if (chrome::ShouldDisplayOriginChip()) |
| - return true; |
| - |
| - const chrome::OriginChipCondition chip_condition = |
| - chrome::GetOriginChipCondition(); |
| - return (chip_condition == chrome::ORIGIN_CHIP_ALWAYS) || |
| - ((chip_condition == chrome::ORIGIN_CHIP_ON_SRP) && |
| - WouldPerformSearchTermReplacement(false)); |
| -} |
| - |
| NavigationController* ToolbarModelImpl::GetNavigationController() const { |
| // This |current_tab| can be NULL during the initialization of the |
| // toolbar during window creation (i.e. before any tabs have been added |