diff options
Diffstat (limited to 'chrome/browser/cocoa/browser_window_controller.mm')
-rw-r--r-- | chrome/browser/cocoa/browser_window_controller.mm | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/chrome/browser/cocoa/browser_window_controller.mm b/chrome/browser/cocoa/browser_window_controller.mm index f2fc066d..86f3b5e 100644 --- a/chrome/browser/cocoa/browser_window_controller.mm +++ b/chrome/browser/cocoa/browser_window_controller.mm @@ -1372,6 +1372,11 @@ } - (void)onReplaceTabWithContents:(TabContents*)contents { + // This is only called when instant results are committed. Simply remove the + // preview view; the tab strip controller will reinstall the view as the + // active view. + [previewableContentsController_ hidePreview]; + [self updateBookmarkBarVisibilityWithAnimation:NO]; } - (void)onSelectedTabChange:(TabStripModelObserver::TabChangeType)change { @@ -1718,6 +1723,21 @@ willAnimateFromState:(bookmarks::VisualState)oldState return browser_->tabstrip_model()->delegate()->UseVerticalTabs(); } +- (void)showInstant:(TabContents*)previewContents { + [previewableContentsController_ showPreview:previewContents]; + [self updateBookmarkBarVisibilityWithAnimation:NO]; +} + +- (void)hideInstant { + // TODO(rohitrao): Revisit whether or not this method should be called when + // instant isn't showing. + if (![previewableContentsController_ isShowingPreview]) + return; + + [previewableContentsController_ hidePreview]; + [self updateBookmarkBarVisibilityWithAnimation:NO]; +} + - (void)sheetDidEnd:(NSWindow*)sheet returnCode:(NSInteger)code context:(void*)context { |