| OLD | NEW |
| 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/views/bubble/bubble_frame_view.h" | 9 #include "ui/views/bubble/bubble_frame_view.h" |
| 10 #include "ui/views/widget/widget.h" | 10 #include "ui/views/widget/widget.h" |
| (...skipping 227 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 238 GetWidget()->Close(); | 238 GetWidget()->Close(); |
| 239 } | 239 } |
| 240 | 240 |
| 241 void BubbleDelegateView::OnWidgetMoved(Widget* widget) { | 241 void BubbleDelegateView::OnWidgetMoved(Widget* widget) { |
| 242 if (move_with_anchor() && anchor_widget() == widget) | 242 if (move_with_anchor() && anchor_widget() == widget) |
| 243 SizeToContents(); | 243 SizeToContents(); |
| 244 } | 244 } |
| 245 | 245 |
| 246 gfx::Rect BubbleDelegateView::GetAnchorRect() { | 246 gfx::Rect BubbleDelegateView::GetAnchorRect() { |
| 247 if (!anchor_view()) | 247 if (!anchor_view()) |
| 248 return gfx::Rect(); | 248 return gfx::Rect(anchor_point_, gfx::Size()); |
| 249 gfx::Rect anchor_bounds = anchor_view()->GetBoundsInScreen(); | 249 gfx::Rect anchor_bounds = anchor_view()->GetBoundsInScreen(); |
| 250 anchor_bounds.Inset(anchor_insets_); | 250 anchor_bounds.Inset(anchor_insets_); |
| 251 return anchor_bounds; | 251 return anchor_bounds; |
| 252 } | 252 } |
| 253 | 253 |
| 254 void BubbleDelegateView::Show() { | 254 void BubbleDelegateView::Show() { |
| 255 GetWidget()->Show(); | 255 GetWidget()->Show(); |
| 256 } | 256 } |
| 257 | 257 |
| 258 void BubbleDelegateView::StartFade(bool fade_in) { | 258 void BubbleDelegateView::StartFade(bool fade_in) { |
| (...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 355 | 355 |
| 356 #if defined(OS_WIN) && !defined(USE_AURA) | 356 #if defined(OS_WIN) && !defined(USE_AURA) |
| 357 gfx::Rect BubbleDelegateView::GetBubbleClientBounds() const { | 357 gfx::Rect BubbleDelegateView::GetBubbleClientBounds() const { |
| 358 gfx::Rect client_bounds(GetBubbleFrameView()->GetBoundsForClientView()); | 358 gfx::Rect client_bounds(GetBubbleFrameView()->GetBoundsForClientView()); |
| 359 client_bounds.Offset(border_widget_->GetWindowBoundsInScreen().origin()); | 359 client_bounds.Offset(border_widget_->GetWindowBoundsInScreen().origin()); |
| 360 return client_bounds; | 360 return client_bounds; |
| 361 } | 361 } |
| 362 #endif | 362 #endif |
| 363 | 363 |
| 364 } // namespace views | 364 } // namespace views |
| OLD | NEW |