summaryrefslogtreecommitdiffstats
path: root/chrome/browser/cocoa/browser_window_controller.mm
diff options
context:
space:
mode:
authorrohitrao@chromium.org <rohitrao@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-10-12 01:34:18 +0000
committerrohitrao@chromium.org <rohitrao@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-10-12 01:34:18 +0000
commit30179058aa633f1052869d75936a09dd8e7b9cf7 (patch)
tree72ef7f6f34bbdd0e8c3d5565ea3bac1f0aba0099 /chrome/browser/cocoa/browser_window_controller.mm
parentf8d60f4b509c4673d5e9558e822dca3de4183e99 (diff)
downloadchromium_src-30179058aa633f1052869d75936a09dd8e7b9cf7.zip
chromium_src-30179058aa633f1052869d75936a09dd8e7b9cf7.tar.gz
chromium_src-30179058aa633f1052869d75936a09dd8e7b9cf7.tar.bz2
[Mac] Initial Instant implementation.
This is a very rough cut. Many things are still unfinished and will be fixed in future CLs: - Clicking on instant results clears the results. - Suggestions do not work yet. - The omnibox popup overlaps with instant results. - HTTP auth dialogs cause crashes. BUG=56385 TEST=No visible impact when --enable-match-preview is not set on the command line. TEST=Instant results should appear when typing in the omnibox. TEST=Instant results should disappear when clicking outside the browser window or clicking on devtools or the sidebar. Review URL: http://codereview.chromium.org/3624001 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@62221 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/cocoa/browser_window_controller.mm')
-rw-r--r--chrome/browser/cocoa/browser_window_controller.mm20
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 {