diff options
author | erikkay@chromium.org <erikkay@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-09-18 21:42:19 +0000 |
---|---|---|
committer | erikkay@chromium.org <erikkay@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-09-18 21:42:19 +0000 |
commit | 0f320ca605db3ab928ee1a8f57ff4c6ea195b021 (patch) | |
tree | 0139f0fe9531653f5b9f22a2706dc6ff7438d7c1 /chrome/browser/views | |
parent | 7fcb792736cc10cc20a84cce7fe6f7c5d2470bf9 (diff) | |
download | chromium_src-0f320ca605db3ab928ee1a8f57ff4c6ea195b021.zip chromium_src-0f320ca605db3ab928ee1a8f57ff4c6ea195b021.tar.gz chromium_src-0f320ca605db3ab928ee1a8f57ff4c6ea195b021.tar.bz2 |
Change BrowserBubble to use Close instead of CloseNow. This should make
it less susceptible to crashes in certain use cases.
Remove a delay in destroying the widget that was added to work around
the old crash.
BUG=18248
TEST=none
Review URL: http://codereview.chromium.org/211027
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@26625 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/views')
-rw-r--r-- | chrome/browser/views/browser_bubble.cc | 3 | ||||
-rw-r--r-- | chrome/browser/views/browser_bubble.h | 2 | ||||
-rw-r--r-- | chrome/browser/views/browser_bubble_gtk.cc | 9 | ||||
-rw-r--r-- | chrome/browser/views/browser_bubble_win.cc | 13 | ||||
-rw-r--r-- | chrome/browser/views/extensions/extension_shelf.cc | 3 |
5 files changed, 15 insertions, 15 deletions
diff --git a/chrome/browser/views/browser_bubble.cc b/chrome/browser/views/browser_bubble.cc index de6959b..42a3e7f 100644 --- a/chrome/browser/views/browser_bubble.cc +++ b/chrome/browser/views/browser_bubble.cc @@ -24,7 +24,8 @@ BrowserBubble::BrowserBubble(views::View* view, views::Widget* frame, BrowserBubble::~BrowserBubble() { DCHECK(!attached_); - popup_->CloseNow(); + popup_->Close(); + // Don't call DetachFromBrowser from here. It needs to talk to the // BrowserView to deregister itself, and if BrowserBubble is owned // by a child of BrowserView, then it's possible that this stack frame diff --git a/chrome/browser/views/browser_bubble.h b/chrome/browser/views/browser_bubble.h index 03e9377..ed03fa0 100644 --- a/chrome/browser/views/browser_bubble.h +++ b/chrome/browser/views/browser_bubble.h @@ -90,7 +90,7 @@ class BrowserBubble { views::View* view_; // The widget that this bubble is in. - scoped_ptr<views::Widget> popup_; + views::Widget* popup_; // The bounds relative to the frame. gfx::Rect bounds_; diff --git a/chrome/browser/views/browser_bubble_gtk.cc b/chrome/browser/views/browser_bubble_gtk.cc index b30fb1c..d73f1df 100644 --- a/chrome/browser/views/browser_bubble_gtk.cc +++ b/chrome/browser/views/browser_bubble_gtk.cc @@ -12,11 +12,10 @@ void BrowserBubble::InitPopup() { gfx::NativeView native_view = frame_->GetNativeView(); gfx::NativeWindow native_window = frame_->GetWindow()->GetNativeWindow(); views::WidgetGtk* pop = new views::WidgetGtk(views::WidgetGtk::TYPE_POPUP); - pop->set_delete_on_destroy(false); pop->SetOpacity(0xFF); pop->Init(native_view, bounds_); pop->SetContentsView(view_); - popup_.reset(pop); + popup_ = pop; Reposition(); BrowserView* browser_view = @@ -27,14 +26,14 @@ void BrowserBubble::InitPopup() { } void BrowserBubble::MovePopup(int x, int y, int w, int h) { - views::WidgetGtk* pop = static_cast<views::WidgetGtk*>(popup_.get()); + views::WidgetGtk* pop = static_cast<views::WidgetGtk*>(popup_); pop->SetBounds(gfx::Rect(x, y, w, h)); } void BrowserBubble::Show() { if (visible_) return; - views::WidgetGtk* pop = static_cast<views::WidgetGtk*>(popup_.get()); + views::WidgetGtk* pop = static_cast<views::WidgetGtk*>(popup_); pop->Show(); visible_ = true; } @@ -42,7 +41,7 @@ void BrowserBubble::Show() { void BrowserBubble::Hide() { if (!visible_) return; - views::WidgetGtk* pop = static_cast<views::WidgetGtk*>(popup_.get()); + views::WidgetGtk* pop = static_cast<views::WidgetGtk*>(popup_); pop->Hide(); visible_ = false; } diff --git a/chrome/browser/views/browser_bubble_win.cc b/chrome/browser/views/browser_bubble_win.cc index e72545b..e1a1a06 100644 --- a/chrome/browser/views/browser_bubble_win.cc +++ b/chrome/browser/views/browser_bubble_win.cc @@ -12,8 +12,8 @@ void BrowserBubble::InitPopup() { gfx::NativeWindow native_window = frame_->GetWindow()->GetNativeWindow(); views::WidgetWin* pop = new views::WidgetWin(); - pop->set_delete_on_destroy(false); pop->set_window_style(WS_POPUP); + #if 0 // TODO(erikkay) Layered windows don't draw child windows. // Apparently there's some tricks you can do to handle that. @@ -22,25 +22,26 @@ void BrowserBubble::InitPopup() { l10n_util::GetExtendedTooltipStyles()); pop->SetOpacity(0xFF); #endif + // A focus manager is necessary if you want to be able to handle various // mouse events properly. pop->Init(frame_native_view_, bounds_); pop->SetContentsView(view_); - popup_.reset(pop); - Reposition(); + popup_ = pop; + Reposition(); AttachToBrowser(); } void BrowserBubble::MovePopup(int x, int y, int w, int h) { - views::WidgetWin* pop = static_cast<views::WidgetWin*>(popup_.get()); + views::WidgetWin* pop = static_cast<views::WidgetWin*>(popup_); pop->MoveWindow(x, y, w, h); } void BrowserBubble::Show() { if (visible_) return; - views::WidgetWin* pop = static_cast<views::WidgetWin*>(popup_.get()); + views::WidgetWin* pop = static_cast<views::WidgetWin*>(popup_); pop->Show(); visible_ = true; } @@ -48,7 +49,7 @@ void BrowserBubble::Show() { void BrowserBubble::Hide() { if (!visible_) return; - views::WidgetWin* pop = static_cast<views::WidgetWin*>(popup_.get()); + views::WidgetWin* pop = static_cast<views::WidgetWin*>(popup_); pop->Hide(); visible_ = false; } diff --git a/chrome/browser/views/extensions/extension_shelf.cc b/chrome/browser/views/extensions/extension_shelf.cc index 19f0f03..a3ac3bf 100644 --- a/chrome/browser/views/extensions/extension_shelf.cc +++ b/chrome/browser/views/extensions/extension_shelf.cc @@ -473,9 +473,8 @@ void ExtensionShelf::Toolstrip::AnimationProgressed( void ExtensionShelf::Toolstrip::AnimationEnded(const Animation* animation) { LayoutHandle(); if (!expanded_) { - // Must use the delay due to bug 18248. - HideShelfHandle(kHideDelayMs * 2); AttachToShelf(false); + HideShelfHandle(0); } } |