Commit 06a82880 authored by mad@chromium.org's avatar mad@chromium.org

Only update a "not already visible" compact nav bar when we change host or scheme.

BUG=83755
TEST=Make sure the CompactNav bar shows up when changing hosts or scheme (e.g., from https to http) but doesn't show otherwise.

Review URL: http://codereview.chromium.org/7069002

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@86645 0039d316-1c4b-4281-b951-d872f2087c98
parent b7265d26
......@@ -333,10 +333,20 @@ void CompactLocationBarViewHost::TabMoved(TabContentsWrapper* contents,
void CompactLocationBarViewHost::TabChangedAt(TabContentsWrapper* contents,
int index,
TabChangeType change_type) {
if (IsCurrentTabIndex(index) && change_type ==
TabStripModelObserver::LOADING_ONLY) {
bool was_not_visible = !IsVisible();
if (IsCurrentTabIndex(index) &&
change_type == TabStripModelObserver::LOADING_ONLY) {
TabContents* tab_contents = contents->tab_contents();
bool was_not_visible = !IsVisible();
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() &&
new_url.scheme() == old_url.scheme()) {
return;
}
}
Update(tab_contents, false);
if (was_not_visible) {
if (tab_contents->is_loading()) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment