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 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
160 } | 160 } |
161 | 161 |
162 View* BubbleDelegateView::GetInitiallyFocusedView() { | 162 View* BubbleDelegateView::GetInitiallyFocusedView() { |
163 return this; | 163 return this; |
164 } | 164 } |
165 | 165 |
166 BubbleDelegateView* BubbleDelegateView::AsBubbleDelegate() { | 166 BubbleDelegateView* BubbleDelegateView::AsBubbleDelegate() { |
167 return this; | 167 return this; |
168 } | 168 } |
169 | 169 |
| 170 void BubbleDelegateView::WindowClosing() { |
| 171 if (anchor_widget_) { |
| 172 anchor_widget_->RemoveObserver(this); |
| 173 anchor_widget_ = NULL; |
| 174 anchor_view_ = NULL; |
| 175 } |
| 176 } |
| 177 |
170 View* BubbleDelegateView::GetContentsView() { | 178 View* BubbleDelegateView::GetContentsView() { |
171 return this; | 179 return this; |
172 } | 180 } |
173 | 181 |
174 NonClientFrameView* BubbleDelegateView::CreateNonClientFrameView( | 182 NonClientFrameView* BubbleDelegateView::CreateNonClientFrameView( |
175 Widget* widget) { | 183 Widget* widget) { |
176 return new BubbleFrameView(arrow_location(), color(), margin()); | 184 return new BubbleFrameView(arrow_location(), color(), margin()); |
177 } | 185 } |
178 | 186 |
179 void BubbleDelegateView::OnWidgetClosing(Widget* widget) { | 187 void BubbleDelegateView::OnWidgetClosing(Widget* widget) { |
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
325 | 333 |
326 #if defined(OS_WIN) && !defined(USE_AURA) | 334 #if defined(OS_WIN) && !defined(USE_AURA) |
327 gfx::Rect BubbleDelegateView::GetBubbleClientBounds() const { | 335 gfx::Rect BubbleDelegateView::GetBubbleClientBounds() const { |
328 gfx::Rect client_bounds(GetBubbleFrameView()->GetBoundsForClientView()); | 336 gfx::Rect client_bounds(GetBubbleFrameView()->GetBoundsForClientView()); |
329 client_bounds.Offset(border_widget_->GetWindowScreenBounds().origin()); | 337 client_bounds.Offset(border_widget_->GetWindowScreenBounds().origin()); |
330 return client_bounds; | 338 return client_bounds; |
331 } | 339 } |
332 #endif | 340 #endif |
333 | 341 |
334 } // namespace views | 342 } // namespace views |
OLD | NEW |