| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include <Carbon/Carbon.h> | 5 #include <Carbon/Carbon.h> |
| 6 | 6 |
| 7 #include "app/l10n_util_mac.h" | 7 #include "app/l10n_util_mac.h" |
| 8 #include "base/mac_util.h" | 8 #include "base/mac_util.h" |
| 9 #include "base/scoped_nsdisable_screen_updates.h" | 9 #include "base/scoped_nsdisable_screen_updates.h" |
| 10 #import "base/scoped_nsobject.h" | 10 #import "base/scoped_nsobject.h" |
| (...skipping 1085 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1096 } | 1096 } |
| 1097 | 1097 |
| 1098 - (void)selectTabWithContents:(TabContents*)newContents | 1098 - (void)selectTabWithContents:(TabContents*)newContents |
| 1099 previousContents:(TabContents*)oldContents | 1099 previousContents:(TabContents*)oldContents |
| 1100 atIndex:(NSInteger)index | 1100 atIndex:(NSInteger)index |
| 1101 userGesture:(bool)wasUserGesture { | 1101 userGesture:(bool)wasUserGesture { |
| 1102 DCHECK(oldContents != newContents); | 1102 DCHECK(oldContents != newContents); |
| 1103 | 1103 |
| 1104 // Update various elements that are interested in knowing the current | 1104 // Update various elements that are interested in knowing the current |
| 1105 // TabContents. | 1105 // TabContents. |
| 1106 #if 0 | |
| 1107 // TODO(pinkerton):Update as more things become window-specific | |
| 1108 contents_container_->SetTabContents(newContents); | |
| 1109 #endif | |
| 1110 | 1106 |
| 1111 // Update all the UI bits. | 1107 // Update all the UI bits. |
| 1112 windowShim_->UpdateTitleBar(); | 1108 windowShim_->UpdateTitleBar(); |
| 1113 | 1109 |
| 1114 #if 0 | |
| 1115 // TODO(pinkerton):Update as more things become window-specific | |
| 1116 toolbar_->SetProfile(newContents->profile()); | |
| 1117 UpdateToolbar(newContents, true); | |
| 1118 UpdateUIForContents(newContents); | |
| 1119 #endif | |
| 1120 | |
| 1121 // Update the bookmark bar. | 1110 // Update the bookmark bar. |
| 1122 [self updateBookmarkBarVisibilityWithAnimation:NO]; | 1111 [self updateBookmarkBarVisibilityWithAnimation:NO]; |
| 1123 } | 1112 } |
| 1124 | 1113 |
| 1125 - (void)tabChangedWithContents:(TabContents*)contents | 1114 - (void)tabChangedWithContents:(TabContents*)contents |
| 1126 atIndex:(NSInteger)index | 1115 atIndex:(NSInteger)index |
| 1127 loadingOnly:(BOOL)loading { | 1116 changeType:(TabStripModelObserver::TabChangeType)change { |
| 1128 if (index == browser_->tabstrip_model()->selected_index()) { | 1117 if (index == browser_->tabstrip_model()->selected_index()) { |
| 1129 // Update titles if this is the currently selected tab. | 1118 // Update titles if this is the currently selected tab and if it isn't just |
| 1130 windowShim_->UpdateTitleBar(); | 1119 // the loading state which changed. |
| 1120 if (change != TabStripModelObserver::LOADING_ONLY) |
| 1121 windowShim_->UpdateTitleBar(); |
| 1122 |
| 1123 // Update the bookmark bar if this is the currently selected tab and if it |
| 1124 // isn't just the title which changed. This for transitions between the NTP |
| 1125 // (showing its floating bookmark bar) and normal web pages (showing no |
| 1126 // bookmark bar). |
| 1127 // TODO(viettrungluu): perhaps update to not terminate running animations? |
| 1128 if (change != TabStripModelObserver::TITLE_NOT_LOADING) |
| 1129 [self updateBookmarkBarVisibilityWithAnimation:NO]; |
| 1131 } | 1130 } |
| 1132 | |
| 1133 // Update the bookmark bar. | |
| 1134 [self updateBookmarkBarVisibilityWithAnimation:NO]; | |
| 1135 } | 1131 } |
| 1136 | 1132 |
| 1137 - (void)userChangedTheme { | 1133 - (void)userChangedTheme { |
| 1138 [self setTheme]; | 1134 [self setTheme]; |
| 1139 NSNotificationCenter* defaultCenter = [NSNotificationCenter defaultCenter]; | 1135 NSNotificationCenter* defaultCenter = [NSNotificationCenter defaultCenter]; |
| 1140 [defaultCenter postNotificationName:kGTMThemeDidChangeNotification | 1136 [defaultCenter postNotificationName:kGTMThemeDidChangeNotification |
| 1141 object:theme_]; | 1137 object:theme_]; |
| 1142 // TODO(dmaclach): Instead of redrawing the whole window, views that care | 1138 // TODO(dmaclach): Instead of redrawing the whole window, views that care |
| 1143 // about the active window state should be registering for notifications. | 1139 // about the active window state should be registering for notifications. |
| 1144 [[self window] setViewsNeedDisplay:YES]; | 1140 [[self window] setViewsNeedDisplay:YES]; |
| (...skipping 574 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1719 [theme setValue:frameOverlayInactiveImage | 1715 [theme setValue:frameOverlayInactiveImage |
| 1720 forAttribute:@"overlay" | 1716 forAttribute:@"overlay" |
| 1721 style:GTMThemeStyleWindow | 1717 style:GTMThemeStyleWindow |
| 1722 state:GTMThemeStateInactiveWindow]; | 1718 state:GTMThemeStateInactiveWindow]; |
| 1723 } | 1719 } |
| 1724 | 1720 |
| 1725 return theme; | 1721 return theme; |
| 1726 } | 1722 } |
| 1727 @end | 1723 @end |
| 1728 | 1724 |
| OLD | NEW |