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

Unified Diff: chrome/browser/cocoa/browser_window_controller.mm

Issue 449056: Mac: change tab change notifications to pass full TabChangeType. (Closed)
Patch Set: Rebased ToT. Created 11 years, 1 month 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 | chrome/browser/cocoa/tab_strip_controller.mm » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/cocoa/browser_window_controller.mm
diff --git a/chrome/browser/cocoa/browser_window_controller.mm b/chrome/browser/cocoa/browser_window_controller.mm
index ab139df57683deea8c76b0955919d303ad250e48..d22e5e50524acd6c34750747b3f83421bbd23d9b 100644
--- a/chrome/browser/cocoa/browser_window_controller.mm
+++ b/chrome/browser/cocoa/browser_window_controller.mm
@@ -1103,35 +1103,31 @@ willPositionSheet:(NSWindow*)sheet
// Update various elements that are interested in knowing the current
// TabContents.
-#if 0
-// TODO(pinkerton):Update as more things become window-specific
- contents_container_->SetTabContents(newContents);
-#endif
// Update all the UI bits.
windowShim_->UpdateTitleBar();
-#if 0
-// TODO(pinkerton):Update as more things become window-specific
- toolbar_->SetProfile(newContents->profile());
- UpdateToolbar(newContents, true);
- UpdateUIForContents(newContents);
-#endif
-
// Update the bookmark bar.
[self updateBookmarkBarVisibilityWithAnimation:NO];
}
- (void)tabChangedWithContents:(TabContents*)contents
atIndex:(NSInteger)index
- loadingOnly:(BOOL)loading {
+ changeType:(TabStripModelObserver::TabChangeType)change {
if (index == browser_->tabstrip_model()->selected_index()) {
- // Update titles if this is the currently selected tab.
- windowShim_->UpdateTitleBar();
+ // Update titles if this is the currently selected tab and if it isn't just
+ // the loading state which changed.
+ if (change != TabStripModelObserver::LOADING_ONLY)
+ windowShim_->UpdateTitleBar();
+
+ // Update the bookmark bar if this is the currently selected tab and if it
+ // isn't just the title which changed. This for transitions between the NTP
+ // (showing its floating bookmark bar) and normal web pages (showing no
+ // bookmark bar).
+ // TODO(viettrungluu): perhaps update to not terminate running animations?
+ if (change != TabStripModelObserver::TITLE_NOT_LOADING)
+ [self updateBookmarkBarVisibilityWithAnimation:NO];
}
-
- // Update the bookmark bar.
- [self updateBookmarkBarVisibilityWithAnimation:NO];
}
- (void)userChangedTheme {
« no previous file with comments | « no previous file | chrome/browser/cocoa/tab_strip_controller.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698