diff options
author | sky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-10-14 15:30:40 +0000 |
---|---|---|
committer | sky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-10-14 15:30:40 +0000 |
commit | c65e2f15891448a06a89c7a2e0e9aa74d1a44c67 (patch) | |
tree | 0a8f6b8d60b332a9d4c60f85046f8a3f7ba3e96d /chrome/browser/instant | |
parent | 87996f6636dd308b649e38e7b83df05045e62b81 (diff) | |
download | chromium_src-c65e2f15891448a06a89c7a2e0e9aa74d1a44c67.zip chromium_src-c65e2f15891448a06a89c7a2e0e9aa74d1a44c67.tar.gz chromium_src-c65e2f15891448a06a89c7a2e0e9aa74d1a44c67.tar.bz2 |
Fixes instant so that it correctly deals with child contents. I've
changed around BlockedPopupContainer so that it can handle any types
and made TabContents offer a mode to block all child content.
BUG=58927
TEST=enable instant, go to a site that would normally show a popup on
entering (or explicitly enable all popups). While typing in
the omnibox the popup shouldn't appear, but as soon as you
commit the instant result it should appear.
Review URL: http://codereview.chromium.org/3694005
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@62553 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/instant')
-rw-r--r-- | chrome/browser/instant/instant_controller.cc | 8 | ||||
-rw-r--r-- | chrome/browser/instant/instant_controller.h | 6 | ||||
-rw-r--r-- | chrome/browser/instant/instant_loader.cc | 1 |
3 files changed, 14 insertions, 1 deletions
diff --git a/chrome/browser/instant/instant_controller.cc b/chrome/browser/instant/instant_controller.cc index ac0cbfd..5afaca7 100644 --- a/chrome/browser/instant/instant_controller.cc +++ b/chrome/browser/instant/instant_controller.cc @@ -116,7 +116,9 @@ bool InstantController::IsCurrent() { void InstantController::CommitCurrentPreview(InstantCommitType type) { DCHECK(loader_manager_.get()); DCHECK(loader_manager_->current_loader()); - delegate_->CommitInstant(ReleasePreviewContents(type)); + TabContents* tab = ReleasePreviewContents(type); + delegate_->CommitInstant(tab); + CompleteRelease(tab); } void InstantController::SetCommitOnMouseUp() { @@ -145,6 +147,10 @@ TabContents* InstantController::ReleasePreviewContents(InstantCommitType type) { return tab; } +void InstantController::CompleteRelease(TabContents* tab) { + tab->SetAllContentsBlocked(false); +} + TabContents* InstantController::GetPreviewContents() { return loader_manager_.get() ? loader_manager_->current_loader()->preview_contents() : NULL; diff --git a/chrome/browser/instant/instant_controller.h b/chrome/browser/instant/instant_controller.h index dd4631a..d06bde6 100644 --- a/chrome/browser/instant/instant_controller.h +++ b/chrome/browser/instant/instant_controller.h @@ -87,8 +87,14 @@ class InstantController : public InstantLoaderDelegate { // Releases the preview TabContents passing ownership to the caller. This is // intended to be called when the preview TabContents is committed. This does // not notify the delegate. + // WARNING: be sure and invoke CompleteRelease after adding the returned + // TabContents to a tabstrip. TabContents* ReleasePreviewContents(InstantCommitType type); + // Does cleanup after the preview contents has been added to the tabstrip. + // Invoke this if you explicitly invoke ReleasePreviewContents. + void CompleteRelease(TabContents* tab); + // TabContents the match is being shown for. TabContents* tab_contents() const { return tab_contents_; } diff --git a/chrome/browser/instant/instant_loader.cc b/chrome/browser/instant/instant_loader.cc index f1e7dd3..ed0f59e 100644 --- a/chrome/browser/instant/instant_loader.cc +++ b/chrome/browser/instant/instant_loader.cc @@ -536,6 +536,7 @@ void InstantLoader::Update(TabContents* tab_contents, preview_contents_.reset( new TabContents(tab_contents->profile(), NULL, MSG_ROUTING_NONE, NULL, NULL)); + preview_contents_->SetAllContentsBlocked(true); // Propagate the max page id. That way if we end up merging the two // NavigationControllers (which happens if we commit) none of the page ids // will overlap. |