diff options
author | erg@google.com <erg@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-09-12 00:02:49 +0000 |
---|---|---|
committer | erg@google.com <erg@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-09-12 00:02:49 +0000 |
commit | f5ed8349d2e0d6ceeb31d5e7598abb808a9e2ae5 (patch) | |
tree | 115e0b7e7c7b08fab29b537fd9e1f63355099d2c /chrome | |
parent | 4494583fc0604f6b15df8a632ff2ad77de933038 (diff) | |
download | chromium_src-f5ed8349d2e0d6ceeb31d5e7598abb808a9e2ae5.zip chromium_src-f5ed8349d2e0d6ceeb31d5e7598abb808a9e2ae5.tar.gz chromium_src-f5ed8349d2e0d6ceeb31d5e7598abb808a9e2ae5.tar.bz2 |
Actually fix the javascript alert crasher in a way that
doesn't introduce new crashes.
B=1368898
Review URL: http://codereview.chromium.org/1966
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@2104 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r-- | chrome/browser/views/constrained_window_impl.cc | 13 | ||||
-rw-r--r-- | chrome/browser/views/constrained_window_impl.h | 4 |
2 files changed, 16 insertions, 1 deletions
diff --git a/chrome/browser/views/constrained_window_impl.cc b/chrome/browser/views/constrained_window_impl.cc index 85d9e58..77b1854 100644 --- a/chrome/browser/views/constrained_window_impl.cc +++ b/chrome/browser/views/constrained_window_impl.cc @@ -850,6 +850,8 @@ void ConstrainedWindowImpl::ActivateConstrainedWindow() { return; } + StopSuppressedAnimationIfRunning(); + // Other pop-ups are simply moved to the front of the z-order. SetWindowPos(HWND_TOP, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE | SWP_SHOWWINDOW); @@ -1016,6 +1018,14 @@ void ConstrainedWindowImpl::StartSuppressedAnimation() { animation_->Start(); } +void ConstrainedWindowImpl::StopSuppressedAnimationIfRunning() { + if(animation_.get()) { + animation_->Stop(); + SetTitlebarVisibilityPercentage(1.0); + animation_.reset(); + } +} + void ConstrainedWindowImpl::CloseContents(TabContents* source) { Close(); } @@ -1158,6 +1168,9 @@ bool ConstrainedWindowImpl::CanDetach() const { void ConstrainedWindowImpl::Detach() { DCHECK(CanDetach()); + + StopSuppressedAnimationIfRunning(); + // Tell the container not to restore focus to whatever view was focused last, // since this will interfere with the new window activation in the case where // a constrained window is destroyed by being detached. diff --git a/chrome/browser/views/constrained_window_impl.h b/chrome/browser/views/constrained_window_impl.h index 46022ae..64456ae 100644 --- a/chrome/browser/views/constrained_window_impl.h +++ b/chrome/browser/views/constrained_window_impl.h @@ -93,6 +93,9 @@ class ConstrainedWindowImpl : public ConstrainedWindow, // this suppressed constrained popup window. void StartSuppressedAnimation(); + // Stops the ConstrainedWindowAnimation, making the entire titlebar visible. + void StopSuppressedAnimationIfRunning(); + protected: // Windows message handlers: virtual void OnDestroy(); @@ -202,4 +205,3 @@ class ConstrainedWindowImpl : public ConstrainedWindow, }; #endif // #ifndef CHROME_BROWSER_CONSTRAINED_WINDOW_IMPL_H_ - |