| 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/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 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 189 arrow_loc = BubbleBorder::horizontal_mirror(arrow_loc); | 189 arrow_loc = BubbleBorder::horizontal_mirror(arrow_loc); |
| 190 BubbleBorder* border = new BubbleBorder(arrow_loc, shadow_); | 190 BubbleBorder* border = new BubbleBorder(arrow_loc, shadow_); |
| 191 border->set_background_color(color()); | 191 border->set_background_color(color()); |
| 192 BubbleFrameView* frame_view = new BubbleFrameView(margins(), border); | 192 BubbleFrameView* frame_view = new BubbleFrameView(margins(), border); |
| 193 frame_view->set_background(new BubbleBackground(border)); | 193 frame_view->set_background(new BubbleBackground(border)); |
| 194 return frame_view; | 194 return frame_view; |
| 195 } | 195 } |
| 196 | 196 |
| 197 void BubbleDelegateView::OnWidgetClosing(Widget* widget) { | 197 void BubbleDelegateView::OnWidgetClosing(Widget* widget) { |
| 198 if (anchor_widget() == widget) { | 198 if (anchor_widget() == widget) { |
| 199 anchor_widget_->RemoveObserver(this); |
| 199 anchor_view_ = NULL; | 200 anchor_view_ = NULL; |
| 200 anchor_widget_ = NULL; | 201 anchor_widget_ = NULL; |
| 201 } | 202 } |
| 202 } | 203 } |
| 203 | 204 |
| 204 void BubbleDelegateView::OnWidgetVisibilityChanged(Widget* widget, | 205 void BubbleDelegateView::OnWidgetVisibilityChanged(Widget* widget, |
| 205 bool visible) { | 206 bool visible) { |
| 206 if (widget != GetWidget()) | 207 if (widget != GetWidget()) |
| 207 return; | 208 return; |
| 208 | 209 |
| (...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 357 #if defined(OS_WIN) && !defined(USE_AURA) | 358 #if defined(OS_WIN) && !defined(USE_AURA) |
| 358 gfx::Rect BubbleDelegateView::GetBubbleClientBounds() const { | 359 gfx::Rect BubbleDelegateView::GetBubbleClientBounds() const { |
| 359 gfx::Rect client_bounds(GetBubbleFrameView()->GetBoundsForClientView()); | 360 gfx::Rect client_bounds(GetBubbleFrameView()->GetBoundsForClientView()); |
| 360 client_bounds.Offset( | 361 client_bounds.Offset( |
| 361 border_widget_->GetWindowBoundsInScreen().OffsetFromOrigin()); | 362 border_widget_->GetWindowBoundsInScreen().OffsetFromOrigin()); |
| 362 return client_bounds; | 363 return client_bounds; |
| 363 } | 364 } |
| 364 #endif | 365 #endif |
| 365 | 366 |
| 366 } // namespace views | 367 } // namespace views |
| OLD | NEW |