summaryrefslogtreecommitdiffstats
path: root/chrome/browser/browser.cc
diff options
context:
space:
mode:
authorsky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-09-24 17:00:13 +0000
committersky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-09-24 17:00:13 +0000
commit3aac77aeb279763357f07b9f0f15e6ad9c8fceb0 (patch)
tree69d82f95a53cb1a7d7242dc360184edabcd16eb1 /chrome/browser/browser.cc
parent8f5359cde5640fc63cd84605fd9197d97af0ed18 (diff)
downloadchromium_src-3aac77aeb279763357f07b9f0f15e6ad9c8fceb0.zip
chromium_src-3aac77aeb279763357f07b9f0f15e6ad9c8fceb0.tar.gz
chromium_src-3aac77aeb279763357f07b9f0f15e6ad9c8fceb0.tar.bz2
Adds support for sending script when the user accepts instant
results. Also tweaks the delegate interface to be a bit more sensical. BUG=54833 TEST=see bug Review URL: http://codereview.chromium.org/3440025 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@60479 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/browser.cc')
-rw-r--r--chrome/browser/browser.cc9
1 files changed, 4 insertions, 5 deletions
diff --git a/chrome/browser/browser.cc b/chrome/browser/browser.cc
index dea3cb9..a326149 100644
--- a/chrome/browser/browser.cc
+++ b/chrome/browser/browser.cc
@@ -1254,7 +1254,7 @@ void Browser::OpenCurrentURL() {
// TODO(sky): support other dispositions.
if (open_disposition == CURRENT_TAB && match_preview() &&
match_preview()->is_active()) {
- match_preview()->CommitCurrentPreview();
+ match_preview()->CommitCurrentPreview(MatchPreview::COMMIT_PRESSED_ENTER);
return;
}
@@ -3222,17 +3222,16 @@ void Browser::HideMatchPreview() {
window_->HideMatchPreview();
}
-void Browser::CommitMatchPreview() {
+void Browser::CommitMatchPreview(TabContents* preview_contents) {
TabContents* tab_contents = match_preview_->tab_contents();
int index = tabstrip_model_->GetIndexOfTabContents(tab_contents);
DCHECK_NE(-1, index);
- scoped_ptr<TabContents> preview_contents(
- match_preview()->ReleasePreviewContents(true));
preview_contents->controller().CopyStateFromAndPrune(
tab_contents->controller());
// TabStripModel takes ownership of preview_contents.
tabstrip_model_->ReplaceTabContentsAt(
- index, preview_contents.release(),
+ index,
+ preview_contents,
TabStripModelObserver::REPLACE_MATCH_PREVIEW);
}