Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(34)

Side by Side Diff: ui/views/bubble/bubble_delegate.cc

Issue 13699002: add HideAndClose in preference to having Close sometimes magically defer (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: non aura Created 7 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "ui/views/bubble/bubble_delegate.h" 5 #include "ui/views/bubble/bubble_delegate.h"
6 6
7 #include "ui/base/animation/slide_animation.h" 7 #include "ui/base/animation/slide_animation.h"
8 #include "ui/gfx/color_utils.h" 8 #include "ui/gfx/color_utils.h"
9 #include "ui/gfx/rect.h" 9 #include "ui/gfx/rect.h"
10 #include "ui/native_theme/native_theme.h" 10 #include "ui/native_theme/native_theme.h"
(...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after
214 anchor_widget()->GetTopLevelWidget()->DisableInactiveRendering(); 214 anchor_widget()->GetTopLevelWidget()->DisableInactiveRendering();
215 } else { 215 } else {
216 if (border_widget_) 216 if (border_widget_)
217 border_widget_->Hide(); 217 border_widget_->Hide();
218 } 218 }
219 } 219 }
220 220
221 void BubbleDelegateView::OnWidgetActivationChanged(Widget* widget, 221 void BubbleDelegateView::OnWidgetActivationChanged(Widget* widget,
222 bool active) { 222 bool active) {
223 if (close_on_deactivate() && widget == GetWidget() && !active) 223 if (close_on_deactivate() && widget == GetWidget() && !active)
224 GetWidget()->Close(); 224 GetWidget()->HideAndClose();
225 } 225 }
226 226
227 void BubbleDelegateView::OnWidgetBoundsChanged(Widget* widget, 227 void BubbleDelegateView::OnWidgetBoundsChanged(Widget* widget,
228 const gfx::Rect& new_bounds) { 228 const gfx::Rect& new_bounds) {
229 if (move_with_anchor() && anchor_widget() == widget) 229 if (move_with_anchor() && anchor_widget() == widget)
230 SizeToContents(); 230 SizeToContents();
231 } 231 }
232 232
233 gfx::Rect BubbleDelegateView::GetAnchorRect() { 233 gfx::Rect BubbleDelegateView::GetAnchorRect() {
234 if (!anchor_view()) 234 if (!anchor_view())
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after
354 #if defined(OS_WIN) && !defined(USE_AURA) 354 #if defined(OS_WIN) && !defined(USE_AURA)
355 gfx::Rect BubbleDelegateView::GetBubbleClientBounds() const { 355 gfx::Rect BubbleDelegateView::GetBubbleClientBounds() const {
356 gfx::Rect client_bounds(GetBubbleFrameView()->GetBoundsForClientView()); 356 gfx::Rect client_bounds(GetBubbleFrameView()->GetBoundsForClientView());
357 client_bounds.Offset( 357 client_bounds.Offset(
358 border_widget_->GetWindowBoundsInScreen().OffsetFromOrigin()); 358 border_widget_->GetWindowBoundsInScreen().OffsetFromOrigin());
359 return client_bounds; 359 return client_bounds;
360 } 360 }
361 #endif 361 #endif
362 362
363 } // namespace views 363 } // namespace views
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698