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

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

Issue 10204014: views: Make sure the bubble-delegate removes itself from the anchor-widget's observer list. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 8 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
« no previous file with comments | « ui/views/bubble/bubble_delegate.h ('k') | ui/views/widget/widget_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/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
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() {
sky 2012/04/24 19:41:44 Make position match header.
sadrul 2012/04/24 19:47:54 Done.
167 if (anchor_widget_) {
168 anchor_widget_->RemoveObserver(this);
169 anchor_widget_ = NULL;
170 anchor_view_ = NULL;
171 }
172 }
173
166 BubbleDelegateView* BubbleDelegateView::AsBubbleDelegate() { 174 BubbleDelegateView* BubbleDelegateView::AsBubbleDelegate() {
167 return this; 175 return this;
168 } 176 }
169 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) {
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
OLDNEW
« no previous file with comments | « ui/views/bubble/bubble_delegate.h ('k') | ui/views/widget/widget_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698