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

Unified Diff: chrome/browser/ui/views/compact_nav/compact_location_bar_view_host.cc

Issue 7069002: Only update a "not already visible" compact nav bar when we change host or scheme. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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()) {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698