Chromium Code Reviews| 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 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 156 | 156 |
| 157 bubble_delegate->SizeToContents(); | 157 bubble_delegate->SizeToContents(); |
| 158 bubble_widget->AddObserver(bubble_delegate); | 158 bubble_widget->AddObserver(bubble_delegate); |
| 159 return bubble_widget; | 159 return bubble_widget; |
| 160 } | 160 } |
| 161 | 161 |
| 162 View* BubbleDelegateView::GetInitiallyFocusedView() { | 162 View* BubbleDelegateView::GetInitiallyFocusedView() { |
| 163 return this; | 163 return this; |
| 164 } | 164 } |
| 165 | 165 |
| 166 void BubbleDelegateView::WindowClosing() { | |
| 167 if (anchor_widget_) { | |
|
msw
2012/04/24 18:10:41
nit: use anchor_widget() here and @line168 for r-v
sadrul
2012/04/24 18:15:42
I think we actually prefer directly using the vari
msw
2012/04/24 18:24:58
Fair enough.
| |
| 168 anchor_widget_->RemoveObserver(this); | |
| 169 anchor_widget_ = NULL; | |
|
msw
2012/04/24 18:10:41
Sorry, would you mind also setting anchor_view_ to
sadrul
2012/04/24 18:15:42
Done.
| |
| 170 } | |
| 171 } | |
| 172 | |
| 166 BubbleDelegateView* BubbleDelegateView::AsBubbleDelegate() { | 173 BubbleDelegateView* BubbleDelegateView::AsBubbleDelegate() { |
| 167 return this; | 174 return this; |
| 168 } | 175 } |
| 169 | 176 |
| 170 View* BubbleDelegateView::GetContentsView() { | 177 View* BubbleDelegateView::GetContentsView() { |
| 171 return this; | 178 return this; |
| 172 } | 179 } |
| 173 | 180 |
| 174 NonClientFrameView* BubbleDelegateView::CreateNonClientFrameView( | 181 NonClientFrameView* BubbleDelegateView::CreateNonClientFrameView( |
| 175 Widget* widget) { | 182 Widget* widget) { |
| (...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 325 | 332 |
| 326 #if defined(OS_WIN) && !defined(USE_AURA) | 333 #if defined(OS_WIN) && !defined(USE_AURA) |
| 327 gfx::Rect BubbleDelegateView::GetBubbleClientBounds() const { | 334 gfx::Rect BubbleDelegateView::GetBubbleClientBounds() const { |
| 328 gfx::Rect client_bounds(GetBubbleFrameView()->GetBoundsForClientView()); | 335 gfx::Rect client_bounds(GetBubbleFrameView()->GetBoundsForClientView()); |
| 329 client_bounds.Offset(border_widget_->GetWindowScreenBounds().origin()); | 336 client_bounds.Offset(border_widget_->GetWindowScreenBounds().origin()); |
| 330 return client_bounds; | 337 return client_bounds; |
| 331 } | 338 } |
| 332 #endif | 339 #endif |
| 333 | 340 |
| 334 } // namespace views | 341 } // namespace views |
| OLD | NEW |