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

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

Issue 3624001: Implement Instant on Mac (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 10 years, 2 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
Index: chrome/browser/cocoa/browser_window_controller.mm
===================================================================
--- chrome/browser/cocoa/browser_window_controller.mm (revision 62138)
+++ chrome/browser/cocoa/browser_window_controller.mm (working copy)
@@ -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 @@
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 {
« no previous file with comments | « chrome/browser/cocoa/browser_window_controller.h ('k') | chrome/browser/cocoa/browser_window_controller_private.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698