Chromium Code Reviews| Index: chrome/browser/ui/views/compact_nav/compact_location_bar_view_host.cc |
| =================================================================== |
| --- chrome/browser/ui/views/compact_nav/compact_location_bar_view_host.cc (revision 86434) |
| +++ chrome/browser/ui/views/compact_nav/compact_location_bar_view_host.cc (working copy) |
| @@ -327,10 +327,20 @@ |
| void CompactLocationBarViewHost::TabChangedAt(TabContentsWrapper* contents, |
| int index, |
| TabChangeType change_type) { |
| - if (IsCurrentTabIndex(index) && change_type == |
| - TabStripModelObserver::LOADING_ONLY) { |
| + if (IsCurrentTabIndex(index) && |
| + change_type == TabStripModelObserver::LOADING_ONLY) { |
| + TabContents* tab_contents = contents->tab_contents(); |
| bool was_not_visible = !IsVisible(); |
| - TabContents* tab_contents = contents->tab_contents(); |
| + if (was_not_visible) { |
| + // Only show the compact navigation bar when we change hosts or scheme. |
| + const GURL& new_url = tab_contents->GetURL(); |
| + GURL old_url = GetCompactLocationBarView()->location_bar_view()-> |
| + location_entry()->model()->PermanentURL(); |
| + if (old_url.has_host() && new_url.host() == old_url.host() && |
|
SteveT
2011/05/25 04:30:29
Just checking your logic here. What is an example
|
| + new_url.scheme() == old_url.scheme()) { |
| + return; |
| + } |
| + } |
| Update(tab_contents, false); |
| if (was_not_visible) { |
| if (tab_contents->is_loading()) { |